query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Get infra segment port by ID Get detail information on an infra segment port by giving ID.
def get_infra_segment_port_with_http_info(segment_id, port_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_segment_port ...' end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_segment_port" end # verify the required parameter 'port_id' is set if @api_client.config.client_side_validation && port_id.nil? fail ArgumentError, "Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_segment_port" end # resource path local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_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 => 'SegmentPort') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#get_infra_segment_port\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_port(id)\n if port_valid?(id)\n @port[id]\n else\n raise RuntimeError, \"port (#{id}) does not exist for #{self}\"\n end\n end", "def get_infra_segment_port(segment_id, port_id, opts = {})\n data, _status_code, _headers = get_infra_segment_port_with_http_info(segment_id, port_id, opts)\n data\n end", "def get_infra_segment_port(segment_id, port_id, opts = {})\n data, _status_code, _headers = get_infra_segment_port_with_http_info(segment_id, port_id, opts)\n data\n end", "def get_infra_segment_port_0_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_0(segment_id, port_id, opts = {})\n data, _status_code, _headers = get_infra_segment_port_0_with_http_info(segment_id, port_id, opts)\n data\n end", "def list_infra_segment_ports(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id, opts)\n data\n end", "def list_infra_segment_ports(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id, opts)\n data\n end", "def get_port_detail_info(port)\n get_uri = \"#{@controller.get_node_operational_uri(self)}/node-connector/\"\\\n \"#{self.name}:#{port}\"\n response = @controller.rest_agent.get_request(get_uri)\n check_response_for_success(response) do |body|\n if body.has_key?('node-connector') &&\n body['node-connector'].is_a?(Array) && body['node-connector'][0]\n NetconfResponse.new(NetconfResponseStatus::OK, body['node-connector'][0])\n else\n NetconfResponse.new(NetconfResponseStatus::DATA_NOT_FOUND)\n end\n end\n end", "def set_dev_port\n @dev_port = DevPort.find(params[:id])\n end", "def list_infra_segment_ports_with_http_info(segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports ...'\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.list_infra_segment_ports\"\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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports'.sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_infra_segment_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_infra_segment_ports_with_http_info(segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports ...'\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.list_infra_segment_ports\"\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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports'.sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_infra_segment_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_port_of_container(container_id)\n @logger.info \"Getting port id for container <#{container_id}> ...\"\n port = container_port\n @logger.info \"port for container #{container_id} is : #{port}\"\n\n return port\n end", "def list_infra_segment_ports_0_with_http_info(segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports_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.list_infra_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports'.sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_infra_segment_ports_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_port(analyzer_id)\n @ports_analyzer.each_index { |index|\n if @ports_analyzer[index] == analyzer_id\n port_nbr=@start_port+index\n anl=Analyzer.find(analyzer_id)\n if !anl.nil?#Set port number in database when we assign it in array\n anl.update_attributes({:cmd_port=>port_nbr})\n return port_nbr\n end\n end\n }\n return nil\n end", "def delete_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_infra_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.delete_infra_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.delete_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_infra_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.delete_infra_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.delete_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get id\n @services[id]\n end", "def set_port_service\n @port_service = PortService.find(params[:id])\n end", "def get_storage_port(storage_port_id,auth=nil, cert=nil)\n\t\trest_get(\"#{@base_url}/vdc/storage-ports/#{storage_port_id}\", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert)\n\tend", "def delete_infra_segment_port_0_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_infra_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_infra_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_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port_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_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 get_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\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 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 get_port(port)\n send_request(FUNCTION_GET_PORT, [port], 'k', 1, 'C')\n end", "def show\n @port_info = PortSummary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @port_info }\n end\n end", "def patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show(id:)\n id_check(:id, id)\n\n cf_get(path: \"#{uri_prefix}/virtual_dns/#{id}\")\n end", "def read_parameter_from_device(id)\n execute_command(\"F21 P#{id}\", false, false)\n end", "def list_infra_segment_ports_0(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_0_with_http_info(segment_id, opts)\n data\n end", "def find_vdi_pool_by_id(id)\n begin\n json_response = @vdi_interface.get(id.to_i)\n return json_response[vdi_desktop_object_key]\n rescue RestClient::Exception => e\n if e.response && e.response.code == 404\n print_red_alert \"Virtual Desktop not found by id '#{id}'\"\n else\n raise e\n end\n end\n end", "def get_infra_segment_port_mac_table_in_csv_0(segment_id, port_id, opts = {})\n data, _status_code, _headers = get_infra_segment_port_mac_table_in_csv_0_with_http_info(segment_id, port_id, opts)\n data\n end", "def read_infra_segment(segment_id, opts = {})\n data, _status_code, _headers = read_infra_segment_with_http_info(segment_id, opts)\n data\n end", "def read_infra_segment(segment_id, opts = {})\n data, _status_code, _headers = read_infra_segment_with_http_info(segment_id, opts)\n data\n end", "def read_infra_segment_with_http_info(segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentsApi.read_infra_segment ...'\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 PolicyNetworkingConnectivitySegmentsSegmentsApi.read_infra_segment\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Segment')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentsApi#read_infra_segment\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_infra_segment_with_http_info(segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentsApi.read_infra_segment ...'\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 PolicyNetworkingConnectivitySegmentsSegmentsApi.read_infra_segment\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Segment')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentsApi#read_infra_segment\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_contact_segments(id)\n return make_request(\"#{self.endpoint}/#{id}/segments\")\n end", "def get_infra_segment_port_mac_table_in_csv(segment_id, port_id, opts = {})\n data, _status_code, _headers = get_infra_segment_port_mac_table_in_csv_with_http_info(segment_id, port_id, opts)\n data\n end", "def get_infra_segment_port_mac_table(segment_id, port_id, opts = {})\n data, _status_code, _headers = get_infra_segment_port_mac_table_with_http_info(segment_id, port_id, opts)\n data\n end", "def GetIpFromId(id)\n #puts \"Error. GetIpFromId not defined\"\n #exit 1\n return @rstack.GetIpFromId(id)\n end", "def server_port(id = '__default__')\n @servers[id].port\n end", "def patch_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def read_infra_segment_0_with_http_info(segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentsApi.read_infra_segment_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 PolicyNetworkingConnectivitySegmentsSegmentsApi.read_infra_segment_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Segment')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentsApi#read_infra_segment_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports\"\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.list_tier1_segment_ports\"\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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def find_host_by_id(id)\n begin\n json_response = servers_interface.get(id.to_i)\n return json_response['server']\n rescue RestClient::Exception => e\n if e.response && e.response.code == 404\n print_red_alert \"Host not found by id #{id}\"\n exit 1\n else\n raise e\n end\n end\n end", "def get(id)\n client.read(dstu2_model, id)\n end", "def getPort()\n return @port\n\tend", "def info(session, id)\n read_task('rvpe.host.info', session) do\n call_one_xmlrpc('one.host.info', session, id)\n end\n end", "def patch_infra_segment_port_0(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def find_frame_of_port(port)\n if port.respond_to?(:to_str)\n port = task.find_port(port)\n end\n if result = frame_associations[port]\n result\n else\n supercall(nil, :find_frame_of_port, port)\n end\n end", "def set_simple_portin\n @simple_portin = SimplePortin.find(params[:id])\n end", "def get_port_interrupt(port)\n send_request(FUNCTION_GET_PORT_INTERRUPT, [port], 'k', 1, 'C')\n end", "def device_ports(device_id)\n return get_request(address(\"ports?device_id=#{device_id}\"), @token)\n end", "def set_servdetail\n @servdetail = Servdetail.find(params[:id])\n end", "def service(id)\n request :get, \"/services/#{id}\"\n end", "def set_port_of_call\n @port_of_call = PortOfCall.find(params[:id])\n end", "def get(id = nil)\n super.extend(CmdDic)\n end", "def find_card_by_id(id)\n @board.cards.find{|c| c.short_id == id.to_i}\n end", "def get_first_port\n flist = Fiberstrand.where(\"connection_id = \" + self.id.to_s)\n \n fportid=0\n # binding.pry\n flist.each do |fiber|\n fport = Devport.find_by_id(fiber.porta)\n fportid=fport.id\n break if (fport.fiber_in_id==0)\n fportid=0\n end\n \n fportid\n \n end", "def find_segment(list_id)\n begin\n # further body params found here: https://mailchimp.com/developer/marketing/api/list-segments/list-segments/\n response = @mailchimp.lists.list_segments(list_id, {\n exclude_fields: ['_links'],\n count: 1, # should be removed if we want to scan and filter segments more smartly; defaults to 10\n })\n\n segments = response['segments']\n return 'no segments available', true if segments.nil? or segments.empty?\n return segments[0]['id'], false\n rescue MailchimpMarketing::ApiError => e\n @errors << e\n return e.to_s, true\n end\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_security_profile_binding_0_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_infra_segment_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_infra_segment_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#get_infra_segment_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports_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.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_mac_table_0_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_0, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}/mac-table'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_infra_segment_port_mac_table_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def airport(id)\n perform_get(\"/airports/#{id}.xml\")\n end", "def get_infra_segment_port_mac_table_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table ...'\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table, 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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}/mac-table'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_infra_segment_port_mac_table\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_security_profile_binding_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_infra_segment_port_security_profile_binding ...'\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_infra_segment_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_infra_segment_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_infra_segment_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#get_infra_segment_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_infra_segment_port_0(segment_id, port_id, opts = {})\n delete_infra_segment_port_0_with_http_info(segment_id, port_id, opts)\n nil\n end", "def find_service(id)\n self.class.get(\"/services/#{id}.json?apikey=#{apikey}\")\n end", "def get_gdom_console_port(options)\n message = \"Information:\\tDetermining Virtual Console Port for Guest Domain \"+options['name']\n command = \"ldm list-bindings #{options['name']} |grep vcc |awk '{print $3}'\"\n vcc_port = execute_command(options,message,command)\n return vcc_port\nend", "def read_parameter_from_device(id)\n @ramps_arduino.execute_command(\"F21 P#{id}\", false, false)\n end", "def show\n @segment_detail = SegmentDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @segment_detail }\n end\n end", "def find(id)\n end", "def get_infra_segment_port_mac_table_0(segment_id, port_id, opts = {})\n data, _status_code, _headers = get_infra_segment_port_mac_table_0_with_http_info(segment_id, port_id, opts)\n data\n end", "def get_debugger_port\n throw \"Could not get devices from adb\" if @adb.getDevices.size == 0\n dev = @adb.getDevices[0]\n sleep(1)\n throw \"Could not get clients for device (#{dev})\" if dev.getClients.size == 0\n dev.getClients.each do |cli|\n $DEBUG and puts(\"Found process: #{cli}\")\n if(cli.getClientData.getDebuggerConnectionStatus.to_s == \"WAITING\")\n $DEBUG and puts(\"Found process waiting for debugger: #{cli} : #{cli.getDebuggerListenPort}\")\n return(cli.getDebuggerListenPort)\n end\n end\n throw(\"Could not find a process waiting for debugger.\")\n return(nil)\n end", "def show(id)\n @contract = Locomotive::Contract.get(id)\n raise NotFound unless @contract\n display @contract\n end", "def segment(id_or_options, options = {})\n id, options = parse_args(id_or_options, options)\n Strava::Models::Segment.new(get(\"segments/#{id}\", options))\n end", "def create_or_replace_infra_segment_port_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_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_infra_segment_port_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def host_detail(scan_id, host_id)\n res = http_get(:uri=>\"/scans/#{scan_id}/hosts/#{host_id}\", :fields=>x_cookie)\n end", "def dcerpc_endpoint_find_udp(host, uuid, vers, transport)\n\t\tres = dcerpc_endpoint_list()\n\t\treturn nil if not res\n\n\t\tres.each do |ent|\n\t\t\tif (ent[:uuid] == uuid and ent[:vers] == vers and ent[:prot] == 'udp')\n\t\t\t\treturn ent[:port]\n\t\t\tend\n\t\tend\n\n\t\tnil\n\tend", "def delete_infra_segment_port(segment_id, port_id, opts = {})\n delete_infra_segment_port_with_http_info(segment_id, port_id, opts)\n nil\n end", "def delete_infra_segment_port(segment_id, port_id, opts = {})\n delete_infra_segment_port_with_http_info(segment_id, port_id, opts)\n nil\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 details\n response = cs_get \"/segments/#{segment_id}.json\", {}\n Hashie::Mash.new(response)\n end", "def get_infra_segment_port_mac_table_in_csv_0_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_in_csv_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_in_csv_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_in_csv_0\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}/mac-table?format=csv'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPortMacAddressCsvListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_infra_segment_port_mac_table_in_csv_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_network_ports(network_id)\n get(\"cloud-instances/#{guid}/networks/#{network_id}/ports\")[\"ports\"]\n end", "def get_contact(id)\n\t\[email protected]_contact(id)\n\tend", "def get_infra_segment_port_mac_table_in_csv_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_in_csv ...'\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_in_csv\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_in_csv\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}/mac-table?format=csv'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPortMacAddressCsvListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_infra_segment_port_mac_table_in_csv\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segment_port_mac_table_in_csv_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_in_csv_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def port\n @port ||= presenter.port\n end" ]
[ "0.679937", "0.65083134", "0.65083134", "0.6380113", "0.61166555", "0.5807281", "0.5807281", "0.57703", "0.56931674", "0.56918156", "0.56918156", "0.5658188", "0.5658188", "0.5649823", "0.5649823", "0.5646096", "0.5618963", "0.5616427", "0.5542724", "0.5542724", "0.55405664", "0.5519636", "0.5511699", "0.5496137", "0.5472462", "0.54236686", "0.54127085", "0.5373663", "0.536178", "0.5314427", "0.5295064", "0.5295064", "0.5283798", "0.52815044", "0.52586716", "0.5246913", "0.5245427", "0.5218395", "0.51958", "0.51958", "0.51926905", "0.51926905", "0.5171344", "0.5151286", "0.51444405", "0.5134138", "0.51178193", "0.50933576", "0.50933576", "0.50773555", "0.50741416", "0.50604105", "0.50601846", "0.50565815", "0.5051978", "0.5045957", "0.5043566", "0.5040546", "0.5036424", "0.5026816", "0.5024833", "0.502153", "0.500591", "0.50009614", "0.49897018", "0.498846", "0.4966584", "0.49621227", "0.49440253", "0.49379697", "0.49361572", "0.49338534", "0.4920122", "0.49156737", "0.4913552", "0.49132562", "0.4909842", "0.49096686", "0.489442", "0.48891225", "0.48807028", "0.48804823", "0.4877652", "0.4876945", "0.48718682", "0.48601243", "0.48601243", "0.4858335", "0.4857342", "0.4856636", "0.4856636", "0.48480332", "0.48440963", "0.48262325", "0.4823972", "0.48238054", "0.48234937", "0.48203903", "0.48173228" ]
0.6429541
4
Get infra segment port by ID Get detail information on an infra segment port by giving ID.
def get_infra_segment_port_0(segment_id, port_id, opts = {}) data, _status_code, _headers = get_infra_segment_port_0_with_http_info(segment_id, port_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_port(id)\n if port_valid?(id)\n @port[id]\n else\n raise RuntimeError, \"port (#{id}) does not exist for #{self}\"\n end\n end", "def get_infra_segment_port(segment_id, port_id, opts = {})\n data, _status_code, _headers = get_infra_segment_port_with_http_info(segment_id, port_id, opts)\n data\n end", "def get_infra_segment_port(segment_id, port_id, opts = {})\n data, _status_code, _headers = get_infra_segment_port_with_http_info(segment_id, port_id, opts)\n data\n end", "def get_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_0_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_infra_segment_ports(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id, opts)\n data\n end", "def list_infra_segment_ports(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id, opts)\n data\n end", "def get_port_detail_info(port)\n get_uri = \"#{@controller.get_node_operational_uri(self)}/node-connector/\"\\\n \"#{self.name}:#{port}\"\n response = @controller.rest_agent.get_request(get_uri)\n check_response_for_success(response) do |body|\n if body.has_key?('node-connector') &&\n body['node-connector'].is_a?(Array) && body['node-connector'][0]\n NetconfResponse.new(NetconfResponseStatus::OK, body['node-connector'][0])\n else\n NetconfResponse.new(NetconfResponseStatus::DATA_NOT_FOUND)\n end\n end\n end", "def set_dev_port\n @dev_port = DevPort.find(params[:id])\n end", "def list_infra_segment_ports_with_http_info(segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports ...'\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.list_infra_segment_ports\"\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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports'.sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_infra_segment_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_infra_segment_ports_with_http_info(segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports ...'\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.list_infra_segment_ports\"\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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports'.sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_infra_segment_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_port_of_container(container_id)\n @logger.info \"Getting port id for container <#{container_id}> ...\"\n port = container_port\n @logger.info \"port for container #{container_id} is : #{port}\"\n\n return port\n end", "def list_infra_segment_ports_0_with_http_info(segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports_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.list_infra_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports'.sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_infra_segment_ports_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_port(analyzer_id)\n @ports_analyzer.each_index { |index|\n if @ports_analyzer[index] == analyzer_id\n port_nbr=@start_port+index\n anl=Analyzer.find(analyzer_id)\n if !anl.nil?#Set port number in database when we assign it in array\n anl.update_attributes({:cmd_port=>port_nbr})\n return port_nbr\n end\n end\n }\n return nil\n end", "def delete_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_infra_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.delete_infra_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.delete_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_infra_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.delete_infra_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.delete_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get id\n @services[id]\n end", "def set_port_service\n @port_service = PortService.find(params[:id])\n end", "def get_storage_port(storage_port_id,auth=nil, cert=nil)\n\t\trest_get(\"#{@base_url}/vdc/storage-ports/#{storage_port_id}\", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert)\n\tend", "def delete_infra_segment_port_0_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_infra_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_infra_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_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port_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_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 get_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\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 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 get_port(port)\n send_request(FUNCTION_GET_PORT, [port], 'k', 1, 'C')\n end", "def show\n @port_info = PortSummary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @port_info }\n end\n end", "def patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show(id:)\n id_check(:id, id)\n\n cf_get(path: \"#{uri_prefix}/virtual_dns/#{id}\")\n end", "def read_parameter_from_device(id)\n execute_command(\"F21 P#{id}\", false, false)\n end", "def list_infra_segment_ports_0(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_0_with_http_info(segment_id, opts)\n data\n end", "def find_vdi_pool_by_id(id)\n begin\n json_response = @vdi_interface.get(id.to_i)\n return json_response[vdi_desktop_object_key]\n rescue RestClient::Exception => e\n if e.response && e.response.code == 404\n print_red_alert \"Virtual Desktop not found by id '#{id}'\"\n else\n raise e\n end\n end\n end", "def get_infra_segment_port_mac_table_in_csv_0(segment_id, port_id, opts = {})\n data, _status_code, _headers = get_infra_segment_port_mac_table_in_csv_0_with_http_info(segment_id, port_id, opts)\n data\n end", "def read_infra_segment(segment_id, opts = {})\n data, _status_code, _headers = read_infra_segment_with_http_info(segment_id, opts)\n data\n end", "def read_infra_segment(segment_id, opts = {})\n data, _status_code, _headers = read_infra_segment_with_http_info(segment_id, opts)\n data\n end", "def read_infra_segment_with_http_info(segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentsApi.read_infra_segment ...'\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 PolicyNetworkingConnectivitySegmentsSegmentsApi.read_infra_segment\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Segment')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentsApi#read_infra_segment\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_infra_segment_with_http_info(segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentsApi.read_infra_segment ...'\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 PolicyNetworkingConnectivitySegmentsSegmentsApi.read_infra_segment\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Segment')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentsApi#read_infra_segment\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_contact_segments(id)\n return make_request(\"#{self.endpoint}/#{id}/segments\")\n end", "def get_infra_segment_port_mac_table_in_csv(segment_id, port_id, opts = {})\n data, _status_code, _headers = get_infra_segment_port_mac_table_in_csv_with_http_info(segment_id, port_id, opts)\n data\n end", "def get_infra_segment_port_mac_table(segment_id, port_id, opts = {})\n data, _status_code, _headers = get_infra_segment_port_mac_table_with_http_info(segment_id, port_id, opts)\n data\n end", "def GetIpFromId(id)\n #puts \"Error. GetIpFromId not defined\"\n #exit 1\n return @rstack.GetIpFromId(id)\n end", "def server_port(id = '__default__')\n @servers[id].port\n end", "def patch_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def read_infra_segment_0_with_http_info(segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentsApi.read_infra_segment_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 PolicyNetworkingConnectivitySegmentsSegmentsApi.read_infra_segment_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Segment')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentsApi#read_infra_segment_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports\"\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.list_tier1_segment_ports\"\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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def find_host_by_id(id)\n begin\n json_response = servers_interface.get(id.to_i)\n return json_response['server']\n rescue RestClient::Exception => e\n if e.response && e.response.code == 404\n print_red_alert \"Host not found by id #{id}\"\n exit 1\n else\n raise e\n end\n end\n end", "def get(id)\n client.read(dstu2_model, id)\n end", "def getPort()\n return @port\n\tend", "def info(session, id)\n read_task('rvpe.host.info', session) do\n call_one_xmlrpc('one.host.info', session, id)\n end\n end", "def patch_infra_segment_port_0(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def find_frame_of_port(port)\n if port.respond_to?(:to_str)\n port = task.find_port(port)\n end\n if result = frame_associations[port]\n result\n else\n supercall(nil, :find_frame_of_port, port)\n end\n end", "def set_simple_portin\n @simple_portin = SimplePortin.find(params[:id])\n end", "def get_port_interrupt(port)\n send_request(FUNCTION_GET_PORT_INTERRUPT, [port], 'k', 1, 'C')\n end", "def device_ports(device_id)\n return get_request(address(\"ports?device_id=#{device_id}\"), @token)\n end", "def set_servdetail\n @servdetail = Servdetail.find(params[:id])\n end", "def service(id)\n request :get, \"/services/#{id}\"\n end", "def set_port_of_call\n @port_of_call = PortOfCall.find(params[:id])\n end", "def get(id = nil)\n super.extend(CmdDic)\n end", "def find_card_by_id(id)\n @board.cards.find{|c| c.short_id == id.to_i}\n end", "def get_first_port\n flist = Fiberstrand.where(\"connection_id = \" + self.id.to_s)\n \n fportid=0\n # binding.pry\n flist.each do |fiber|\n fport = Devport.find_by_id(fiber.porta)\n fportid=fport.id\n break if (fport.fiber_in_id==0)\n fportid=0\n end\n \n fportid\n \n end", "def find_segment(list_id)\n begin\n # further body params found here: https://mailchimp.com/developer/marketing/api/list-segments/list-segments/\n response = @mailchimp.lists.list_segments(list_id, {\n exclude_fields: ['_links'],\n count: 1, # should be removed if we want to scan and filter segments more smartly; defaults to 10\n })\n\n segments = response['segments']\n return 'no segments available', true if segments.nil? or segments.empty?\n return segments[0]['id'], false\n rescue MailchimpMarketing::ApiError => e\n @errors << e\n return e.to_s, true\n end\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_security_profile_binding_0_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_infra_segment_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_infra_segment_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#get_infra_segment_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports_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.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_mac_table_0_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_0, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}/mac-table'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_infra_segment_port_mac_table_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def airport(id)\n perform_get(\"/airports/#{id}.xml\")\n end", "def get_infra_segment_port_mac_table_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table ...'\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table, 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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}/mac-table'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_infra_segment_port_mac_table\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_security_profile_binding_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_infra_segment_port_security_profile_binding ...'\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_infra_segment_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_infra_segment_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_infra_segment_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#get_infra_segment_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_infra_segment_port_0(segment_id, port_id, opts = {})\n delete_infra_segment_port_0_with_http_info(segment_id, port_id, opts)\n nil\n end", "def find_service(id)\n self.class.get(\"/services/#{id}.json?apikey=#{apikey}\")\n end", "def get_gdom_console_port(options)\n message = \"Information:\\tDetermining Virtual Console Port for Guest Domain \"+options['name']\n command = \"ldm list-bindings #{options['name']} |grep vcc |awk '{print $3}'\"\n vcc_port = execute_command(options,message,command)\n return vcc_port\nend", "def read_parameter_from_device(id)\n @ramps_arduino.execute_command(\"F21 P#{id}\", false, false)\n end", "def show\n @segment_detail = SegmentDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @segment_detail }\n end\n end", "def find(id)\n end", "def get_infra_segment_port_mac_table_0(segment_id, port_id, opts = {})\n data, _status_code, _headers = get_infra_segment_port_mac_table_0_with_http_info(segment_id, port_id, opts)\n data\n end", "def get_debugger_port\n throw \"Could not get devices from adb\" if @adb.getDevices.size == 0\n dev = @adb.getDevices[0]\n sleep(1)\n throw \"Could not get clients for device (#{dev})\" if dev.getClients.size == 0\n dev.getClients.each do |cli|\n $DEBUG and puts(\"Found process: #{cli}\")\n if(cli.getClientData.getDebuggerConnectionStatus.to_s == \"WAITING\")\n $DEBUG and puts(\"Found process waiting for debugger: #{cli} : #{cli.getDebuggerListenPort}\")\n return(cli.getDebuggerListenPort)\n end\n end\n throw(\"Could not find a process waiting for debugger.\")\n return(nil)\n end", "def show(id)\n @contract = Locomotive::Contract.get(id)\n raise NotFound unless @contract\n display @contract\n end", "def segment(id_or_options, options = {})\n id, options = parse_args(id_or_options, options)\n Strava::Models::Segment.new(get(\"segments/#{id}\", options))\n end", "def create_or_replace_infra_segment_port_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_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_infra_segment_port_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def host_detail(scan_id, host_id)\n res = http_get(:uri=>\"/scans/#{scan_id}/hosts/#{host_id}\", :fields=>x_cookie)\n end", "def dcerpc_endpoint_find_udp(host, uuid, vers, transport)\n\t\tres = dcerpc_endpoint_list()\n\t\treturn nil if not res\n\n\t\tres.each do |ent|\n\t\t\tif (ent[:uuid] == uuid and ent[:vers] == vers and ent[:prot] == 'udp')\n\t\t\t\treturn ent[:port]\n\t\t\tend\n\t\tend\n\n\t\tnil\n\tend", "def delete_infra_segment_port(segment_id, port_id, opts = {})\n delete_infra_segment_port_with_http_info(segment_id, port_id, opts)\n nil\n end", "def delete_infra_segment_port(segment_id, port_id, opts = {})\n delete_infra_segment_port_with_http_info(segment_id, port_id, opts)\n nil\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 details\n response = cs_get \"/segments/#{segment_id}.json\", {}\n Hashie::Mash.new(response)\n end", "def get_infra_segment_port_mac_table_in_csv_0_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_in_csv_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_in_csv_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_in_csv_0\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}/mac-table?format=csv'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPortMacAddressCsvListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_infra_segment_port_mac_table_in_csv_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_network_ports(network_id)\n get(\"cloud-instances/#{guid}/networks/#{network_id}/ports\")[\"ports\"]\n end", "def get_contact(id)\n\t\[email protected]_contact(id)\n\tend", "def get_infra_segment_port_mac_table_in_csv_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_in_csv ...'\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_in_csv\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_in_csv\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}/mac-table?format=csv'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPortMacAddressCsvListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_infra_segment_port_mac_table_in_csv\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segment_port_mac_table_in_csv_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_in_csv_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def port\n @port ||= presenter.port\n end" ]
[ "0.679937", "0.65083134", "0.65083134", "0.6429541", "0.6429541", "0.6380113", "0.5807281", "0.5807281", "0.57703", "0.56931674", "0.56918156", "0.56918156", "0.5658188", "0.5658188", "0.5649823", "0.5649823", "0.5646096", "0.5618963", "0.5616427", "0.5542724", "0.5542724", "0.55405664", "0.5519636", "0.5511699", "0.5496137", "0.5472462", "0.54236686", "0.54127085", "0.5373663", "0.536178", "0.5314427", "0.5295064", "0.5295064", "0.5283798", "0.52815044", "0.52586716", "0.5246913", "0.5245427", "0.5218395", "0.51958", "0.51958", "0.51926905", "0.51926905", "0.5171344", "0.5151286", "0.51444405", "0.5134138", "0.51178193", "0.50933576", "0.50933576", "0.50773555", "0.50741416", "0.50604105", "0.50601846", "0.50565815", "0.5051978", "0.5045957", "0.5043566", "0.5040546", "0.5036424", "0.5026816", "0.5024833", "0.502153", "0.500591", "0.50009614", "0.49897018", "0.498846", "0.4966584", "0.49621227", "0.49440253", "0.49379697", "0.49361572", "0.49338534", "0.4920122", "0.49156737", "0.4913552", "0.49132562", "0.4909842", "0.49096686", "0.489442", "0.48891225", "0.48807028", "0.48804823", "0.4877652", "0.4876945", "0.48718682", "0.48601243", "0.48601243", "0.4858335", "0.4857342", "0.4856636", "0.4856636", "0.48480332", "0.48440963", "0.48262325", "0.4823972", "0.48238054", "0.48234937", "0.48203903", "0.48173228" ]
0.61166555
6
Get infra segment port by ID Get detail information on an infra segment port by giving ID.
def get_infra_segment_port_0_with_http_info(segment_id, port_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_segment_port_0 ...' end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_segment_port_0" end # verify the required parameter 'port_id' is set if @api_client.config.client_side_validation && port_id.nil? fail ArgumentError, "Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_segment_port_0" end # resource path local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_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 => 'SegmentPort') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#get_infra_segment_port_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_port(id)\n if port_valid?(id)\n @port[id]\n else\n raise RuntimeError, \"port (#{id}) does not exist for #{self}\"\n end\n end", "def get_infra_segment_port(segment_id, port_id, opts = {})\n data, _status_code, _headers = get_infra_segment_port_with_http_info(segment_id, port_id, opts)\n data\n end", "def get_infra_segment_port(segment_id, port_id, opts = {})\n data, _status_code, _headers = get_infra_segment_port_with_http_info(segment_id, port_id, opts)\n data\n end", "def get_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_0(segment_id, port_id, opts = {})\n data, _status_code, _headers = get_infra_segment_port_0_with_http_info(segment_id, port_id, opts)\n data\n end", "def list_infra_segment_ports(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id, opts)\n data\n end", "def list_infra_segment_ports(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id, opts)\n data\n end", "def get_port_detail_info(port)\n get_uri = \"#{@controller.get_node_operational_uri(self)}/node-connector/\"\\\n \"#{self.name}:#{port}\"\n response = @controller.rest_agent.get_request(get_uri)\n check_response_for_success(response) do |body|\n if body.has_key?('node-connector') &&\n body['node-connector'].is_a?(Array) && body['node-connector'][0]\n NetconfResponse.new(NetconfResponseStatus::OK, body['node-connector'][0])\n else\n NetconfResponse.new(NetconfResponseStatus::DATA_NOT_FOUND)\n end\n end\n end", "def set_dev_port\n @dev_port = DevPort.find(params[:id])\n end", "def list_infra_segment_ports_with_http_info(segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports ...'\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.list_infra_segment_ports\"\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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports'.sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_infra_segment_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_infra_segment_ports_with_http_info(segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports ...'\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.list_infra_segment_ports\"\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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports'.sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_infra_segment_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_port_of_container(container_id)\n @logger.info \"Getting port id for container <#{container_id}> ...\"\n port = container_port\n @logger.info \"port for container #{container_id} is : #{port}\"\n\n return port\n end", "def list_infra_segment_ports_0_with_http_info(segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports_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.list_infra_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports'.sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_infra_segment_ports_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_port(analyzer_id)\n @ports_analyzer.each_index { |index|\n if @ports_analyzer[index] == analyzer_id\n port_nbr=@start_port+index\n anl=Analyzer.find(analyzer_id)\n if !anl.nil?#Set port number in database when we assign it in array\n anl.update_attributes({:cmd_port=>port_nbr})\n return port_nbr\n end\n end\n }\n return nil\n end", "def delete_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_infra_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.delete_infra_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.delete_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_infra_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.delete_infra_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.delete_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get id\n @services[id]\n end", "def set_port_service\n @port_service = PortService.find(params[:id])\n end", "def get_storage_port(storage_port_id,auth=nil, cert=nil)\n\t\trest_get(\"#{@base_url}/vdc/storage-ports/#{storage_port_id}\", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert)\n\tend", "def delete_infra_segment_port_0_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_infra_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_infra_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_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port_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_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 get_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\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 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 get_port(port)\n send_request(FUNCTION_GET_PORT, [port], 'k', 1, 'C')\n end", "def show\n @port_info = PortSummary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @port_info }\n end\n end", "def patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show(id:)\n id_check(:id, id)\n\n cf_get(path: \"#{uri_prefix}/virtual_dns/#{id}\")\n end", "def read_parameter_from_device(id)\n execute_command(\"F21 P#{id}\", false, false)\n end", "def list_infra_segment_ports_0(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_0_with_http_info(segment_id, opts)\n data\n end", "def find_vdi_pool_by_id(id)\n begin\n json_response = @vdi_interface.get(id.to_i)\n return json_response[vdi_desktop_object_key]\n rescue RestClient::Exception => e\n if e.response && e.response.code == 404\n print_red_alert \"Virtual Desktop not found by id '#{id}'\"\n else\n raise e\n end\n end\n end", "def get_infra_segment_port_mac_table_in_csv_0(segment_id, port_id, opts = {})\n data, _status_code, _headers = get_infra_segment_port_mac_table_in_csv_0_with_http_info(segment_id, port_id, opts)\n data\n end", "def read_infra_segment(segment_id, opts = {})\n data, _status_code, _headers = read_infra_segment_with_http_info(segment_id, opts)\n data\n end", "def read_infra_segment(segment_id, opts = {})\n data, _status_code, _headers = read_infra_segment_with_http_info(segment_id, opts)\n data\n end", "def read_infra_segment_with_http_info(segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentsApi.read_infra_segment ...'\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 PolicyNetworkingConnectivitySegmentsSegmentsApi.read_infra_segment\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Segment')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentsApi#read_infra_segment\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_infra_segment_with_http_info(segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentsApi.read_infra_segment ...'\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 PolicyNetworkingConnectivitySegmentsSegmentsApi.read_infra_segment\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Segment')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentsApi#read_infra_segment\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_contact_segments(id)\n return make_request(\"#{self.endpoint}/#{id}/segments\")\n end", "def get_infra_segment_port_mac_table_in_csv(segment_id, port_id, opts = {})\n data, _status_code, _headers = get_infra_segment_port_mac_table_in_csv_with_http_info(segment_id, port_id, opts)\n data\n end", "def get_infra_segment_port_mac_table(segment_id, port_id, opts = {})\n data, _status_code, _headers = get_infra_segment_port_mac_table_with_http_info(segment_id, port_id, opts)\n data\n end", "def GetIpFromId(id)\n #puts \"Error. GetIpFromId not defined\"\n #exit 1\n return @rstack.GetIpFromId(id)\n end", "def server_port(id = '__default__')\n @servers[id].port\n end", "def patch_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def read_infra_segment_0_with_http_info(segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentsApi.read_infra_segment_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 PolicyNetworkingConnectivitySegmentsSegmentsApi.read_infra_segment_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Segment')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentsApi#read_infra_segment_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports\"\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.list_tier1_segment_ports\"\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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def find_host_by_id(id)\n begin\n json_response = servers_interface.get(id.to_i)\n return json_response['server']\n rescue RestClient::Exception => e\n if e.response && e.response.code == 404\n print_red_alert \"Host not found by id #{id}\"\n exit 1\n else\n raise e\n end\n end\n end", "def get(id)\n client.read(dstu2_model, id)\n end", "def getPort()\n return @port\n\tend", "def info(session, id)\n read_task('rvpe.host.info', session) do\n call_one_xmlrpc('one.host.info', session, id)\n end\n end", "def patch_infra_segment_port_0(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def find_frame_of_port(port)\n if port.respond_to?(:to_str)\n port = task.find_port(port)\n end\n if result = frame_associations[port]\n result\n else\n supercall(nil, :find_frame_of_port, port)\n end\n end", "def set_simple_portin\n @simple_portin = SimplePortin.find(params[:id])\n end", "def get_port_interrupt(port)\n send_request(FUNCTION_GET_PORT_INTERRUPT, [port], 'k', 1, 'C')\n end", "def device_ports(device_id)\n return get_request(address(\"ports?device_id=#{device_id}\"), @token)\n end", "def set_servdetail\n @servdetail = Servdetail.find(params[:id])\n end", "def service(id)\n request :get, \"/services/#{id}\"\n end", "def set_port_of_call\n @port_of_call = PortOfCall.find(params[:id])\n end", "def get(id = nil)\n super.extend(CmdDic)\n end", "def get_first_port\n flist = Fiberstrand.where(\"connection_id = \" + self.id.to_s)\n \n fportid=0\n # binding.pry\n flist.each do |fiber|\n fport = Devport.find_by_id(fiber.porta)\n fportid=fport.id\n break if (fport.fiber_in_id==0)\n fportid=0\n end\n \n fportid\n \n end", "def find_card_by_id(id)\n @board.cards.find{|c| c.short_id == id.to_i}\n end", "def find_segment(list_id)\n begin\n # further body params found here: https://mailchimp.com/developer/marketing/api/list-segments/list-segments/\n response = @mailchimp.lists.list_segments(list_id, {\n exclude_fields: ['_links'],\n count: 1, # should be removed if we want to scan and filter segments more smartly; defaults to 10\n })\n\n segments = response['segments']\n return 'no segments available', true if segments.nil? or segments.empty?\n return segments[0]['id'], false\n rescue MailchimpMarketing::ApiError => e\n @errors << e\n return e.to_s, true\n end\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_security_profile_binding_0_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_infra_segment_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_infra_segment_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#get_infra_segment_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports_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.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_mac_table_0_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_0, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}/mac-table'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_infra_segment_port_mac_table_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def airport(id)\n perform_get(\"/airports/#{id}.xml\")\n end", "def get_infra_segment_port_mac_table_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table ...'\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table, 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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}/mac-table'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_infra_segment_port_mac_table\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_security_profile_binding_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_infra_segment_port_security_profile_binding ...'\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_infra_segment_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_infra_segment_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_infra_segment_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#get_infra_segment_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_infra_segment_port_0(segment_id, port_id, opts = {})\n delete_infra_segment_port_0_with_http_info(segment_id, port_id, opts)\n nil\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def find_service(id)\n self.class.get(\"/services/#{id}.json?apikey=#{apikey}\")\n end", "def get_gdom_console_port(options)\n message = \"Information:\\tDetermining Virtual Console Port for Guest Domain \"+options['name']\n command = \"ldm list-bindings #{options['name']} |grep vcc |awk '{print $3}'\"\n vcc_port = execute_command(options,message,command)\n return vcc_port\nend", "def read_parameter_from_device(id)\n @ramps_arduino.execute_command(\"F21 P#{id}\", false, false)\n end", "def show\n @segment_detail = SegmentDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @segment_detail }\n end\n end", "def get_infra_segment_port_mac_table_0(segment_id, port_id, opts = {})\n data, _status_code, _headers = get_infra_segment_port_mac_table_0_with_http_info(segment_id, port_id, opts)\n data\n end", "def find(id)\n end", "def get_debugger_port\n throw \"Could not get devices from adb\" if @adb.getDevices.size == 0\n dev = @adb.getDevices[0]\n sleep(1)\n throw \"Could not get clients for device (#{dev})\" if dev.getClients.size == 0\n dev.getClients.each do |cli|\n $DEBUG and puts(\"Found process: #{cli}\")\n if(cli.getClientData.getDebuggerConnectionStatus.to_s == \"WAITING\")\n $DEBUG and puts(\"Found process waiting for debugger: #{cli} : #{cli.getDebuggerListenPort}\")\n return(cli.getDebuggerListenPort)\n end\n end\n throw(\"Could not find a process waiting for debugger.\")\n return(nil)\n end", "def show(id)\n @contract = Locomotive::Contract.get(id)\n raise NotFound unless @contract\n display @contract\n end", "def segment(id_or_options, options = {})\n id, options = parse_args(id_or_options, options)\n Strava::Models::Segment.new(get(\"segments/#{id}\", options))\n end", "def create_or_replace_infra_segment_port_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_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_infra_segment_port_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def host_detail(scan_id, host_id)\n res = http_get(:uri=>\"/scans/#{scan_id}/hosts/#{host_id}\", :fields=>x_cookie)\n end", "def dcerpc_endpoint_find_udp(host, uuid, vers, transport)\n\t\tres = dcerpc_endpoint_list()\n\t\treturn nil if not res\n\n\t\tres.each do |ent|\n\t\t\tif (ent[:uuid] == uuid and ent[:vers] == vers and ent[:prot] == 'udp')\n\t\t\t\treturn ent[:port]\n\t\t\tend\n\t\tend\n\n\t\tnil\n\tend", "def delete_infra_segment_port(segment_id, port_id, opts = {})\n delete_infra_segment_port_with_http_info(segment_id, port_id, opts)\n nil\n end", "def delete_infra_segment_port(segment_id, port_id, opts = {})\n delete_infra_segment_port_with_http_info(segment_id, port_id, opts)\n nil\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 details\n response = cs_get \"/segments/#{segment_id}.json\", {}\n Hashie::Mash.new(response)\n end", "def get_infra_segment_port_mac_table_in_csv_0_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_in_csv_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_in_csv_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_in_csv_0\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}/mac-table?format=csv'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPortMacAddressCsvListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_infra_segment_port_mac_table_in_csv_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_network_ports(network_id)\n get(\"cloud-instances/#{guid}/networks/#{network_id}/ports\")[\"ports\"]\n end", "def get_infra_segment_port_mac_table_in_csv_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_in_csv ...'\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_in_csv\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_infra_segment_port_mac_table_in_csv\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}/mac-table?format=csv'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPortMacAddressCsvListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_infra_segment_port_mac_table_in_csv\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_contact(id)\n\t\[email protected]_contact(id)\n\tend", "def get_tier1_segment_port_mac_table_in_csv_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_in_csv_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def port\n @port ||= presenter.port\n end" ]
[ "0.6799415", "0.6509573", "0.6509573", "0.6429739", "0.6429739", "0.61182874", "0.58084065", "0.58084065", "0.577086", "0.5693864", "0.56919456", "0.56919456", "0.56591517", "0.56591517", "0.56495345", "0.56495345", "0.5646159", "0.56193", "0.5616971", "0.55428857", "0.55428857", "0.5539534", "0.5520625", "0.55115116", "0.5496578", "0.5472038", "0.54240936", "0.5412267", "0.53734934", "0.53624934", "0.5314834", "0.5295826", "0.5295826", "0.528478", "0.52800363", "0.5257415", "0.52481043", "0.52443016", "0.5219691", "0.5196122", "0.5196122", "0.5192123", "0.5192123", "0.5169388", "0.51524854", "0.514528", "0.51341224", "0.5117909", "0.50951976", "0.50951976", "0.5077042", "0.5073761", "0.5061196", "0.5058197", "0.505716", "0.50525016", "0.5047742", "0.504508", "0.5041541", "0.5038224", "0.50270104", "0.50239104", "0.5021205", "0.50062484", "0.49990755", "0.49893707", "0.49877584", "0.49648035", "0.49618557", "0.49447316", "0.4937758", "0.4936232", "0.49349478", "0.4920064", "0.49162823", "0.49145997", "0.4913267", "0.49091315", "0.49090773", "0.48936585", "0.4887747", "0.48816958", "0.48790845", "0.48781183", "0.4875148", "0.48700675", "0.48608363", "0.48608363", "0.48585954", "0.48584238", "0.48580384", "0.48580384", "0.48479337", "0.4841987", "0.48262933", "0.48242337", "0.48235184", "0.48224452", "0.48212528", "0.48181513" ]
0.6380637
5
Get Tier1 segment port by ID Get detail information on a Tier1 segment port by giving ID.
def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {}) data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 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 get_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\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 list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports\"\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.list_tier1_segment_ports\"\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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segment_port_mac_table_in_csv_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_in_csv_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_tier1_segment_port_mac_table_in_csv(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_in_csv_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports_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.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_segment_ports(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\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 get_tier1_segment_port_mac_table(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_port(id)\n if port_valid?(id)\n @port[id]\n else\n raise RuntimeError, \"port (#{id}) does not exist for #{self}\"\n end\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_segment_ports_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_tier1_segment_port_mac_table_in_csv_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_0\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table?format=csv'.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 query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPortMacAddressCsvListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table_in_csv_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segments_by_state(tier_1_id, opts = {})\n data, _status_code, _headers = get_tier1_segments_by_state_with_http_info(tier_1_id, opts)\n data\n end", "def get_tier1_segment_port_mac_table_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_downlink_port_arp_table_for_tier1_segment_in_csv(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_in_csv_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_downlink_port_arp_table_for_tier1_segment_in_csv_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_in_csv_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_tier1_segment_port_mac_table_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table, 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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segment_port_mac_table_in_csv_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table?format=csv'.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 query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPortMacAddressCsvListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table_in_csv\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segment_port_mac_table_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_0, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_downlink_port_arp_table_for_tier1_segment(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_downlink_port_statistics_for_tier1_segment(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_statistics_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_downlink_port_statistics_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment, 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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment, 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}/segments/{segment-id}/gateway-interface-statistics'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 => 'PolicyInterfaceStatistics')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi#get_downlink_port_statistics_for_tier1_segment\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def get_tier1_segments_by_state_0(tier_1_id, opts = {})\n data, _status_code, _headers = get_tier1_segments_by_state_0_with_http_info(tier_1_id, opts)\n data\n end", "def get_downlink_port_arp_table_for_tier1_segment_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_downlink_port_statistics_for_tier1_segment_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_statistics_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_contact_segments(id)\n return make_request(\"#{self.endpoint}/#{id}/segments\")\n end", "def get_infra_segment_port_0_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def get_downlink_port_statistics_summary_for_tier1_segment(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_statistics_summary_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_downlink_port_statistics_summary_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_summary_for_tier1_segment ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_summary_for_tier1_segment\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_summary_for_tier1_segment\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/gateway-interface-statistics/summary'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].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 => 'PolicyInterfaceStatisticsSummary')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi#get_downlink_port_statistics_summary_for_tier1_segment\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_downlink_port_statistics_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment_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}/segments/{segment-id}/gateway-interface-statistics'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 => 'PolicyInterfaceStatistics')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi#get_downlink_port_statistics_for_tier1_segment_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_segment_interface_arp_table_csv_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_segment_interface_arp_table_csv_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def set_dev_port\n @dev_port = DevPort.find(params[:id])\n end", "def get_downlink_port_statistics_summary_for_tier1_segment_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_statistics_summary_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def get_downlink_port_arp_table_for_tier1_segment_in_csv_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv, 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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/gateway-interface-arp-table?format=csv'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InterfaceArpTableInCsvFormat')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi#get_downlink_port_arp_table_for_tier1_segment_in_csv\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_downlink_port_arp_table_for_tier1_segment_in_csv_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv_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}/segments/{segment-id}/gateway-interface-arp-table?format=csv'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InterfaceArpTableInCsvFormat')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi#get_downlink_port_arp_table_for_tier1_segment_in_csv_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_downlink_port_statistics_summary_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_summary_for_tier1_segment_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_summary_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_summary_for_tier1_segment_0\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/gateway-interface-statistics/summary'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].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 => 'PolicyInterfaceStatisticsSummary')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi#get_downlink_port_statistics_summary_for_tier1_segment_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_downlink_port_arp_table_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment, 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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/gateway-interface-arp-table'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 => 'InterfaceArpTable')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi#get_downlink_port_arp_table_for_tier1_segment\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_port_detail_info(port)\n get_uri = \"#{@controller.get_node_operational_uri(self)}/node-connector/\"\\\n \"#{self.name}:#{port}\"\n response = @controller.rest_agent.get_request(get_uri)\n check_response_for_success(response) do |body|\n if body.has_key?('node-connector') &&\n body['node-connector'].is_a?(Array) && body['node-connector'][0]\n NetconfResponse.new(NetconfResponseStatus::OK, body['node-connector'][0])\n else\n NetconfResponse.new(NetconfResponseStatus::DATA_NOT_FOUND)\n end\n end\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 get_segment_interface_arp_table_csv(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_segment_interface_arp_table_csv_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_port(analyzer_id)\n @ports_analyzer.each_index { |index|\n if @ports_analyzer[index] == analyzer_id\n port_nbr=@start_port+index\n anl=Analyzer.find(analyzer_id)\n if !anl.nil?#Set port number in database when we assign it in array\n anl.update_attributes({:cmd_port=>port_nbr})\n return port_nbr\n end\n end\n }\n return nil\n end", "def get_first_port\n flist = Fiberstrand.where(\"connection_id = \" + self.id.to_s)\n \n fportid=0\n # binding.pry\n flist.each do |fiber|\n fport = Devport.find_by_id(fiber.porta)\n fportid=fport.id\n break if (fport.fiber_in_id==0)\n fportid=0\n end\n \n fportid\n \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 delete_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def set_simple_portin\n @simple_portin = SimplePortin.find(params[:id])\n end", "def delete_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def delete_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def get_downlink_port_arp_table_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_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}/segments/{segment-id}/gateway-interface-arp-table'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 => 'InterfaceArpTable')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi#get_downlink_port_arp_table_for_tier1_segment_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(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def create_or_replace_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def show\n @port_info = PortSummary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @port_info }\n end\n end", "def get_tier1_segments_by_state_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentStateApi.get_tier1_segments_by_state ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentStateApi.get_tier1_segments_by_state\"\n end\n if @api_client.config.client_side_validation && opts[:'configuration_state'] && !['pending', 'in_progress', 'success', 'failed', 'partial_success', 'orphaned', 'unknown'].include?(opts[:'configuration_state'])\n fail ArgumentError, 'invalid value for \"configuration_state\", must be one of pending, in_progress, success, failed, partial_success, orphaned, unknown'\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/state'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'configuration_state'] = opts[:'configuration_state'] if !opts[:'configuration_state'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].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 => 'SegmentConfigurationStateListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentStateApi#get_tier1_segments_by_state\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_servdetail\n @servdetail = Servdetail.find(params[:id])\n end", "def get_trip_detail(id)\n server_response = handle_timeouts do\n get \"/1/trips/#{id}.json?locale=en\"\n end\n server_response['response']\n end", "def show\n # If cost()>10:\n @trip = Trip.find_by(uuid: params[:id])\n # else \n # @trip = Trip.find_by(uuid: params[:id1])\n\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 get id\n @services[id]\n end", "def read_parameter_from_device(id)\n execute_command(\"F21 P#{id}\", false, false)\n end", "def get_tier1_segments_by_state_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentStateApi.get_tier1_segments_by_state_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentStateApi.get_tier1_segments_by_state_0\"\n end\n if @api_client.config.client_side_validation && opts[:'configuration_state'] && !['pending', 'in_progress', 'success', 'failed', 'partial_success', 'orphaned', 'unknown'].include?(opts[:'configuration_state'])\n fail ArgumentError, 'invalid value for \"configuration_state\", must be one of pending, in_progress, success, failed, partial_success, orphaned, unknown'\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/state'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'configuration_state'] = opts[:'configuration_state'] if !opts[:'configuration_state'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].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 => 'SegmentConfigurationStateListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentStateApi#get_tier1_segments_by_state_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_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def set_port_service\n @port_service = PortService.find(params[:id])\n end", "def get_segment_interface_arp_table_csv_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv_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}/segments/{segment-id}/arp-table?format=csv'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InterfaceArpTableInCsvFormat')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi#get_segment_interface_arp_table_csv_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def getDetails id\n\t\tticket = @tickets.read ['id', 'pid', 'title', 'description', 'tracker', 'creator', 'created', 'status'], ['id', id]\n\t\tticket = ticket[0]\n\tend", "def details\n response = cs_get \"/segments/#{segment_id}.json\", {}\n Hashie::Mash.new(response)\n end", "def get_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#get_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n @segment_detail = SegmentDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @segment_detail }\n end\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 get_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#get_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_porter\n @porter = Porter.find(params[:id])\n end", "def get_segment_interface_arp_table_csv_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv, 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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv, 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}/segments/{segment-id}/arp-table?format=csv'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InterfaceArpTableInCsvFormat')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi#get_segment_interface_arp_table_csv\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n @ptid = Ptid.find(params[:id])\n @title = Ptid.find(params[:id]).ptid + \" Details\"\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ptid }\n end\n end", "def read_parameter_from_device(id)\n @ramps_arduino.execute_command(\"F21 P#{id}\", false, false)\n end", "def service(id)\n request :get, \"/services/#{id}\"\n end", "def get_device_switch_port(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'serial' => options['serial'],\r\n 'number' => options['number']\r\n )\r\n # Prepare query url.\r\n _path_url = '/devices/{serial}/switchPorts/{number}'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'serial' => options['serial'],\r\n 'number' => options['number']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end", "def partitioned_path(id)\n (\"%06d\" % id).scan(/.../)\n end", "def get(id)\n client.read(dstu2_model, id)\n end", "def show\n @id = params[:id]\n if @id\n @plans = Plan.where(:servicio_id => @id)\n else\n @plans = Plan.all\n end\n\n end", "def details\n response = @create_send.get \"/segments/#{segment_id}.json\", {}\n Hashie::Mash.new(response)\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 get_port(port)\n send_request(FUNCTION_GET_PORT, [port], 'k', 1, 'C')\n end", "def set_switch_port\n @switch_port = SwitchPort.find(params[:id])\n end", "def get_tier1_forwarding_table_csv_0(tier_1_id, opts = {})\n data, _status_code, _headers = get_tier1_forwarding_table_csv_0_with_http_info(tier_1_id, opts)\n data\n end", "def get_tier1_forwarding_table_csv(tier_1_id, opts = {})\n data, _status_code, _headers = get_tier1_forwarding_table_csv_with_http_info(tier_1_id, opts)\n data\n end", "def show\n @segment_name = SegmentName.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @segment_name }\n end\n end", "def list_port_security_profile_bindings_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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings, 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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].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 => 'PortSecurityProfileBindingMapListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#list_port_security_profile_bindings\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end" ]
[ "0.6672503", "0.66418344", "0.6600694", "0.65811145", "0.63239557", "0.6299877", "0.6252428", "0.62009776", "0.6066235", "0.60572195", "0.6037117", "0.5935328", "0.5934927", "0.5934858", "0.5934156", "0.5844328", "0.58353436", "0.58300275", "0.5798993", "0.57891256", "0.57439107", "0.57380325", "0.57354105", "0.5718981", "0.5711965", "0.5706044", "0.5672456", "0.5530646", "0.55001193", "0.54962355", "0.54962355", "0.5490387", "0.54769194", "0.547207", "0.5438056", "0.54148066", "0.5389846", "0.53734833", "0.53615355", "0.5350684", "0.5350684", "0.5342391", "0.5328745", "0.5320021", "0.531701", "0.5300369", "0.5300369", "0.5270293", "0.5258374", "0.5250319", "0.5246695", "0.5236458", "0.5236043", "0.523348", "0.5226188", "0.5219767", "0.521602", "0.5155523", "0.5152211", "0.51503897", "0.51503897", "0.51498747", "0.5149024", "0.5149024", "0.5131639", "0.512624", "0.5126212", "0.50963527", "0.50959814", "0.5092867", "0.50528127", "0.50518084", "0.50458574", "0.5040087", "0.5038055", "0.5000637", "0.497586", "0.49697724", "0.4955326", "0.49487296", "0.4925338", "0.49214062", "0.4920748", "0.49075896", "0.4899964", "0.48950863", "0.4895034", "0.488758", "0.4886146", "0.48835602", "0.48634917", "0.48531076", "0.48523915", "0.4839666", "0.4838826", "0.48368806", "0.4825892", "0.48231602", "0.48212275" ]
0.68667036
1
Get Tier1 segment port by ID Get detail information on a Tier1 segment port by giving ID.
def get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port ...' 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 PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port" end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port" end # verify the required parameter 'port_id' is set if @api_client.config.client_side_validation && port_id.nil? fail ArgumentError, "Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port" end # resource path 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) # 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 => 'SegmentPort') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#get_tier1_segment_port\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_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\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 get_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\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 list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports\"\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.list_tier1_segment_ports\"\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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segment_port_mac_table_in_csv_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_in_csv_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_tier1_segment_port_mac_table_in_csv(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_in_csv_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports_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.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_segment_ports(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\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 get_tier1_segment_port_mac_table(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_port(id)\n if port_valid?(id)\n @port[id]\n else\n raise RuntimeError, \"port (#{id}) does not exist for #{self}\"\n end\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_segment_ports_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_tier1_segment_port_mac_table_in_csv_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_0\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table?format=csv'.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 query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPortMacAddressCsvListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table_in_csv_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segments_by_state(tier_1_id, opts = {})\n data, _status_code, _headers = get_tier1_segments_by_state_with_http_info(tier_1_id, opts)\n data\n end", "def get_tier1_segment_port_mac_table_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_downlink_port_arp_table_for_tier1_segment_in_csv(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_in_csv_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_downlink_port_arp_table_for_tier1_segment_in_csv_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_in_csv_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_tier1_segment_port_mac_table_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table, 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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segment_port_mac_table_in_csv_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table?format=csv'.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 query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPortMacAddressCsvListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table_in_csv\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segment_port_mac_table_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_0, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_downlink_port_arp_table_for_tier1_segment(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_downlink_port_statistics_for_tier1_segment(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_statistics_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_downlink_port_statistics_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment, 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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment, 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}/segments/{segment-id}/gateway-interface-statistics'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 => 'PolicyInterfaceStatistics')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi#get_downlink_port_statistics_for_tier1_segment\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def get_tier1_segments_by_state_0(tier_1_id, opts = {})\n data, _status_code, _headers = get_tier1_segments_by_state_0_with_http_info(tier_1_id, opts)\n data\n end", "def get_downlink_port_arp_table_for_tier1_segment_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_downlink_port_statistics_for_tier1_segment_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_statistics_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_contact_segments(id)\n return make_request(\"#{self.endpoint}/#{id}/segments\")\n end", "def get_infra_segment_port_0_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def get_downlink_port_statistics_summary_for_tier1_segment(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_statistics_summary_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_downlink_port_statistics_summary_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_summary_for_tier1_segment ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_summary_for_tier1_segment\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_summary_for_tier1_segment\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/gateway-interface-statistics/summary'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].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 => 'PolicyInterfaceStatisticsSummary')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi#get_downlink_port_statistics_summary_for_tier1_segment\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_downlink_port_statistics_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment_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}/segments/{segment-id}/gateway-interface-statistics'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 => 'PolicyInterfaceStatistics')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi#get_downlink_port_statistics_for_tier1_segment_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_segment_interface_arp_table_csv_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_segment_interface_arp_table_csv_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def set_dev_port\n @dev_port = DevPort.find(params[:id])\n end", "def get_downlink_port_statistics_summary_for_tier1_segment_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_statistics_summary_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def get_downlink_port_arp_table_for_tier1_segment_in_csv_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv, 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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/gateway-interface-arp-table?format=csv'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InterfaceArpTableInCsvFormat')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi#get_downlink_port_arp_table_for_tier1_segment_in_csv\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_downlink_port_arp_table_for_tier1_segment_in_csv_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv_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}/segments/{segment-id}/gateway-interface-arp-table?format=csv'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InterfaceArpTableInCsvFormat')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi#get_downlink_port_arp_table_for_tier1_segment_in_csv_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_downlink_port_statistics_summary_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_summary_for_tier1_segment_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_summary_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_summary_for_tier1_segment_0\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/gateway-interface-statistics/summary'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].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 => 'PolicyInterfaceStatisticsSummary')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi#get_downlink_port_statistics_summary_for_tier1_segment_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_downlink_port_arp_table_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment, 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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/gateway-interface-arp-table'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 => 'InterfaceArpTable')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi#get_downlink_port_arp_table_for_tier1_segment\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_port_detail_info(port)\n get_uri = \"#{@controller.get_node_operational_uri(self)}/node-connector/\"\\\n \"#{self.name}:#{port}\"\n response = @controller.rest_agent.get_request(get_uri)\n check_response_for_success(response) do |body|\n if body.has_key?('node-connector') &&\n body['node-connector'].is_a?(Array) && body['node-connector'][0]\n NetconfResponse.new(NetconfResponseStatus::OK, body['node-connector'][0])\n else\n NetconfResponse.new(NetconfResponseStatus::DATA_NOT_FOUND)\n end\n end\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 get_segment_interface_arp_table_csv(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_segment_interface_arp_table_csv_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_port(analyzer_id)\n @ports_analyzer.each_index { |index|\n if @ports_analyzer[index] == analyzer_id\n port_nbr=@start_port+index\n anl=Analyzer.find(analyzer_id)\n if !anl.nil?#Set port number in database when we assign it in array\n anl.update_attributes({:cmd_port=>port_nbr})\n return port_nbr\n end\n end\n }\n return nil\n end", "def get_first_port\n flist = Fiberstrand.where(\"connection_id = \" + self.id.to_s)\n \n fportid=0\n # binding.pry\n flist.each do |fiber|\n fport = Devport.find_by_id(fiber.porta)\n fportid=fport.id\n break if (fport.fiber_in_id==0)\n fportid=0\n end\n \n fportid\n \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 delete_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def set_simple_portin\n @simple_portin = SimplePortin.find(params[:id])\n end", "def delete_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def delete_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def get_downlink_port_arp_table_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_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}/segments/{segment-id}/gateway-interface-arp-table'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 => 'InterfaceArpTable')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi#get_downlink_port_arp_table_for_tier1_segment_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(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def create_or_replace_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def show\n @port_info = PortSummary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @port_info }\n end\n end", "def get_tier1_segments_by_state_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentStateApi.get_tier1_segments_by_state ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentStateApi.get_tier1_segments_by_state\"\n end\n if @api_client.config.client_side_validation && opts[:'configuration_state'] && !['pending', 'in_progress', 'success', 'failed', 'partial_success', 'orphaned', 'unknown'].include?(opts[:'configuration_state'])\n fail ArgumentError, 'invalid value for \"configuration_state\", must be one of pending, in_progress, success, failed, partial_success, orphaned, unknown'\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/state'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'configuration_state'] = opts[:'configuration_state'] if !opts[:'configuration_state'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].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 => 'SegmentConfigurationStateListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentStateApi#get_tier1_segments_by_state\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_servdetail\n @servdetail = Servdetail.find(params[:id])\n end", "def get_trip_detail(id)\n server_response = handle_timeouts do\n get \"/1/trips/#{id}.json?locale=en\"\n end\n server_response['response']\n end", "def show\n # If cost()>10:\n @trip = Trip.find_by(uuid: params[:id])\n # else \n # @trip = Trip.find_by(uuid: params[:id1])\n\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 get id\n @services[id]\n end", "def read_parameter_from_device(id)\n execute_command(\"F21 P#{id}\", false, false)\n end", "def get_tier1_segments_by_state_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentStateApi.get_tier1_segments_by_state_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentStateApi.get_tier1_segments_by_state_0\"\n end\n if @api_client.config.client_side_validation && opts[:'configuration_state'] && !['pending', 'in_progress', 'success', 'failed', 'partial_success', 'orphaned', 'unknown'].include?(opts[:'configuration_state'])\n fail ArgumentError, 'invalid value for \"configuration_state\", must be one of pending, in_progress, success, failed, partial_success, orphaned, unknown'\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/state'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'configuration_state'] = opts[:'configuration_state'] if !opts[:'configuration_state'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].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 => 'SegmentConfigurationStateListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentStateApi#get_tier1_segments_by_state_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_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def set_port_service\n @port_service = PortService.find(params[:id])\n end", "def get_segment_interface_arp_table_csv_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv_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}/segments/{segment-id}/arp-table?format=csv'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InterfaceArpTableInCsvFormat')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi#get_segment_interface_arp_table_csv_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def getDetails id\n\t\tticket = @tickets.read ['id', 'pid', 'title', 'description', 'tracker', 'creator', 'created', 'status'], ['id', id]\n\t\tticket = ticket[0]\n\tend", "def details\n response = cs_get \"/segments/#{segment_id}.json\", {}\n Hashie::Mash.new(response)\n end", "def get_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#get_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n @segment_detail = SegmentDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @segment_detail }\n end\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 get_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#get_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_porter\n @porter = Porter.find(params[:id])\n end", "def get_segment_interface_arp_table_csv_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv, 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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv, 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}/segments/{segment-id}/arp-table?format=csv'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InterfaceArpTableInCsvFormat')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi#get_segment_interface_arp_table_csv\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n @ptid = Ptid.find(params[:id])\n @title = Ptid.find(params[:id]).ptid + \" Details\"\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ptid }\n end\n end", "def read_parameter_from_device(id)\n @ramps_arduino.execute_command(\"F21 P#{id}\", false, false)\n end", "def service(id)\n request :get, \"/services/#{id}\"\n end", "def get_device_switch_port(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'serial' => options['serial'],\r\n 'number' => options['number']\r\n )\r\n # Prepare query url.\r\n _path_url = '/devices/{serial}/switchPorts/{number}'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'serial' => options['serial'],\r\n 'number' => options['number']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end", "def partitioned_path(id)\n (\"%06d\" % id).scan(/.../)\n end", "def get(id)\n client.read(dstu2_model, id)\n end", "def show\n @id = params[:id]\n if @id\n @plans = Plan.where(:servicio_id => @id)\n else\n @plans = Plan.all\n end\n\n end", "def details\n response = @create_send.get \"/segments/#{segment_id}.json\", {}\n Hashie::Mash.new(response)\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 get_port(port)\n send_request(FUNCTION_GET_PORT, [port], 'k', 1, 'C')\n end", "def set_switch_port\n @switch_port = SwitchPort.find(params[:id])\n end", "def get_tier1_forwarding_table_csv_0(tier_1_id, opts = {})\n data, _status_code, _headers = get_tier1_forwarding_table_csv_0_with_http_info(tier_1_id, opts)\n data\n end", "def get_tier1_forwarding_table_csv(tier_1_id, opts = {})\n data, _status_code, _headers = get_tier1_forwarding_table_csv_with_http_info(tier_1_id, opts)\n data\n end", "def show\n @segment_name = SegmentName.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @segment_name }\n end\n end", "def list_port_security_profile_bindings_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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings, 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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].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 => 'PortSecurityProfileBindingMapListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#list_port_security_profile_bindings\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end" ]
[ "0.68667036", "0.68667036", "0.66418344", "0.6600694", "0.65811145", "0.63239557", "0.6299877", "0.6252428", "0.62009776", "0.6066235", "0.60572195", "0.6037117", "0.5935328", "0.5934927", "0.5934858", "0.5934156", "0.5844328", "0.58353436", "0.58300275", "0.5798993", "0.57891256", "0.57439107", "0.57380325", "0.57354105", "0.5718981", "0.5711965", "0.5706044", "0.5672456", "0.5530646", "0.55001193", "0.54962355", "0.54962355", "0.5490387", "0.54769194", "0.547207", "0.5438056", "0.54148066", "0.5389846", "0.53734833", "0.53615355", "0.5350684", "0.5350684", "0.5342391", "0.5328745", "0.5320021", "0.531701", "0.5300369", "0.5300369", "0.5270293", "0.5258374", "0.5250319", "0.5246695", "0.5236458", "0.5236043", "0.523348", "0.5226188", "0.5219767", "0.521602", "0.5155523", "0.5152211", "0.51503897", "0.51503897", "0.51498747", "0.5149024", "0.5149024", "0.5131639", "0.512624", "0.5126212", "0.50963527", "0.50959814", "0.5092867", "0.50528127", "0.50518084", "0.50458574", "0.5040087", "0.5038055", "0.5000637", "0.497586", "0.49697724", "0.4955326", "0.49487296", "0.4925338", "0.49214062", "0.4920748", "0.49075896", "0.4899964", "0.48950863", "0.4895034", "0.488758", "0.4886146", "0.48835602", "0.48634917", "0.48531076", "0.48523915", "0.4839666", "0.4838826", "0.48368806", "0.4825892", "0.48231602", "0.48212275" ]
0.6672503
2
Get Tier1 segment port by ID Get detail information on a Tier1 segment port by giving ID.
def get_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {}) data, _status_code, _headers = get_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\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 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 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 list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports\"\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.list_tier1_segment_ports\"\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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segment_port_mac_table_in_csv_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_in_csv_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_tier1_segment_port_mac_table_in_csv(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_in_csv_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports_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.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_segment_ports(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\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 get_tier1_segment_port_mac_table(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_port(id)\n if port_valid?(id)\n @port[id]\n else\n raise RuntimeError, \"port (#{id}) does not exist for #{self}\"\n end\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_segment_ports_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_tier1_segment_port_mac_table_in_csv_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_0\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table?format=csv'.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 query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPortMacAddressCsvListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table_in_csv_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segments_by_state(tier_1_id, opts = {})\n data, _status_code, _headers = get_tier1_segments_by_state_with_http_info(tier_1_id, opts)\n data\n end", "def get_tier1_segment_port_mac_table_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_downlink_port_arp_table_for_tier1_segment_in_csv(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_in_csv_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_downlink_port_arp_table_for_tier1_segment_in_csv_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_in_csv_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_tier1_segment_port_mac_table_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table, 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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segment_port_mac_table_in_csv_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table?format=csv'.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 query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPortMacAddressCsvListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table_in_csv\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segment_port_mac_table_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_0, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_downlink_port_arp_table_for_tier1_segment(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_downlink_port_statistics_for_tier1_segment(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_statistics_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_downlink_port_statistics_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment, 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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment, 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}/segments/{segment-id}/gateway-interface-statistics'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 => 'PolicyInterfaceStatistics')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi#get_downlink_port_statistics_for_tier1_segment\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def get_tier1_segments_by_state_0(tier_1_id, opts = {})\n data, _status_code, _headers = get_tier1_segments_by_state_0_with_http_info(tier_1_id, opts)\n data\n end", "def get_downlink_port_arp_table_for_tier1_segment_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_downlink_port_statistics_for_tier1_segment_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_statistics_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_contact_segments(id)\n return make_request(\"#{self.endpoint}/#{id}/segments\")\n end", "def get_infra_segment_port_0_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def get_downlink_port_statistics_summary_for_tier1_segment(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_statistics_summary_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_downlink_port_statistics_summary_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_summary_for_tier1_segment ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_summary_for_tier1_segment\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_summary_for_tier1_segment\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/gateway-interface-statistics/summary'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].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 => 'PolicyInterfaceStatisticsSummary')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi#get_downlink_port_statistics_summary_for_tier1_segment\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_downlink_port_statistics_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment_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}/segments/{segment-id}/gateway-interface-statistics'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 => 'PolicyInterfaceStatistics')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi#get_downlink_port_statistics_for_tier1_segment_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_segment_interface_arp_table_csv_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_segment_interface_arp_table_csv_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def set_dev_port\n @dev_port = DevPort.find(params[:id])\n end", "def get_downlink_port_statistics_summary_for_tier1_segment_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_statistics_summary_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def get_downlink_port_arp_table_for_tier1_segment_in_csv_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv, 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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/gateway-interface-arp-table?format=csv'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InterfaceArpTableInCsvFormat')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi#get_downlink_port_arp_table_for_tier1_segment_in_csv\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_downlink_port_arp_table_for_tier1_segment_in_csv_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv_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}/segments/{segment-id}/gateway-interface-arp-table?format=csv'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InterfaceArpTableInCsvFormat')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi#get_downlink_port_arp_table_for_tier1_segment_in_csv_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_downlink_port_statistics_summary_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_summary_for_tier1_segment_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_summary_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_summary_for_tier1_segment_0\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/gateway-interface-statistics/summary'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].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 => 'PolicyInterfaceStatisticsSummary')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi#get_downlink_port_statistics_summary_for_tier1_segment_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_downlink_port_arp_table_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment, 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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/gateway-interface-arp-table'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 => 'InterfaceArpTable')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi#get_downlink_port_arp_table_for_tier1_segment\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_segment_interface_arp_table_csv(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_segment_interface_arp_table_csv_with_http_info(tier_1_id, segment_id, opts)\n data\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 get_port_detail_info(port)\n get_uri = \"#{@controller.get_node_operational_uri(self)}/node-connector/\"\\\n \"#{self.name}:#{port}\"\n response = @controller.rest_agent.get_request(get_uri)\n check_response_for_success(response) do |body|\n if body.has_key?('node-connector') &&\n body['node-connector'].is_a?(Array) && body['node-connector'][0]\n NetconfResponse.new(NetconfResponseStatus::OK, body['node-connector'][0])\n else\n NetconfResponse.new(NetconfResponseStatus::DATA_NOT_FOUND)\n end\n end\n end", "def get_port(analyzer_id)\n @ports_analyzer.each_index { |index|\n if @ports_analyzer[index] == analyzer_id\n port_nbr=@start_port+index\n anl=Analyzer.find(analyzer_id)\n if !anl.nil?#Set port number in database when we assign it in array\n anl.update_attributes({:cmd_port=>port_nbr})\n return port_nbr\n end\n end\n }\n return nil\n end", "def get_first_port\n flist = Fiberstrand.where(\"connection_id = \" + self.id.to_s)\n \n fportid=0\n # binding.pry\n flist.each do |fiber|\n fport = Devport.find_by_id(fiber.porta)\n fportid=fport.id\n break if (fport.fiber_in_id==0)\n fportid=0\n end\n \n fportid\n \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 delete_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def delete_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def delete_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def create_or_replace_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def create_or_replace_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def get_downlink_port_arp_table_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_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}/segments/{segment-id}/gateway-interface-arp-table'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 => 'InterfaceArpTable')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi#get_downlink_port_arp_table_for_tier1_segment_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_simple_portin\n @simple_portin = SimplePortin.find(params[:id])\n end", "def show\n @port_info = PortSummary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @port_info }\n end\n end", "def get_tier1_segments_by_state_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentStateApi.get_tier1_segments_by_state ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentStateApi.get_tier1_segments_by_state\"\n end\n if @api_client.config.client_side_validation && opts[:'configuration_state'] && !['pending', 'in_progress', 'success', 'failed', 'partial_success', 'orphaned', 'unknown'].include?(opts[:'configuration_state'])\n fail ArgumentError, 'invalid value for \"configuration_state\", must be one of pending, in_progress, success, failed, partial_success, orphaned, unknown'\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/state'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'configuration_state'] = opts[:'configuration_state'] if !opts[:'configuration_state'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].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 => 'SegmentConfigurationStateListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentStateApi#get_tier1_segments_by_state\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_servdetail\n @servdetail = Servdetail.find(params[:id])\n end", "def get_trip_detail(id)\n server_response = handle_timeouts do\n get \"/1/trips/#{id}.json?locale=en\"\n end\n server_response['response']\n end", "def show\n # If cost()>10:\n @trip = Trip.find_by(uuid: params[:id])\n # else \n # @trip = Trip.find_by(uuid: params[:id1])\n\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 get id\n @services[id]\n end", "def read_parameter_from_device(id)\n execute_command(\"F21 P#{id}\", false, false)\n end", "def get_tier1_segments_by_state_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentStateApi.get_tier1_segments_by_state_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentStateApi.get_tier1_segments_by_state_0\"\n end\n if @api_client.config.client_side_validation && opts[:'configuration_state'] && !['pending', 'in_progress', 'success', 'failed', 'partial_success', 'orphaned', 'unknown'].include?(opts[:'configuration_state'])\n fail ArgumentError, 'invalid value for \"configuration_state\", must be one of pending, in_progress, success, failed, partial_success, orphaned, unknown'\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/state'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'configuration_state'] = opts[:'configuration_state'] if !opts[:'configuration_state'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].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 => 'SegmentConfigurationStateListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentStateApi#get_tier1_segments_by_state_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_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def set_port_service\n @port_service = PortService.find(params[:id])\n end", "def get_segment_interface_arp_table_csv_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv_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}/segments/{segment-id}/arp-table?format=csv'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InterfaceArpTableInCsvFormat')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi#get_segment_interface_arp_table_csv_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def details\n response = cs_get \"/segments/#{segment_id}.json\", {}\n Hashie::Mash.new(response)\n end", "def getDetails id\n\t\tticket = @tickets.read ['id', 'pid', 'title', 'description', 'tracker', 'creator', 'created', 'status'], ['id', id]\n\t\tticket = ticket[0]\n\tend", "def get_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#get_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n @segment_detail = SegmentDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @segment_detail }\n end\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 get_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#get_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_porter\n @porter = Porter.find(params[:id])\n end", "def get_segment_interface_arp_table_csv_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv, 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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv, 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}/segments/{segment-id}/arp-table?format=csv'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InterfaceArpTableInCsvFormat')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi#get_segment_interface_arp_table_csv\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n @ptid = Ptid.find(params[:id])\n @title = Ptid.find(params[:id]).ptid + \" Details\"\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ptid }\n end\n end", "def service(id)\n request :get, \"/services/#{id}\"\n end", "def read_parameter_from_device(id)\n @ramps_arduino.execute_command(\"F21 P#{id}\", false, false)\n end", "def partitioned_path(id)\n (\"%06d\" % id).scan(/.../)\n end", "def get_device_switch_port(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'serial' => options['serial'],\r\n 'number' => options['number']\r\n )\r\n # Prepare query url.\r\n _path_url = '/devices/{serial}/switchPorts/{number}'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'serial' => options['serial'],\r\n 'number' => options['number']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end", "def get(id)\n client.read(dstu2_model, id)\n end", "def show\n @id = params[:id]\n if @id\n @plans = Plan.where(:servicio_id => @id)\n else\n @plans = Plan.all\n end\n\n end", "def details\n response = @create_send.get \"/segments/#{segment_id}.json\", {}\n Hashie::Mash.new(response)\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 get_port(port)\n send_request(FUNCTION_GET_PORT, [port], 'k', 1, 'C')\n end", "def set_switch_port\n @switch_port = SwitchPort.find(params[:id])\n end", "def get_tier1_forwarding_table_csv_0(tier_1_id, opts = {})\n data, _status_code, _headers = get_tier1_forwarding_table_csv_0_with_http_info(tier_1_id, opts)\n data\n end", "def show\n @segment_name = SegmentName.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @segment_name }\n end\n end", "def get_tier1_forwarding_table_csv(tier_1_id, opts = {})\n data, _status_code, _headers = get_tier1_forwarding_table_csv_with_http_info(tier_1_id, opts)\n data\n end", "def get_segment_interface_arp_table(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_segment_interface_arp_table_with_http_info(tier_1_id, segment_id, opts)\n data\n end" ]
[ "0.68675846", "0.68675846", "0.66726923", "0.6641988", "0.65814173", "0.6325217", "0.6301012", "0.6253712", "0.62022257", "0.6068872", "0.6058283", "0.6038137", "0.5936513", "0.5935968", "0.5935382", "0.59346473", "0.58421206", "0.5835746", "0.5832592", "0.5799486", "0.57920974", "0.57447183", "0.57382154", "0.57354355", "0.5719777", "0.57124424", "0.5706739", "0.56726784", "0.553096", "0.55005676", "0.5497972", "0.5497972", "0.549361", "0.54770607", "0.54724324", "0.54420024", "0.5416329", "0.5391592", "0.5374285", "0.53621286", "0.53522086", "0.53522086", "0.53429073", "0.5331178", "0.5318886", "0.5317904", "0.5298873", "0.5298873", "0.52705103", "0.5258685", "0.5250979", "0.52471435", "0.52364093", "0.5236275", "0.52345324", "0.5225959", "0.5218316", "0.5216227", "0.5157806", "0.5152341", "0.5152341", "0.5150452", "0.5150452", "0.51503426", "0.51494557", "0.51306504", "0.5128039", "0.5126174", "0.50949126", "0.509491", "0.50930554", "0.5052715", "0.5050473", "0.50477195", "0.50416565", "0.5037906", "0.5002614", "0.49738932", "0.49731517", "0.4955032", "0.49508", "0.49262756", "0.49210295", "0.4919881", "0.49096718", "0.4899165", "0.4894548", "0.48937613", "0.4888052", "0.48850352", "0.48821008", "0.48626906", "0.4856909", "0.48499942", "0.48374203", "0.48370025", "0.4835509", "0.48259342", "0.48246536", "0.48224792" ]
0.6601945
4
Get Tier1 segment port by ID Get detail information on a Tier1 segment port by giving ID.
def get_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port_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 PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port_0" end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port_0" end # verify the required parameter 'port_id' is set if @api_client.config.client_side_validation && port_id.nil? fail ArgumentError, "Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port_0" end # resource path 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) # 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 => 'SegmentPort') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#get_tier1_segment_port_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_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\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 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 get_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports\"\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.list_tier1_segment_ports\"\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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segment_port_mac_table_in_csv_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_in_csv_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_tier1_segment_port_mac_table_in_csv(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_in_csv_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports_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.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_segment_ports(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segment_port_mac_table(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\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 patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_port(id)\n if port_valid?(id)\n @port[id]\n else\n raise RuntimeError, \"port (#{id}) does not exist for #{self}\"\n end\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_segment_ports_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_tier1_segment_port_mac_table_in_csv_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_0\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table?format=csv'.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 query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPortMacAddressCsvListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table_in_csv_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segments_by_state(tier_1_id, opts = {})\n data, _status_code, _headers = get_tier1_segments_by_state_with_http_info(tier_1_id, opts)\n data\n end", "def get_tier1_segment_port_mac_table_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_downlink_port_arp_table_for_tier1_segment_in_csv(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_in_csv_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_downlink_port_arp_table_for_tier1_segment_in_csv_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_in_csv_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_tier1_segment_port_mac_table_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table, 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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segment_port_mac_table_in_csv_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table?format=csv'.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 query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPortMacAddressCsvListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table_in_csv\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segment_port_mac_table_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_0, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_downlink_port_arp_table_for_tier1_segment(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_downlink_port_statistics_for_tier1_segment(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_statistics_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_downlink_port_statistics_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment, 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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment, 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}/segments/{segment-id}/gateway-interface-statistics'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 => 'PolicyInterfaceStatistics')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi#get_downlink_port_statistics_for_tier1_segment\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def get_tier1_segments_by_state_0(tier_1_id, opts = {})\n data, _status_code, _headers = get_tier1_segments_by_state_0_with_http_info(tier_1_id, opts)\n data\n end", "def get_downlink_port_arp_table_for_tier1_segment_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_downlink_port_statistics_for_tier1_segment_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_statistics_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_contact_segments(id)\n return make_request(\"#{self.endpoint}/#{id}/segments\")\n end", "def get_infra_segment_port_0_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def get_downlink_port_statistics_summary_for_tier1_segment(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_statistics_summary_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_downlink_port_statistics_summary_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_summary_for_tier1_segment ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_summary_for_tier1_segment\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_summary_for_tier1_segment\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/gateway-interface-statistics/summary'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].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 => 'PolicyInterfaceStatisticsSummary')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi#get_downlink_port_statistics_summary_for_tier1_segment\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_downlink_port_statistics_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_for_tier1_segment_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}/segments/{segment-id}/gateway-interface-statistics'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 => 'PolicyInterfaceStatistics')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi#get_downlink_port_statistics_for_tier1_segment_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_segment_interface_arp_table_csv_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_segment_interface_arp_table_csv_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def set_dev_port\n @dev_port = DevPort.find(params[:id])\n end", "def get_downlink_port_statistics_summary_for_tier1_segment_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_statistics_summary_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def get_downlink_port_arp_table_for_tier1_segment_in_csv_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv, 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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/gateway-interface-arp-table?format=csv'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InterfaceArpTableInCsvFormat')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi#get_downlink_port_arp_table_for_tier1_segment_in_csv\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_downlink_port_arp_table_for_tier1_segment_in_csv_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_in_csv_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}/segments/{segment-id}/gateway-interface-arp-table?format=csv'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InterfaceArpTableInCsvFormat')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi#get_downlink_port_arp_table_for_tier1_segment_in_csv_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_downlink_port_statistics_summary_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_summary_for_tier1_segment_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_summary_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_downlink_port_statistics_summary_for_tier1_segment_0\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/gateway-interface-statistics/summary'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].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 => 'PolicyInterfaceStatisticsSummary')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi#get_downlink_port_statistics_summary_for_tier1_segment_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_downlink_port_arp_table_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment, 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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/gateway-interface-arp-table'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 => 'InterfaceArpTable')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi#get_downlink_port_arp_table_for_tier1_segment\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_port_detail_info(port)\n get_uri = \"#{@controller.get_node_operational_uri(self)}/node-connector/\"\\\n \"#{self.name}:#{port}\"\n response = @controller.rest_agent.get_request(get_uri)\n check_response_for_success(response) do |body|\n if body.has_key?('node-connector') &&\n body['node-connector'].is_a?(Array) && body['node-connector'][0]\n NetconfResponse.new(NetconfResponseStatus::OK, body['node-connector'][0])\n else\n NetconfResponse.new(NetconfResponseStatus::DATA_NOT_FOUND)\n end\n end\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 get_segment_interface_arp_table_csv(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_segment_interface_arp_table_csv_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_port(analyzer_id)\n @ports_analyzer.each_index { |index|\n if @ports_analyzer[index] == analyzer_id\n port_nbr=@start_port+index\n anl=Analyzer.find(analyzer_id)\n if !anl.nil?#Set port number in database when we assign it in array\n anl.update_attributes({:cmd_port=>port_nbr})\n return port_nbr\n end\n end\n }\n return nil\n end", "def get_first_port\n flist = Fiberstrand.where(\"connection_id = \" + self.id.to_s)\n \n fportid=0\n # binding.pry\n flist.each do |fiber|\n fport = Devport.find_by_id(fiber.porta)\n fportid=fport.id\n break if (fport.fiber_in_id==0)\n fportid=0\n end\n \n fportid\n \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 delete_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def delete_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def delete_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def set_simple_portin\n @simple_portin = SimplePortin.find(params[:id])\n end", "def create_or_replace_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def create_or_replace_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def get_downlink_port_arp_table_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_downlink_port_arp_table_for_tier1_segment_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}/segments/{segment-id}/gateway-interface-arp-table'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 => 'InterfaceArpTable')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi#get_downlink_port_arp_table_for_tier1_segment_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n @port_info = PortSummary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @port_info }\n end\n end", "def get_tier1_segments_by_state_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentStateApi.get_tier1_segments_by_state ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentStateApi.get_tier1_segments_by_state\"\n end\n if @api_client.config.client_side_validation && opts[:'configuration_state'] && !['pending', 'in_progress', 'success', 'failed', 'partial_success', 'orphaned', 'unknown'].include?(opts[:'configuration_state'])\n fail ArgumentError, 'invalid value for \"configuration_state\", must be one of pending, in_progress, success, failed, partial_success, orphaned, unknown'\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/state'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'configuration_state'] = opts[:'configuration_state'] if !opts[:'configuration_state'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].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 => 'SegmentConfigurationStateListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentStateApi#get_tier1_segments_by_state\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_servdetail\n @servdetail = Servdetail.find(params[:id])\n end", "def show\n # If cost()>10:\n @trip = Trip.find_by(uuid: params[:id])\n # else \n # @trip = Trip.find_by(uuid: params[:id1])\n\n end", "def get_trip_detail(id)\n server_response = handle_timeouts do\n get \"/1/trips/#{id}.json?locale=en\"\n end\n server_response['response']\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 get id\n @services[id]\n end", "def read_parameter_from_device(id)\n execute_command(\"F21 P#{id}\", false, false)\n end", "def get_tier1_segments_by_state_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentStateApi.get_tier1_segments_by_state_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentStateApi.get_tier1_segments_by_state_0\"\n end\n if @api_client.config.client_side_validation && opts[:'configuration_state'] && !['pending', 'in_progress', 'success', 'failed', 'partial_success', 'orphaned', 'unknown'].include?(opts[:'configuration_state'])\n fail ArgumentError, 'invalid value for \"configuration_state\", must be one of pending, in_progress, success, failed, partial_success, orphaned, unknown'\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/state'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'configuration_state'] = opts[:'configuration_state'] if !opts[:'configuration_state'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].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 => 'SegmentConfigurationStateListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentStateApi#get_tier1_segments_by_state_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_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def set_port_service\n @port_service = PortService.find(params[:id])\n end", "def get_segment_interface_arp_table_csv_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv_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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv_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}/segments/{segment-id}/arp-table?format=csv'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InterfaceArpTableInCsvFormat')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi#get_segment_interface_arp_table_csv_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def getDetails id\n\t\tticket = @tickets.read ['id', 'pid', 'title', 'description', 'tracker', 'creator', 'created', 'status'], ['id', id]\n\t\tticket = ticket[0]\n\tend", "def details\n response = cs_get \"/segments/#{segment_id}.json\", {}\n Hashie::Mash.new(response)\n end", "def get_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#get_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n @segment_detail = SegmentDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @segment_detail }\n end\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 get_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#get_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_porter\n @porter = Porter.find(params[:id])\n end", "def get_segment_interface_arp_table_csv_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv\"\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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv, 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 PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi.get_segment_interface_arp_table_csv, 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}/segments/{segment-id}/arp-table?format=csv'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InterfaceArpTableInCsvFormat')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesARPTableApi#get_segment_interface_arp_table_csv\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n @ptid = Ptid.find(params[:id])\n @title = Ptid.find(params[:id]).ptid + \" Details\"\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ptid }\n end\n end", "def read_parameter_from_device(id)\n @ramps_arduino.execute_command(\"F21 P#{id}\", false, false)\n end", "def service(id)\n request :get, \"/services/#{id}\"\n end", "def get_device_switch_port(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'serial' => options['serial'],\r\n 'number' => options['number']\r\n )\r\n # Prepare query url.\r\n _path_url = '/devices/{serial}/switchPorts/{number}'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'serial' => options['serial'],\r\n 'number' => options['number']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end", "def partitioned_path(id)\n (\"%06d\" % id).scan(/.../)\n end", "def get(id)\n client.read(dstu2_model, id)\n end", "def show\n @id = params[:id]\n if @id\n @plans = Plan.where(:servicio_id => @id)\n else\n @plans = Plan.all\n end\n\n end", "def details\n response = @create_send.get \"/segments/#{segment_id}.json\", {}\n Hashie::Mash.new(response)\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 get_port(port)\n send_request(FUNCTION_GET_PORT, [port], 'k', 1, 'C')\n end", "def set_switch_port\n @switch_port = SwitchPort.find(params[:id])\n end", "def get_tier1_forwarding_table_csv_0(tier_1_id, opts = {})\n data, _status_code, _headers = get_tier1_forwarding_table_csv_0_with_http_info(tier_1_id, opts)\n data\n end", "def show\n @segment_name = SegmentName.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @segment_name }\n end\n end", "def get_tier1_forwarding_table_csv(tier_1_id, opts = {})\n data, _status_code, _headers = get_tier1_forwarding_table_csv_with_http_info(tier_1_id, opts)\n data\n end", "def get_segment_interface_arp_table(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_segment_interface_arp_table_with_http_info(tier_1_id, segment_id, opts)\n data\n end" ]
[ "0.68674576", "0.68674576", "0.6672248", "0.6641533", "0.6601669", "0.6324243", "0.6301627", "0.625437", "0.62011814", "0.6068168", "0.60575575", "0.60373956", "0.5936771", "0.59356433", "0.59348065", "0.5934063", "0.58414364", "0.5835128", "0.583184", "0.57998693", "0.57905173", "0.57455826", "0.5738568", "0.57357126", "0.5720098", "0.5712905", "0.57071006", "0.56731504", "0.5532018", "0.55004805", "0.5497692", "0.5497692", "0.54916835", "0.5477132", "0.5473022", "0.54385316", "0.54153067", "0.53911203", "0.53752077", "0.53621584", "0.5351258", "0.5351258", "0.53427386", "0.53302634", "0.53191036", "0.5318441", "0.52989346", "0.52989346", "0.52703935", "0.5258506", "0.5250916", "0.5246713", "0.5236023", "0.5235866", "0.52352774", "0.5225093", "0.521893", "0.52157855", "0.51571786", "0.51520556", "0.51520556", "0.51506746", "0.51504195", "0.51504195", "0.5149861", "0.5131375", "0.51272076", "0.5126919", "0.50957364", "0.50947773", "0.50925946", "0.5051464", "0.50501204", "0.50467736", "0.5041471", "0.5037132", "0.50015056", "0.49740195", "0.49731207", "0.49541867", "0.49508578", "0.4923802", "0.49202728", "0.491958", "0.49085245", "0.48992655", "0.4893255", "0.48932105", "0.48868778", "0.48852924", "0.48818502", "0.48632172", "0.48562214", "0.48498335", "0.48383522", "0.48378807", "0.48351416", "0.48253155", "0.48241296", "0.4821649" ]
0.658089
5
List infra segment ports List all the ports for an infra.
def list_infra_segment_ports(segment_id, opts = {}) data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inports\n all_ports :in\n end", "def index\n @dev_ports = DevPort.all\n end", "def index\n @port_services = PortService.all\n end", "def index\n @ports = Port.all\n end", "def san_network_ports\n if san_nics.length == sans.length \n san_nics.map {|x| x.port_name }\n else\n []\n end\n end", "def list_infra_segment_ports_0(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_0_with_http_info(segment_id, opts)\n data\n end", "def ports\n enum_for(:each_port).to_a\n end", "def index\n @simple_portins = SimplePortin.all\n end", "def index\n @switch_ports = SwitchPort.all\n end", "def san_interfaces\n if san_nics.length == sans.length \n ports = san_network_ports().sort\n ips = san_nodes.map{|x| x.ip_address.to_s }.sort\n #return [] if ports.length != ips.length \n ports.zip(ips)\n else\n []\n end\n end", "def get_ports_list\n get_uri = @controller.get_node_operational_uri(self)\n response = @controller.rest_agent.get_request(get_uri)\n check_response_for_success(response) do |body|\n if body.has_key?('node') && body['node'].is_a?(Array) &&\n body['node'][0].has_key?('node-connector')\n ports = []\n body['node'][0]['node-connector'].each do |port|\n ports << port['flow-node-inventory:port-number']\n end\n NetconfResponse.new(NetconfResponseStatus::OK, ports)\n else\n NetconfResponse.new(NetconfResponseStatus::DATA_NOT_FOUND)\n end\n end\n end", "def input_port_list\n input_ports.values\n end", "def port_names\n (1..port_count).map {|i| \"Te 0/%s\" % i}\n end", "def san_nics\n x = nics.find_all_by_network_type('san', :order =>:port_name)\n x = [] if x.nil?\n x\n end", "def output_port_list\n output_ports.values\n end", "def ports\n return get_request(address(\"ports\"), @token)\n end", "def allports\n result = @ports.allports\n result[1]\n end", "def ports\n # prevent original array from being changed\n @ports.dup\n end", "def index\n @port_of_calls = PortOfCall.all\n end", "def outports\n all_ports :out\n end", "def san_paths\n san_array_node = self.sans.first.san_array_node\n return [] if san_array_node.nil?\n x = san_array_node.san_interfaces\n return [] if x.length < 1\n xx = x.enum_slice((x.length / 2)).to_a \n # permitation of san controllers\n san_port_array = xx.first.zip(xx.last).flatten(1)\n san_interfaces.map{|saniface| [saniface.first, \n san_port_array[saniface.last.split('.').last.to_i % san_port_array.length].last] }\n end", "def port_names\n raise NotImplementedError\n end", "def index\n @infractors = Infractor.all\n end", "def network_interfaces\n sans = san_network_ports\n n = clusters.map{|x| x.vlan}.sort\n if has_mgmt? then\n n << 4000\n end\n app = n.map{|x| \"vlan#{x}\"}\n app.concat(sans)\n end", "def port_names\n @ports.keys\n end", "def list_infra_segment_ports_with_http_info(segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports ...'\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.list_infra_segment_ports\"\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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports'.sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_infra_segment_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_infra_segment_ports_with_http_info(segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports ...'\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.list_infra_segment_ports\"\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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports'.sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_infra_segment_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def listIPs\n ips = []\n cloud_desc.network_interfaces.each { |iface|\n ips << iface.network_ip\n if iface.access_configs\n iface.access_configs.each { |acfg|\n ips << acfg.nat_ip if acfg.nat_ip\n }\n end\n }\n ips\n end", "def index\n @port_models = PortModel.all\n end", "def lan_nics\n x = nics.find_all_by_network_type('lan', :order =>:port_name)\n x = [] if x.nil?\n x\n end", "def list_infra_segment_ports_0_with_http_info(segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports_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.list_infra_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports'.sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_infra_segment_ports_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_interfaces\n @list = %x(/usr/sbin/networksetup -listallnetworkservices).split(\"\\n\").drop(1)\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 print_all(vm, ports)\n @env.ui.info(I18n.t(\"port_command.details\"))\n @env.ui.info(\"\")\n ports.each do |host, guest|\n @env.ui.info(\"#{guest.to_s.rjust(6)} (guest) => #{host} (host)\")\n @env.ui.machine(\"forwarded_port\", guest, host, target: vm.name.to_s)\n end\n return 0\n end", "def index\n @infraccions = Infraccion.all\n end", "def connected_ports; end", "def ports\n [@free_ports, @allocated_ports].flatten\n end", "def index\n @port_panels = PortPanel.all\n end", "def ports\n unless @ports\n @ports = []\n @host.xpath(\"ReportItem\").each do |port|\n @ports << port['port']\n end\n @ports.uniq!\n @ports.sort!\n end\n @ports\n end", "def get_network_ports(network_id)\n get(\"cloud-instances/#{guid}/networks/#{network_id}/ports\")[\"ports\"]\n end", "def servlist(mask = nil, type = nil)\n send_data(\"SERVLIST #{mask} #{type}\".strip)\n end", "def ports_details\n ports = @template['NetworkSettings']['Ports']\n\n [].tap do |pdetails|\n ports.each do |private_port, public_ports|\n pport, type = private_port.split('/')\n\n if public_ports.nil?\n pdetails << { 'PrivatePort' => pport, 'Type' => type }\n else\n public_ports.each do |host|\n pdetails << { 'IP' => host['HostIp'], 'PrivatePort' => pport,\n 'PublicPort' => host['HostPort'], 'Type' => type }\n end\n end\n end\n end\n end", "def index\n @ingressos = Ingresso.all\n end", "def index\n @ipc_all_acs = IpcAllAc.all\n end", "def ingress_interface\n list = config_get('itd_service', 'ingress_interface', @get_args)\n rlist = []\n list.each do |intf, next_hop|\n intf.gsub!('Eth', 'ethernet ')\n intf.gsub!('Po', 'port-channel ')\n intf.gsub!('Vlan', 'vlan ')\n next_hop = '' if next_hop.nil?\n rlist << [intf, next_hop]\n end\n rlist\n end", "def read_used_ports\n ports = []\n execute(\"list\", \"vms\").split(\"\\n\").each do |line|\n if line =~ /^\".+?\" \\{(.+?)\\}$/\n uuid = $1.to_s\n\n # Ignore our own used ports\n next if uuid == @uuid\n\n read_forwarded_ports(uuid, true).each do |_, _, hostport, _|\n ports << hostport\n end\n end\n end\n\n ports\n end", "def index\r\n @firewalls = Firewall.all\r\n end", "def index\n @microports = Microport.all\n end", "def list_ports_a\n loca = Cable.find_by_id(cable_id).location_a_id\n \n Devport.where(\"location_id = \" + loca.to_s + \" AND (fiber_out_id = 0 )\") # OR fiber_out_id = 0)\") -(25 June)\n end", "def output_port_names\n output_ports.keys\n end", "def list_port(port, index = [], types = nil)\n types = port.metadata[:type] if types.nil?\n\n content = \"<ol>\"\n i = 0\n types.each do |type|\n if type.is_a?(Array)\n content += \"<li><br />\" +\n list_port(port, index + [i], type) + \"</li>\"\n else\n content += \"<li>(#{type})<p>\" +\n TavernaPlayer.port_renderer.render(port, index + [i]) +\n \"</p></li>\"\n end\n i += 1\n end\n\n content += \"</ol>\"\nend", "def servlist(mask = nil, type = nil)\n raw \"SERVLIST #{mask} #{type}\".strip << \"\\r\\n\"\n end", "def index\n @cabinet_infrastructure_types = InfrastructureType.all\n end", "def list_all_infra_segments(opts = {})\n data, _status_code, _headers = list_all_infra_segments_with_http_info(opts)\n data\n end", "def index\n @ip_lists = IpList.all\n end", "def read_used_ports\n end", "def switch_ports\r\n SwitchPortsController.instance\r\n end", "def index\n @spis = Spi.all\n end", "def input_port_names\n input_ports.keys\n end", "def router_nat_list_all(timeout=10)\n\t\t\t\t\t\tnat_cmd = \"iptables -t nat -nvL\"\n\t\t\t\t\t\trouter_send_cmd(nat_cmd, timeout)\n\t\t\t\tend", "def ip_all\n Socket.getifaddrs.map do |iface|\n next unless iface.addr.ipv4?\n\n puts \"\\nName: : #{iface.name}\"\n puts \"Address: :' + #{iface.addr.ip_address}\"\n end\nend", "def mx_vlan_ports\r\n MXVLANPortsController.instance\r\n end", "def udp_service_discovery_ports=(ports)\n service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/UDPPortScan')\n service_ports.attributes['mode'] = 'custom'\n REXML::XPath.first(service_ports, './portList').text = ports.join(',')\n end", "def interfaces_list\n [\n {\n 'uri' => '/catalogues',\n 'method' => 'GET',\n 'purpose' => 'REST API Structure and Capability Discovery'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'GET',\n 'purpose' => 'List all NSs or specific NS',\n 'special' => 'Use version=last to retrieve NSs last version'\n },\n {\n 'uri' => '/catalogues/network-services/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific NS by its uuid'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'POST',\n 'purpose' => 'Store a new NS'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored NS specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/network-services/{id}',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored NS by its uuid',\n 'special' => 'Use status=[inactive, active, delete] to update NSD status'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific NS specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/network-services/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific NS by its uuid'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'GET',\n 'purpose' => 'List all VNFs or specific VNF',\n 'special' => 'Use version=last to retrieve VNFs last version'\n },\n {\n 'uri' => '/catalogues/vnfs/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific VNF by its uuid'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'POST',\n 'purpose' => 'Store a new VNF'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored VNF specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/vnfs/{id}',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored VNF by its uuid',\n 'special' => 'Use status=[inactive, active, delete] to update VNFD status'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific VNF specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/vnfs/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific VNF by its uuid'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'GET',\n 'purpose' => 'List all Packages or specific Package',\n 'special' => 'Use version=last to retrieve Packages last version'\n },\n {\n 'uri' => '/catalogues/packages/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific Package by its uuid'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'POST',\n 'purpose' => 'Store a new Package'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored Package specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/packages/{id}',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored Package by its uuid',\n 'special' => 'Use status=[inactive, active, delete] to update PD status'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific Package specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/packages/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific Package by its uuid'\n },\n {\n 'uri' => '/catalogues/packages/{id}/status',\n 'method' => 'PUT',\n 'purpose' => 'Updates the status of a Package {\"status\": \"active\" / \"inactive\"} as valid json payloads'\n },\n {\n 'uri' => '/catalogues/son-packages',\n 'method' => 'GET',\n 'purpose' => 'List all son-packages or specific son-package'\n },\n {\n 'uri' => '/catalogues/son-packages',\n 'method' => 'POST',\n 'purpose' => 'Store a new son-package'\n },\n {\n 'uri' => '/catalogues/son-packages/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific son-package by its uuid'\n },\n {\n 'uri' => '/catalogues/son-packages/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Remove a son-package'\n }\n ]\n end", "def read_forwarded_ports(uuid=nil, active_only=false)\n end", "def list_tier1_segment_ports(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def firewalls_list\n return [] unless configured?\n\n @service.fetch_all do |token|\n @service.list_firewalls(@gcp_config['project'], page_token: token)\n end.map(&:name)\n end", "def exposed_ports\n { 22 => {} }.merge(Hash.new @ports)\n end", "def index\n @idti_services = IdtiService.all\n end", "def public_endpoints\n\t\t\[email protected] {|e| e.public_port_name != nil}\n\t\tend", "def tcp_service_discovery_ports=(ports)\n service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/TCPPortScan')\n service_ports.attributes['mode'] = 'custom'\n service_ports.attributes['method'] = 'syn'\n REXML::XPath.first(service_ports, './portList').text = ports.join(',')\n end", "def network_interfaces\n netifcs = []\n procfs_file(\"net\", \"dev\") do |file|\n file.read.scan(NET_DATA) do |columns|\n type = case columns[0]\n when /^eth/ then NetworkInterface::ETHERNET_TYPE\n when /^lo/ then NetworkInterface::LOOPBACK_TYPE\n end\n\n netifcs << NetworkInterface.new(columns[0].to_sym, columns[1].to_i,\n columns[3].to_i, columns[4].to_i,\n columns[9].to_i, columns[11].to_i,\n type)\n end\n end\n netifcs\n end", "def list\n all.each { |device| puts(device.pretty_name) }\n end", "def index\n @infrastructures = Infrastructure.all\n end", "def list\n cf_get(path: \"#{uri_prefix}/virtual_dns\")\n end", "def index\n @network_dvrs = NetworkDvr.all\n end", "def current_open_ports\n tcp_ports = []\n udp_ports = []\n security_group.ip_permissions.each do |hsh|\n proto, from, to = hsh['ipProtocol'], hsh['fromPort'], hsh['toPort']\n case proto\n when 'tcp'\n tcp_ports.push Range.new(from, to).to_a\n when 'udp'\n udp_ports.push Range.new(from, to).to_a\n end\n end\n {tcp: tcp_ports.flatten, udp: udp_ports.flatten}\n end", "def forward_port_definitions\n # Get all the port mappings in the order they're defined and\n # organize them by their guestport, taking the \"last one wins\"\n # approach.\n guest_port_mapping = {}\n @env[:machine].config.vm.forwarded_ports.each do |options|\n guest_port_mapping[options[:guestport]] = options\n end\n\n # Return the values, since the order doesn't really matter\n guest_port_mapping.values\n end", "def each_port\r\n return debug('No WAN Service') unless @wan_service\r\n i = 0\r\n ok = true\r\n while ok\r\n hash = send_action(@wan_service, 'GetGenericPortMappingEntry', NewPortMappingIndex: i)\r\n if hash[:is_error]\r\n ok = false\r\n elsif xml = hash[:xml]\r\n yield(PortMapping.new(\r\n xml.get_text('NewExternalPort').to_s.to_i,\r\n xml.get_text('NewProtocol').to_s,\r\n xml.get_text('NewInternalPort').to_s.to_i,\r\n xml.get_text('NewInternalClient').to_s,\r\n xml.get_text('NewPortMappingDescription').to_s,\r\n xml.get_text('NewLeaseDuration').to_s.to_i,\r\n xml.get_text('NewEnabled').to_s == '1',\r\n xml.get_text('NewRemoteHost').to_s\r\n )\r\n )\r\n end\r\n i += 1\r\n end\r\n return i\r\n end", "def exclude_tcp_service_discovery_ports=(ports)\n service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/ExcludedTCPPortScan')\n REXML::XPath.first(service_ports, './portList').text = ports.join(',')\n end", "def read_forwarded_ports(uuid=nil, active_only=false)\n uuid ||= @uuid\n\n @logger.debug(\"read_forward_ports: uuid=#{uuid} active_only=#{active_only}\")\n\n results = []\n current_nic = nil\n execute(\"showvminfo\", uuid, \"--machinereadable\").split(\"\\n\").each do |line|\n # This is how we find the nic that a FP is attached to,\n # since this comes first.\n current_nic = $1.to_i if line =~ /^nic(\\d+)=\".+?\"$/\n\n # If we care about active VMs only, then we check the state\n # to verify the VM is running.\n if active_only && line =~ /^VMState=\"(.+?)\"$/ && $1.to_s != \"running\"\n return []\n end\n\n # Parse out the forwarded port information\n if line =~ /^Forwarding.+?=\"(.+?),.+?,.*?,(.+?),.*?,(.+?)\"$/\n result = [current_nic, $1.to_s, $2.to_i, $3.to_i]\n @logger.debug(\" - #{result.inspect}\")\n results << result\n end\n end\n\n results\n end", "def list\n @def_items = Def_Items\n @list_items = List_Items\n @menu_name = \"スクールバス:ダイヤグラム表\"\n @collection_options = {:collection_template => \"list\", :entity_template => \"list_entity\"}\n @collection = BusDiagram.find :all, \n :page => current_page,\n :scope => :self, \n :assert_time => @bus_departure_time,\n :select => select_items(@def_items, @list_items + [:id, :run_id]),\n :order => \"diagram_type, holiday, station, hour\"\n end", "def get_port_map\n response = @client.rest_get(@data['uri'] + '/port-map')\n response.body\n end", "def list_ip(containers) # rubocop:disable Metrics/AbcSize\n @options[:container] = containers\n container\n instance_data = list.body\n instance_data = JSON.parse(instance_data)\n vcableid = instance_data['vcable_id']\n abort('Error network configuration is not present') if vcableid.nil?\n internalip = instance_data['ip']\n iputil = IPUtil.new(id_domain, user, passwd, restendpoint)\n basecontainer = containers.split('/')\n usercontainer = '/' + basecontainer[1] + '/' + basecontainer[2] + '/' \n vcabledetails = JSON.parse(iputil.discover(usercontainer, 'vcable', vcableid, 'association').body)\n vcabledetails = vcabledetails['result']\n vcabledetails = vcabledetails.at(0)\n extipaddress = vcabledetails['ip']\n return internalip, extipaddress\n end", "def read_used_ports\n # Ignore our own used ports\n read_forwarded_ports(true).reject { |r| r[:guest].include?(@uuid) }\n end", "def base_ports(traversed)\n traversed.push self\n ports = []\n if (base = @resolved_base)\n base = base.idltype.resolved_type.node if base.is_a?(IDL::AST::Typedef)\n ports = base.ports(true, traversed) unless traversed.include?(base)\n end\n ports\n end", "def base_ports(traversed)\n traversed.push self\n ports = []\n if (base = @resolved_base)\n base = base.idltype.resolved_type.node if base.is_a?(IDL::AST::Typedef)\n ports = base.ports(true, traversed) unless traversed.include?(base)\n end\n ports\n end", "def get_ports_brief_info\n get_uri = @controller.get_node_operational_uri(self)\n response = @controller.rest_agent.get_request(get_uri)\n check_response_for_success(response) do |body|\n if body.has_key?('node') && body['node'].is_a?(Array) &&\n body['node'][0].has_key?('node-connector')\n ports_info = []\n body['node'][0]['node-connector'].each do |port|\n port_info = {'id' => port['id'],\n 'number' => port['flow-node-inventory:port-number'],\n 'name' => port['flow-node-inventory:name'],\n 'mac-address' => port['flow-node-inventory:hardware-address'],\n 'current-feature' => port['flow-node-inventory:current-feature'].upcase}\n ports_info << port_info\n end\n NetconfResponse.new(NetconfResponseStatus::OK, ports_info)\n else\n NetconfResponse.new(NetconfResponseStatus::DATA_NOT_FOUND)\n end\n end\n end", "def listIPs\n MU::Cloud::AWS::Server.getAddresses(cloud_desc).first\n end", "def index\n @ip_names = IpName.all\n end", "def stations_list\n @route.get_stations_list\n end", "def index\n @servidores = Servidor.all\n end", "def show\n @ip_list = IPAddress(@network.network)\n @network_ips = @network.addresses\n end", "def index\n @scanhosts = Scanhost.all\n end", "def list_tier1_segment_ports_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def list_resources\n resources = []\n addr = create_address(:sliceID => @@sliceID, :domain => @@domain)\n resource_prefix = \"#{addr.generate_address}/\"\n nodes = list_nodes(@@domain)\n nodes.each{|node|\n next if !node.include?(resource_prefix)\n node.slice!(resource_prefix)\n resources << node if !node.empty?\n }\n resources\n end", "def network_names(net)\n net[\"portgroup\"]\n end", "def index\n @segment_types = SegmentType.all\n end", "def list_ips options={}\n if ip_version==6\n # Only list ips that have a resolutions\n AddressResolution.for_subnet(self).map &:ip\n else\n if range?\n ips = []\n if options[:include_network]\n ips << cidr.nth(0).to_s\n end\n (cidr.len - 2).times do |i|\n ips << cidr.nth(i + 1).to_s\n end\n if options[:include_gateway]\n ips << cidr.nth(cidr.len - 1).to_s\n end\n ips\n #cidr.to_a#.enumerate[1..-2]\n else\n [ip]\n end\n end\n end" ]
[ "0.6304615", "0.61906093", "0.6108234", "0.60806197", "0.6078126", "0.60616904", "0.60574394", "0.5943002", "0.5907624", "0.5829457", "0.58202255", "0.580119", "0.57458794", "0.5739639", "0.573062", "0.56523323", "0.55792624", "0.55573446", "0.55300856", "0.5516732", "0.5431764", "0.5427202", "0.54094726", "0.53763574", "0.53661454", "0.53637207", "0.53637207", "0.5357856", "0.53551173", "0.53454113", "0.5329922", "0.53240854", "0.5293053", "0.5267995", "0.5267384", "0.5242268", "0.52021325", "0.5198577", "0.517753", "0.5099193", "0.5098609", "0.50980544", "0.50955164", "0.5093111", "0.5075412", "0.50718033", "0.5069849", "0.50531095", "0.50516665", "0.50511926", "0.5034765", "0.50188756", "0.5014369", "0.50091386", "0.49942636", "0.49890262", "0.49704438", "0.49688125", "0.49679074", "0.4965595", "0.49647573", "0.4958759", "0.49424627", "0.49361578", "0.49316278", "0.4929481", "0.49153116", "0.4906171", "0.49034443", "0.49028018", "0.48872176", "0.48815542", "0.48790985", "0.4877445", "0.48769733", "0.48648784", "0.48604605", "0.4854565", "0.48506734", "0.4848154", "0.48368347", "0.483037", "0.4818713", "0.4815192", "0.48135427", "0.4813011", "0.4813011", "0.48025018", "0.47836602", "0.47785413", "0.47769225", "0.4772255", "0.47643697", "0.47557533", "0.47520572", "0.47489855", "0.47436932", "0.47417292", "0.47405416" ]
0.6585313
1
List infra segment ports List all the ports for an infra.
def list_infra_segment_ports_with_http_info(segment_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports ...' end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports" 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, must be greater than or equal to 0.' end # resource path local_var_path = '/infra/segments/{segment-id}/ports'.sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_infra_segment_ports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_infra_segment_ports(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id, opts)\n data\n end", "def list_infra_segment_ports(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id, opts)\n data\n end", "def inports\n all_ports :in\n end", "def index\n @dev_ports = DevPort.all\n end", "def index\n @port_services = PortService.all\n end", "def index\n @ports = Port.all\n end", "def san_network_ports\n if san_nics.length == sans.length \n san_nics.map {|x| x.port_name }\n else\n []\n end\n end", "def list_infra_segment_ports_0(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_0_with_http_info(segment_id, opts)\n data\n end", "def ports\n enum_for(:each_port).to_a\n end", "def index\n @simple_portins = SimplePortin.all\n end", "def index\n @switch_ports = SwitchPort.all\n end", "def san_interfaces\n if san_nics.length == sans.length \n ports = san_network_ports().sort\n ips = san_nodes.map{|x| x.ip_address.to_s }.sort\n #return [] if ports.length != ips.length \n ports.zip(ips)\n else\n []\n end\n end", "def get_ports_list\n get_uri = @controller.get_node_operational_uri(self)\n response = @controller.rest_agent.get_request(get_uri)\n check_response_for_success(response) do |body|\n if body.has_key?('node') && body['node'].is_a?(Array) &&\n body['node'][0].has_key?('node-connector')\n ports = []\n body['node'][0]['node-connector'].each do |port|\n ports << port['flow-node-inventory:port-number']\n end\n NetconfResponse.new(NetconfResponseStatus::OK, ports)\n else\n NetconfResponse.new(NetconfResponseStatus::DATA_NOT_FOUND)\n end\n end\n end", "def input_port_list\n input_ports.values\n end", "def port_names\n (1..port_count).map {|i| \"Te 0/%s\" % i}\n end", "def san_nics\n x = nics.find_all_by_network_type('san', :order =>:port_name)\n x = [] if x.nil?\n x\n end", "def output_port_list\n output_ports.values\n end", "def ports\n return get_request(address(\"ports\"), @token)\n end", "def allports\n result = @ports.allports\n result[1]\n end", "def ports\n # prevent original array from being changed\n @ports.dup\n end", "def index\n @port_of_calls = PortOfCall.all\n end", "def outports\n all_ports :out\n end", "def san_paths\n san_array_node = self.sans.first.san_array_node\n return [] if san_array_node.nil?\n x = san_array_node.san_interfaces\n return [] if x.length < 1\n xx = x.enum_slice((x.length / 2)).to_a \n # permitation of san controllers\n san_port_array = xx.first.zip(xx.last).flatten(1)\n san_interfaces.map{|saniface| [saniface.first, \n san_port_array[saniface.last.split('.').last.to_i % san_port_array.length].last] }\n end", "def port_names\n raise NotImplementedError\n end", "def index\n @infractors = Infractor.all\n end", "def network_interfaces\n sans = san_network_ports\n n = clusters.map{|x| x.vlan}.sort\n if has_mgmt? then\n n << 4000\n end\n app = n.map{|x| \"vlan#{x}\"}\n app.concat(sans)\n end", "def port_names\n @ports.keys\n end", "def listIPs\n ips = []\n cloud_desc.network_interfaces.each { |iface|\n ips << iface.network_ip\n if iface.access_configs\n iface.access_configs.each { |acfg|\n ips << acfg.nat_ip if acfg.nat_ip\n }\n end\n }\n ips\n end", "def index\n @port_models = PortModel.all\n end", "def lan_nics\n x = nics.find_all_by_network_type('lan', :order =>:port_name)\n x = [] if x.nil?\n x\n end", "def list_infra_segment_ports_0_with_http_info(segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports_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.list_infra_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports'.sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_infra_segment_ports_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_interfaces\n @list = %x(/usr/sbin/networksetup -listallnetworkservices).split(\"\\n\").drop(1)\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 print_all(vm, ports)\n @env.ui.info(I18n.t(\"port_command.details\"))\n @env.ui.info(\"\")\n ports.each do |host, guest|\n @env.ui.info(\"#{guest.to_s.rjust(6)} (guest) => #{host} (host)\")\n @env.ui.machine(\"forwarded_port\", guest, host, target: vm.name.to_s)\n end\n return 0\n end", "def index\n @infraccions = Infraccion.all\n end", "def connected_ports; end", "def ports\n [@free_ports, @allocated_ports].flatten\n end", "def index\n @port_panels = PortPanel.all\n end", "def ports\n unless @ports\n @ports = []\n @host.xpath(\"ReportItem\").each do |port|\n @ports << port['port']\n end\n @ports.uniq!\n @ports.sort!\n end\n @ports\n end", "def get_network_ports(network_id)\n get(\"cloud-instances/#{guid}/networks/#{network_id}/ports\")[\"ports\"]\n end", "def servlist(mask = nil, type = nil)\n send_data(\"SERVLIST #{mask} #{type}\".strip)\n end", "def ports_details\n ports = @template['NetworkSettings']['Ports']\n\n [].tap do |pdetails|\n ports.each do |private_port, public_ports|\n pport, type = private_port.split('/')\n\n if public_ports.nil?\n pdetails << { 'PrivatePort' => pport, 'Type' => type }\n else\n public_ports.each do |host|\n pdetails << { 'IP' => host['HostIp'], 'PrivatePort' => pport,\n 'PublicPort' => host['HostPort'], 'Type' => type }\n end\n end\n end\n end\n end", "def index\n @ingressos = Ingresso.all\n end", "def index\n @ipc_all_acs = IpcAllAc.all\n end", "def ingress_interface\n list = config_get('itd_service', 'ingress_interface', @get_args)\n rlist = []\n list.each do |intf, next_hop|\n intf.gsub!('Eth', 'ethernet ')\n intf.gsub!('Po', 'port-channel ')\n intf.gsub!('Vlan', 'vlan ')\n next_hop = '' if next_hop.nil?\n rlist << [intf, next_hop]\n end\n rlist\n end", "def read_used_ports\n ports = []\n execute(\"list\", \"vms\").split(\"\\n\").each do |line|\n if line =~ /^\".+?\" \\{(.+?)\\}$/\n uuid = $1.to_s\n\n # Ignore our own used ports\n next if uuid == @uuid\n\n read_forwarded_ports(uuid, true).each do |_, _, hostport, _|\n ports << hostport\n end\n end\n end\n\n ports\n end", "def index\r\n @firewalls = Firewall.all\r\n end", "def index\n @microports = Microport.all\n end", "def list_ports_a\n loca = Cable.find_by_id(cable_id).location_a_id\n \n Devport.where(\"location_id = \" + loca.to_s + \" AND (fiber_out_id = 0 )\") # OR fiber_out_id = 0)\") -(25 June)\n end", "def output_port_names\n output_ports.keys\n end", "def list_port(port, index = [], types = nil)\n types = port.metadata[:type] if types.nil?\n\n content = \"<ol>\"\n i = 0\n types.each do |type|\n if type.is_a?(Array)\n content += \"<li><br />\" +\n list_port(port, index + [i], type) + \"</li>\"\n else\n content += \"<li>(#{type})<p>\" +\n TavernaPlayer.port_renderer.render(port, index + [i]) +\n \"</p></li>\"\n end\n i += 1\n end\n\n content += \"</ol>\"\nend", "def servlist(mask = nil, type = nil)\n raw \"SERVLIST #{mask} #{type}\".strip << \"\\r\\n\"\n end", "def index\n @cabinet_infrastructure_types = InfrastructureType.all\n end", "def list_all_infra_segments(opts = {})\n data, _status_code, _headers = list_all_infra_segments_with_http_info(opts)\n data\n end", "def index\n @ip_lists = IpList.all\n end", "def read_used_ports\n end", "def switch_ports\r\n SwitchPortsController.instance\r\n end", "def index\n @spis = Spi.all\n end", "def input_port_names\n input_ports.keys\n end", "def router_nat_list_all(timeout=10)\n\t\t\t\t\t\tnat_cmd = \"iptables -t nat -nvL\"\n\t\t\t\t\t\trouter_send_cmd(nat_cmd, timeout)\n\t\t\t\tend", "def ip_all\n Socket.getifaddrs.map do |iface|\n next unless iface.addr.ipv4?\n\n puts \"\\nName: : #{iface.name}\"\n puts \"Address: :' + #{iface.addr.ip_address}\"\n end\nend", "def mx_vlan_ports\r\n MXVLANPortsController.instance\r\n end", "def udp_service_discovery_ports=(ports)\n service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/UDPPortScan')\n service_ports.attributes['mode'] = 'custom'\n REXML::XPath.first(service_ports, './portList').text = ports.join(',')\n end", "def interfaces_list\n [\n {\n 'uri' => '/catalogues',\n 'method' => 'GET',\n 'purpose' => 'REST API Structure and Capability Discovery'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'GET',\n 'purpose' => 'List all NSs or specific NS',\n 'special' => 'Use version=last to retrieve NSs last version'\n },\n {\n 'uri' => '/catalogues/network-services/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific NS by its uuid'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'POST',\n 'purpose' => 'Store a new NS'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored NS specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/network-services/{id}',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored NS by its uuid',\n 'special' => 'Use status=[inactive, active, delete] to update NSD status'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific NS specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/network-services/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific NS by its uuid'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'GET',\n 'purpose' => 'List all VNFs or specific VNF',\n 'special' => 'Use version=last to retrieve VNFs last version'\n },\n {\n 'uri' => '/catalogues/vnfs/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific VNF by its uuid'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'POST',\n 'purpose' => 'Store a new VNF'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored VNF specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/vnfs/{id}',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored VNF by its uuid',\n 'special' => 'Use status=[inactive, active, delete] to update VNFD status'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific VNF specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/vnfs/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific VNF by its uuid'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'GET',\n 'purpose' => 'List all Packages or specific Package',\n 'special' => 'Use version=last to retrieve Packages last version'\n },\n {\n 'uri' => '/catalogues/packages/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific Package by its uuid'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'POST',\n 'purpose' => 'Store a new Package'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored Package specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/packages/{id}',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored Package by its uuid',\n 'special' => 'Use status=[inactive, active, delete] to update PD status'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific Package specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/packages/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific Package by its uuid'\n },\n {\n 'uri' => '/catalogues/packages/{id}/status',\n 'method' => 'PUT',\n 'purpose' => 'Updates the status of a Package {\"status\": \"active\" / \"inactive\"} as valid json payloads'\n },\n {\n 'uri' => '/catalogues/son-packages',\n 'method' => 'GET',\n 'purpose' => 'List all son-packages or specific son-package'\n },\n {\n 'uri' => '/catalogues/son-packages',\n 'method' => 'POST',\n 'purpose' => 'Store a new son-package'\n },\n {\n 'uri' => '/catalogues/son-packages/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific son-package by its uuid'\n },\n {\n 'uri' => '/catalogues/son-packages/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Remove a son-package'\n }\n ]\n end", "def read_forwarded_ports(uuid=nil, active_only=false)\n end", "def list_tier1_segment_ports(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def firewalls_list\n return [] unless configured?\n\n @service.fetch_all do |token|\n @service.list_firewalls(@gcp_config['project'], page_token: token)\n end.map(&:name)\n end", "def exposed_ports\n { 22 => {} }.merge(Hash.new @ports)\n end", "def index\n @idti_services = IdtiService.all\n end", "def public_endpoints\n\t\t\[email protected] {|e| e.public_port_name != nil}\n\t\tend", "def tcp_service_discovery_ports=(ports)\n service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/TCPPortScan')\n service_ports.attributes['mode'] = 'custom'\n service_ports.attributes['method'] = 'syn'\n REXML::XPath.first(service_ports, './portList').text = ports.join(',')\n end", "def network_interfaces\n netifcs = []\n procfs_file(\"net\", \"dev\") do |file|\n file.read.scan(NET_DATA) do |columns|\n type = case columns[0]\n when /^eth/ then NetworkInterface::ETHERNET_TYPE\n when /^lo/ then NetworkInterface::LOOPBACK_TYPE\n end\n\n netifcs << NetworkInterface.new(columns[0].to_sym, columns[1].to_i,\n columns[3].to_i, columns[4].to_i,\n columns[9].to_i, columns[11].to_i,\n type)\n end\n end\n netifcs\n end", "def list\n all.each { |device| puts(device.pretty_name) }\n end", "def index\n @infrastructures = Infrastructure.all\n end", "def list\n cf_get(path: \"#{uri_prefix}/virtual_dns\")\n end", "def index\n @network_dvrs = NetworkDvr.all\n end", "def current_open_ports\n tcp_ports = []\n udp_ports = []\n security_group.ip_permissions.each do |hsh|\n proto, from, to = hsh['ipProtocol'], hsh['fromPort'], hsh['toPort']\n case proto\n when 'tcp'\n tcp_ports.push Range.new(from, to).to_a\n when 'udp'\n udp_ports.push Range.new(from, to).to_a\n end\n end\n {tcp: tcp_ports.flatten, udp: udp_ports.flatten}\n end", "def forward_port_definitions\n # Get all the port mappings in the order they're defined and\n # organize them by their guestport, taking the \"last one wins\"\n # approach.\n guest_port_mapping = {}\n @env[:machine].config.vm.forwarded_ports.each do |options|\n guest_port_mapping[options[:guestport]] = options\n end\n\n # Return the values, since the order doesn't really matter\n guest_port_mapping.values\n end", "def each_port\r\n return debug('No WAN Service') unless @wan_service\r\n i = 0\r\n ok = true\r\n while ok\r\n hash = send_action(@wan_service, 'GetGenericPortMappingEntry', NewPortMappingIndex: i)\r\n if hash[:is_error]\r\n ok = false\r\n elsif xml = hash[:xml]\r\n yield(PortMapping.new(\r\n xml.get_text('NewExternalPort').to_s.to_i,\r\n xml.get_text('NewProtocol').to_s,\r\n xml.get_text('NewInternalPort').to_s.to_i,\r\n xml.get_text('NewInternalClient').to_s,\r\n xml.get_text('NewPortMappingDescription').to_s,\r\n xml.get_text('NewLeaseDuration').to_s.to_i,\r\n xml.get_text('NewEnabled').to_s == '1',\r\n xml.get_text('NewRemoteHost').to_s\r\n )\r\n )\r\n end\r\n i += 1\r\n end\r\n return i\r\n end", "def exclude_tcp_service_discovery_ports=(ports)\n service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/ExcludedTCPPortScan')\n REXML::XPath.first(service_ports, './portList').text = ports.join(',')\n end", "def read_forwarded_ports(uuid=nil, active_only=false)\n uuid ||= @uuid\n\n @logger.debug(\"read_forward_ports: uuid=#{uuid} active_only=#{active_only}\")\n\n results = []\n current_nic = nil\n execute(\"showvminfo\", uuid, \"--machinereadable\").split(\"\\n\").each do |line|\n # This is how we find the nic that a FP is attached to,\n # since this comes first.\n current_nic = $1.to_i if line =~ /^nic(\\d+)=\".+?\"$/\n\n # If we care about active VMs only, then we check the state\n # to verify the VM is running.\n if active_only && line =~ /^VMState=\"(.+?)\"$/ && $1.to_s != \"running\"\n return []\n end\n\n # Parse out the forwarded port information\n if line =~ /^Forwarding.+?=\"(.+?),.+?,.*?,(.+?),.*?,(.+?)\"$/\n result = [current_nic, $1.to_s, $2.to_i, $3.to_i]\n @logger.debug(\" - #{result.inspect}\")\n results << result\n end\n end\n\n results\n end", "def list\n @def_items = Def_Items\n @list_items = List_Items\n @menu_name = \"スクールバス:ダイヤグラム表\"\n @collection_options = {:collection_template => \"list\", :entity_template => \"list_entity\"}\n @collection = BusDiagram.find :all, \n :page => current_page,\n :scope => :self, \n :assert_time => @bus_departure_time,\n :select => select_items(@def_items, @list_items + [:id, :run_id]),\n :order => \"diagram_type, holiday, station, hour\"\n end", "def get_port_map\n response = @client.rest_get(@data['uri'] + '/port-map')\n response.body\n end", "def list_ip(containers) # rubocop:disable Metrics/AbcSize\n @options[:container] = containers\n container\n instance_data = list.body\n instance_data = JSON.parse(instance_data)\n vcableid = instance_data['vcable_id']\n abort('Error network configuration is not present') if vcableid.nil?\n internalip = instance_data['ip']\n iputil = IPUtil.new(id_domain, user, passwd, restendpoint)\n basecontainer = containers.split('/')\n usercontainer = '/' + basecontainer[1] + '/' + basecontainer[2] + '/' \n vcabledetails = JSON.parse(iputil.discover(usercontainer, 'vcable', vcableid, 'association').body)\n vcabledetails = vcabledetails['result']\n vcabledetails = vcabledetails.at(0)\n extipaddress = vcabledetails['ip']\n return internalip, extipaddress\n end", "def read_used_ports\n # Ignore our own used ports\n read_forwarded_ports(true).reject { |r| r[:guest].include?(@uuid) }\n end", "def base_ports(traversed)\n traversed.push self\n ports = []\n if (base = @resolved_base)\n base = base.idltype.resolved_type.node if base.is_a?(IDL::AST::Typedef)\n ports = base.ports(true, traversed) unless traversed.include?(base)\n end\n ports\n end", "def base_ports(traversed)\n traversed.push self\n ports = []\n if (base = @resolved_base)\n base = base.idltype.resolved_type.node if base.is_a?(IDL::AST::Typedef)\n ports = base.ports(true, traversed) unless traversed.include?(base)\n end\n ports\n end", "def get_ports_brief_info\n get_uri = @controller.get_node_operational_uri(self)\n response = @controller.rest_agent.get_request(get_uri)\n check_response_for_success(response) do |body|\n if body.has_key?('node') && body['node'].is_a?(Array) &&\n body['node'][0].has_key?('node-connector')\n ports_info = []\n body['node'][0]['node-connector'].each do |port|\n port_info = {'id' => port['id'],\n 'number' => port['flow-node-inventory:port-number'],\n 'name' => port['flow-node-inventory:name'],\n 'mac-address' => port['flow-node-inventory:hardware-address'],\n 'current-feature' => port['flow-node-inventory:current-feature'].upcase}\n ports_info << port_info\n end\n NetconfResponse.new(NetconfResponseStatus::OK, ports_info)\n else\n NetconfResponse.new(NetconfResponseStatus::DATA_NOT_FOUND)\n end\n end\n end", "def listIPs\n MU::Cloud::AWS::Server.getAddresses(cloud_desc).first\n end", "def index\n @ip_names = IpName.all\n end", "def stations_list\n @route.get_stations_list\n end", "def index\n @servidores = Servidor.all\n end", "def show\n @ip_list = IPAddress(@network.network)\n @network_ips = @network.addresses\n end", "def index\n @scanhosts = Scanhost.all\n end", "def list_tier1_segment_ports_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def list_resources\n resources = []\n addr = create_address(:sliceID => @@sliceID, :domain => @@domain)\n resource_prefix = \"#{addr.generate_address}/\"\n nodes = list_nodes(@@domain)\n nodes.each{|node|\n next if !node.include?(resource_prefix)\n node.slice!(resource_prefix)\n resources << node if !node.empty?\n }\n resources\n end", "def network_names(net)\n net[\"portgroup\"]\n end", "def index\n @segment_types = SegmentType.all\n end", "def list_ips options={}\n if ip_version==6\n # Only list ips that have a resolutions\n AddressResolution.for_subnet(self).map &:ip\n else\n if range?\n ips = []\n if options[:include_network]\n ips << cidr.nth(0).to_s\n end\n (cidr.len - 2).times do |i|\n ips << cidr.nth(i + 1).to_s\n end\n if options[:include_gateway]\n ips << cidr.nth(cidr.len - 1).to_s\n end\n ips\n #cidr.to_a#.enumerate[1..-2]\n else\n [ip]\n end\n end\n end" ]
[ "0.6585313", "0.6585313", "0.6304615", "0.61906093", "0.6108234", "0.60806197", "0.6078126", "0.60616904", "0.60574394", "0.5943002", "0.5907624", "0.5829457", "0.58202255", "0.580119", "0.57458794", "0.5739639", "0.573062", "0.56523323", "0.55792624", "0.55573446", "0.55300856", "0.5516732", "0.5431764", "0.5427202", "0.54094726", "0.53763574", "0.53661454", "0.5357856", "0.53551173", "0.53454113", "0.5329922", "0.53240854", "0.5293053", "0.5267995", "0.5267384", "0.5242268", "0.52021325", "0.5198577", "0.517753", "0.5099193", "0.5098609", "0.50980544", "0.50955164", "0.5093111", "0.5075412", "0.50718033", "0.5069849", "0.50531095", "0.50516665", "0.50511926", "0.5034765", "0.50188756", "0.5014369", "0.50091386", "0.49942636", "0.49890262", "0.49704438", "0.49688125", "0.49679074", "0.4965595", "0.49647573", "0.4958759", "0.49424627", "0.49361578", "0.49316278", "0.4929481", "0.49153116", "0.4906171", "0.49034443", "0.49028018", "0.48872176", "0.48815542", "0.48790985", "0.4877445", "0.48769733", "0.48648784", "0.48604605", "0.4854565", "0.48506734", "0.4848154", "0.48368347", "0.483037", "0.4818713", "0.4815192", "0.48135427", "0.4813011", "0.4813011", "0.48025018", "0.47836602", "0.47785413", "0.47769225", "0.4772255", "0.47643697", "0.47557533", "0.47520572", "0.47489855", "0.47436932", "0.47417292", "0.47405416" ]
0.53637207
28
List infra segment ports List all the ports for an infra.
def list_infra_segment_ports_0(segment_id, opts = {}) data, _status_code, _headers = list_infra_segment_ports_0_with_http_info(segment_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_infra_segment_ports(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id, opts)\n data\n end", "def list_infra_segment_ports(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id, opts)\n data\n end", "def inports\n all_ports :in\n end", "def index\n @dev_ports = DevPort.all\n end", "def index\n @port_services = PortService.all\n end", "def index\n @ports = Port.all\n end", "def san_network_ports\n if san_nics.length == sans.length \n san_nics.map {|x| x.port_name }\n else\n []\n end\n end", "def ports\n enum_for(:each_port).to_a\n end", "def index\n @simple_portins = SimplePortin.all\n end", "def index\n @switch_ports = SwitchPort.all\n end", "def san_interfaces\n if san_nics.length == sans.length \n ports = san_network_ports().sort\n ips = san_nodes.map{|x| x.ip_address.to_s }.sort\n #return [] if ports.length != ips.length \n ports.zip(ips)\n else\n []\n end\n end", "def get_ports_list\n get_uri = @controller.get_node_operational_uri(self)\n response = @controller.rest_agent.get_request(get_uri)\n check_response_for_success(response) do |body|\n if body.has_key?('node') && body['node'].is_a?(Array) &&\n body['node'][0].has_key?('node-connector')\n ports = []\n body['node'][0]['node-connector'].each do |port|\n ports << port['flow-node-inventory:port-number']\n end\n NetconfResponse.new(NetconfResponseStatus::OK, ports)\n else\n NetconfResponse.new(NetconfResponseStatus::DATA_NOT_FOUND)\n end\n end\n end", "def input_port_list\n input_ports.values\n end", "def port_names\n (1..port_count).map {|i| \"Te 0/%s\" % i}\n end", "def san_nics\n x = nics.find_all_by_network_type('san', :order =>:port_name)\n x = [] if x.nil?\n x\n end", "def output_port_list\n output_ports.values\n end", "def ports\n return get_request(address(\"ports\"), @token)\n end", "def allports\n result = @ports.allports\n result[1]\n end", "def ports\n # prevent original array from being changed\n @ports.dup\n end", "def index\n @port_of_calls = PortOfCall.all\n end", "def outports\n all_ports :out\n end", "def san_paths\n san_array_node = self.sans.first.san_array_node\n return [] if san_array_node.nil?\n x = san_array_node.san_interfaces\n return [] if x.length < 1\n xx = x.enum_slice((x.length / 2)).to_a \n # permitation of san controllers\n san_port_array = xx.first.zip(xx.last).flatten(1)\n san_interfaces.map{|saniface| [saniface.first, \n san_port_array[saniface.last.split('.').last.to_i % san_port_array.length].last] }\n end", "def port_names\n raise NotImplementedError\n end", "def index\n @infractors = Infractor.all\n end", "def network_interfaces\n sans = san_network_ports\n n = clusters.map{|x| x.vlan}.sort\n if has_mgmt? then\n n << 4000\n end\n app = n.map{|x| \"vlan#{x}\"}\n app.concat(sans)\n end", "def port_names\n @ports.keys\n end", "def list_infra_segment_ports_with_http_info(segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports ...'\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.list_infra_segment_ports\"\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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports'.sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_infra_segment_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_infra_segment_ports_with_http_info(segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports ...'\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.list_infra_segment_ports\"\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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports'.sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_infra_segment_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def listIPs\n ips = []\n cloud_desc.network_interfaces.each { |iface|\n ips << iface.network_ip\n if iface.access_configs\n iface.access_configs.each { |acfg|\n ips << acfg.nat_ip if acfg.nat_ip\n }\n end\n }\n ips\n end", "def index\n @port_models = PortModel.all\n end", "def lan_nics\n x = nics.find_all_by_network_type('lan', :order =>:port_name)\n x = [] if x.nil?\n x\n end", "def list_infra_segment_ports_0_with_http_info(segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports_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.list_infra_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports'.sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_infra_segment_ports_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_interfaces\n @list = %x(/usr/sbin/networksetup -listallnetworkservices).split(\"\\n\").drop(1)\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 print_all(vm, ports)\n @env.ui.info(I18n.t(\"port_command.details\"))\n @env.ui.info(\"\")\n ports.each do |host, guest|\n @env.ui.info(\"#{guest.to_s.rjust(6)} (guest) => #{host} (host)\")\n @env.ui.machine(\"forwarded_port\", guest, host, target: vm.name.to_s)\n end\n return 0\n end", "def index\n @infraccions = Infraccion.all\n end", "def connected_ports; end", "def ports\n [@free_ports, @allocated_ports].flatten\n end", "def index\n @port_panels = PortPanel.all\n end", "def ports\n unless @ports\n @ports = []\n @host.xpath(\"ReportItem\").each do |port|\n @ports << port['port']\n end\n @ports.uniq!\n @ports.sort!\n end\n @ports\n end", "def get_network_ports(network_id)\n get(\"cloud-instances/#{guid}/networks/#{network_id}/ports\")[\"ports\"]\n end", "def servlist(mask = nil, type = nil)\n send_data(\"SERVLIST #{mask} #{type}\".strip)\n end", "def ports_details\n ports = @template['NetworkSettings']['Ports']\n\n [].tap do |pdetails|\n ports.each do |private_port, public_ports|\n pport, type = private_port.split('/')\n\n if public_ports.nil?\n pdetails << { 'PrivatePort' => pport, 'Type' => type }\n else\n public_ports.each do |host|\n pdetails << { 'IP' => host['HostIp'], 'PrivatePort' => pport,\n 'PublicPort' => host['HostPort'], 'Type' => type }\n end\n end\n end\n end\n end", "def index\n @ingressos = Ingresso.all\n end", "def index\n @ipc_all_acs = IpcAllAc.all\n end", "def ingress_interface\n list = config_get('itd_service', 'ingress_interface', @get_args)\n rlist = []\n list.each do |intf, next_hop|\n intf.gsub!('Eth', 'ethernet ')\n intf.gsub!('Po', 'port-channel ')\n intf.gsub!('Vlan', 'vlan ')\n next_hop = '' if next_hop.nil?\n rlist << [intf, next_hop]\n end\n rlist\n end", "def read_used_ports\n ports = []\n execute(\"list\", \"vms\").split(\"\\n\").each do |line|\n if line =~ /^\".+?\" \\{(.+?)\\}$/\n uuid = $1.to_s\n\n # Ignore our own used ports\n next if uuid == @uuid\n\n read_forwarded_ports(uuid, true).each do |_, _, hostport, _|\n ports << hostport\n end\n end\n end\n\n ports\n end", "def index\r\n @firewalls = Firewall.all\r\n end", "def index\n @microports = Microport.all\n end", "def list_ports_a\n loca = Cable.find_by_id(cable_id).location_a_id\n \n Devport.where(\"location_id = \" + loca.to_s + \" AND (fiber_out_id = 0 )\") # OR fiber_out_id = 0)\") -(25 June)\n end", "def output_port_names\n output_ports.keys\n end", "def list_port(port, index = [], types = nil)\n types = port.metadata[:type] if types.nil?\n\n content = \"<ol>\"\n i = 0\n types.each do |type|\n if type.is_a?(Array)\n content += \"<li><br />\" +\n list_port(port, index + [i], type) + \"</li>\"\n else\n content += \"<li>(#{type})<p>\" +\n TavernaPlayer.port_renderer.render(port, index + [i]) +\n \"</p></li>\"\n end\n i += 1\n end\n\n content += \"</ol>\"\nend", "def servlist(mask = nil, type = nil)\n raw \"SERVLIST #{mask} #{type}\".strip << \"\\r\\n\"\n end", "def index\n @cabinet_infrastructure_types = InfrastructureType.all\n end", "def list_all_infra_segments(opts = {})\n data, _status_code, _headers = list_all_infra_segments_with_http_info(opts)\n data\n end", "def index\n @ip_lists = IpList.all\n end", "def read_used_ports\n end", "def switch_ports\r\n SwitchPortsController.instance\r\n end", "def index\n @spis = Spi.all\n end", "def input_port_names\n input_ports.keys\n end", "def router_nat_list_all(timeout=10)\n\t\t\t\t\t\tnat_cmd = \"iptables -t nat -nvL\"\n\t\t\t\t\t\trouter_send_cmd(nat_cmd, timeout)\n\t\t\t\tend", "def ip_all\n Socket.getifaddrs.map do |iface|\n next unless iface.addr.ipv4?\n\n puts \"\\nName: : #{iface.name}\"\n puts \"Address: :' + #{iface.addr.ip_address}\"\n end\nend", "def mx_vlan_ports\r\n MXVLANPortsController.instance\r\n end", "def udp_service_discovery_ports=(ports)\n service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/UDPPortScan')\n service_ports.attributes['mode'] = 'custom'\n REXML::XPath.first(service_ports, './portList').text = ports.join(',')\n end", "def interfaces_list\n [\n {\n 'uri' => '/catalogues',\n 'method' => 'GET',\n 'purpose' => 'REST API Structure and Capability Discovery'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'GET',\n 'purpose' => 'List all NSs or specific NS',\n 'special' => 'Use version=last to retrieve NSs last version'\n },\n {\n 'uri' => '/catalogues/network-services/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific NS by its uuid'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'POST',\n 'purpose' => 'Store a new NS'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored NS specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/network-services/{id}',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored NS by its uuid',\n 'special' => 'Use status=[inactive, active, delete] to update NSD status'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific NS specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/network-services/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific NS by its uuid'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'GET',\n 'purpose' => 'List all VNFs or specific VNF',\n 'special' => 'Use version=last to retrieve VNFs last version'\n },\n {\n 'uri' => '/catalogues/vnfs/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific VNF by its uuid'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'POST',\n 'purpose' => 'Store a new VNF'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored VNF specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/vnfs/{id}',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored VNF by its uuid',\n 'special' => 'Use status=[inactive, active, delete] to update VNFD status'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific VNF specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/vnfs/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific VNF by its uuid'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'GET',\n 'purpose' => 'List all Packages or specific Package',\n 'special' => 'Use version=last to retrieve Packages last version'\n },\n {\n 'uri' => '/catalogues/packages/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific Package by its uuid'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'POST',\n 'purpose' => 'Store a new Package'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored Package specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/packages/{id}',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored Package by its uuid',\n 'special' => 'Use status=[inactive, active, delete] to update PD status'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific Package specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/packages/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific Package by its uuid'\n },\n {\n 'uri' => '/catalogues/packages/{id}/status',\n 'method' => 'PUT',\n 'purpose' => 'Updates the status of a Package {\"status\": \"active\" / \"inactive\"} as valid json payloads'\n },\n {\n 'uri' => '/catalogues/son-packages',\n 'method' => 'GET',\n 'purpose' => 'List all son-packages or specific son-package'\n },\n {\n 'uri' => '/catalogues/son-packages',\n 'method' => 'POST',\n 'purpose' => 'Store a new son-package'\n },\n {\n 'uri' => '/catalogues/son-packages/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific son-package by its uuid'\n },\n {\n 'uri' => '/catalogues/son-packages/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Remove a son-package'\n }\n ]\n end", "def read_forwarded_ports(uuid=nil, active_only=false)\n end", "def list_tier1_segment_ports(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def firewalls_list\n return [] unless configured?\n\n @service.fetch_all do |token|\n @service.list_firewalls(@gcp_config['project'], page_token: token)\n end.map(&:name)\n end", "def exposed_ports\n { 22 => {} }.merge(Hash.new @ports)\n end", "def index\n @idti_services = IdtiService.all\n end", "def public_endpoints\n\t\t\[email protected] {|e| e.public_port_name != nil}\n\t\tend", "def tcp_service_discovery_ports=(ports)\n service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/TCPPortScan')\n service_ports.attributes['mode'] = 'custom'\n service_ports.attributes['method'] = 'syn'\n REXML::XPath.first(service_ports, './portList').text = ports.join(',')\n end", "def network_interfaces\n netifcs = []\n procfs_file(\"net\", \"dev\") do |file|\n file.read.scan(NET_DATA) do |columns|\n type = case columns[0]\n when /^eth/ then NetworkInterface::ETHERNET_TYPE\n when /^lo/ then NetworkInterface::LOOPBACK_TYPE\n end\n\n netifcs << NetworkInterface.new(columns[0].to_sym, columns[1].to_i,\n columns[3].to_i, columns[4].to_i,\n columns[9].to_i, columns[11].to_i,\n type)\n end\n end\n netifcs\n end", "def list\n all.each { |device| puts(device.pretty_name) }\n end", "def index\n @infrastructures = Infrastructure.all\n end", "def list\n cf_get(path: \"#{uri_prefix}/virtual_dns\")\n end", "def index\n @network_dvrs = NetworkDvr.all\n end", "def current_open_ports\n tcp_ports = []\n udp_ports = []\n security_group.ip_permissions.each do |hsh|\n proto, from, to = hsh['ipProtocol'], hsh['fromPort'], hsh['toPort']\n case proto\n when 'tcp'\n tcp_ports.push Range.new(from, to).to_a\n when 'udp'\n udp_ports.push Range.new(from, to).to_a\n end\n end\n {tcp: tcp_ports.flatten, udp: udp_ports.flatten}\n end", "def forward_port_definitions\n # Get all the port mappings in the order they're defined and\n # organize them by their guestport, taking the \"last one wins\"\n # approach.\n guest_port_mapping = {}\n @env[:machine].config.vm.forwarded_ports.each do |options|\n guest_port_mapping[options[:guestport]] = options\n end\n\n # Return the values, since the order doesn't really matter\n guest_port_mapping.values\n end", "def each_port\r\n return debug('No WAN Service') unless @wan_service\r\n i = 0\r\n ok = true\r\n while ok\r\n hash = send_action(@wan_service, 'GetGenericPortMappingEntry', NewPortMappingIndex: i)\r\n if hash[:is_error]\r\n ok = false\r\n elsif xml = hash[:xml]\r\n yield(PortMapping.new(\r\n xml.get_text('NewExternalPort').to_s.to_i,\r\n xml.get_text('NewProtocol').to_s,\r\n xml.get_text('NewInternalPort').to_s.to_i,\r\n xml.get_text('NewInternalClient').to_s,\r\n xml.get_text('NewPortMappingDescription').to_s,\r\n xml.get_text('NewLeaseDuration').to_s.to_i,\r\n xml.get_text('NewEnabled').to_s == '1',\r\n xml.get_text('NewRemoteHost').to_s\r\n )\r\n )\r\n end\r\n i += 1\r\n end\r\n return i\r\n end", "def exclude_tcp_service_discovery_ports=(ports)\n service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/ExcludedTCPPortScan')\n REXML::XPath.first(service_ports, './portList').text = ports.join(',')\n end", "def read_forwarded_ports(uuid=nil, active_only=false)\n uuid ||= @uuid\n\n @logger.debug(\"read_forward_ports: uuid=#{uuid} active_only=#{active_only}\")\n\n results = []\n current_nic = nil\n execute(\"showvminfo\", uuid, \"--machinereadable\").split(\"\\n\").each do |line|\n # This is how we find the nic that a FP is attached to,\n # since this comes first.\n current_nic = $1.to_i if line =~ /^nic(\\d+)=\".+?\"$/\n\n # If we care about active VMs only, then we check the state\n # to verify the VM is running.\n if active_only && line =~ /^VMState=\"(.+?)\"$/ && $1.to_s != \"running\"\n return []\n end\n\n # Parse out the forwarded port information\n if line =~ /^Forwarding.+?=\"(.+?),.+?,.*?,(.+?),.*?,(.+?)\"$/\n result = [current_nic, $1.to_s, $2.to_i, $3.to_i]\n @logger.debug(\" - #{result.inspect}\")\n results << result\n end\n end\n\n results\n end", "def list\n @def_items = Def_Items\n @list_items = List_Items\n @menu_name = \"スクールバス:ダイヤグラム表\"\n @collection_options = {:collection_template => \"list\", :entity_template => \"list_entity\"}\n @collection = BusDiagram.find :all, \n :page => current_page,\n :scope => :self, \n :assert_time => @bus_departure_time,\n :select => select_items(@def_items, @list_items + [:id, :run_id]),\n :order => \"diagram_type, holiday, station, hour\"\n end", "def get_port_map\n response = @client.rest_get(@data['uri'] + '/port-map')\n response.body\n end", "def list_ip(containers) # rubocop:disable Metrics/AbcSize\n @options[:container] = containers\n container\n instance_data = list.body\n instance_data = JSON.parse(instance_data)\n vcableid = instance_data['vcable_id']\n abort('Error network configuration is not present') if vcableid.nil?\n internalip = instance_data['ip']\n iputil = IPUtil.new(id_domain, user, passwd, restendpoint)\n basecontainer = containers.split('/')\n usercontainer = '/' + basecontainer[1] + '/' + basecontainer[2] + '/' \n vcabledetails = JSON.parse(iputil.discover(usercontainer, 'vcable', vcableid, 'association').body)\n vcabledetails = vcabledetails['result']\n vcabledetails = vcabledetails.at(0)\n extipaddress = vcabledetails['ip']\n return internalip, extipaddress\n end", "def read_used_ports\n # Ignore our own used ports\n read_forwarded_ports(true).reject { |r| r[:guest].include?(@uuid) }\n end", "def base_ports(traversed)\n traversed.push self\n ports = []\n if (base = @resolved_base)\n base = base.idltype.resolved_type.node if base.is_a?(IDL::AST::Typedef)\n ports = base.ports(true, traversed) unless traversed.include?(base)\n end\n ports\n end", "def base_ports(traversed)\n traversed.push self\n ports = []\n if (base = @resolved_base)\n base = base.idltype.resolved_type.node if base.is_a?(IDL::AST::Typedef)\n ports = base.ports(true, traversed) unless traversed.include?(base)\n end\n ports\n end", "def get_ports_brief_info\n get_uri = @controller.get_node_operational_uri(self)\n response = @controller.rest_agent.get_request(get_uri)\n check_response_for_success(response) do |body|\n if body.has_key?('node') && body['node'].is_a?(Array) &&\n body['node'][0].has_key?('node-connector')\n ports_info = []\n body['node'][0]['node-connector'].each do |port|\n port_info = {'id' => port['id'],\n 'number' => port['flow-node-inventory:port-number'],\n 'name' => port['flow-node-inventory:name'],\n 'mac-address' => port['flow-node-inventory:hardware-address'],\n 'current-feature' => port['flow-node-inventory:current-feature'].upcase}\n ports_info << port_info\n end\n NetconfResponse.new(NetconfResponseStatus::OK, ports_info)\n else\n NetconfResponse.new(NetconfResponseStatus::DATA_NOT_FOUND)\n end\n end\n end", "def listIPs\n MU::Cloud::AWS::Server.getAddresses(cloud_desc).first\n end", "def index\n @ip_names = IpName.all\n end", "def stations_list\n @route.get_stations_list\n end", "def index\n @servidores = Servidor.all\n end", "def show\n @ip_list = IPAddress(@network.network)\n @network_ips = @network.addresses\n end", "def index\n @scanhosts = Scanhost.all\n end", "def list_tier1_segment_ports_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def list_resources\n resources = []\n addr = create_address(:sliceID => @@sliceID, :domain => @@domain)\n resource_prefix = \"#{addr.generate_address}/\"\n nodes = list_nodes(@@domain)\n nodes.each{|node|\n next if !node.include?(resource_prefix)\n node.slice!(resource_prefix)\n resources << node if !node.empty?\n }\n resources\n end", "def network_names(net)\n net[\"portgroup\"]\n end", "def index\n @segment_types = SegmentType.all\n end", "def list_ips options={}\n if ip_version==6\n # Only list ips that have a resolutions\n AddressResolution.for_subnet(self).map &:ip\n else\n if range?\n ips = []\n if options[:include_network]\n ips << cidr.nth(0).to_s\n end\n (cidr.len - 2).times do |i|\n ips << cidr.nth(i + 1).to_s\n end\n if options[:include_gateway]\n ips << cidr.nth(cidr.len - 1).to_s\n end\n ips\n #cidr.to_a#.enumerate[1..-2]\n else\n [ip]\n end\n end\n end" ]
[ "0.6585313", "0.6585313", "0.6304615", "0.61906093", "0.6108234", "0.60806197", "0.6078126", "0.60574394", "0.5943002", "0.5907624", "0.5829457", "0.58202255", "0.580119", "0.57458794", "0.5739639", "0.573062", "0.56523323", "0.55792624", "0.55573446", "0.55300856", "0.5516732", "0.5431764", "0.5427202", "0.54094726", "0.53763574", "0.53661454", "0.53637207", "0.53637207", "0.5357856", "0.53551173", "0.53454113", "0.5329922", "0.53240854", "0.5293053", "0.5267995", "0.5267384", "0.5242268", "0.52021325", "0.5198577", "0.517753", "0.5099193", "0.5098609", "0.50980544", "0.50955164", "0.5093111", "0.5075412", "0.50718033", "0.5069849", "0.50531095", "0.50516665", "0.50511926", "0.5034765", "0.50188756", "0.5014369", "0.50091386", "0.49942636", "0.49890262", "0.49704438", "0.49688125", "0.49679074", "0.4965595", "0.49647573", "0.4958759", "0.49424627", "0.49361578", "0.49316278", "0.4929481", "0.49153116", "0.4906171", "0.49034443", "0.49028018", "0.48872176", "0.48815542", "0.48790985", "0.4877445", "0.48769733", "0.48648784", "0.48604605", "0.4854565", "0.48506734", "0.4848154", "0.48368347", "0.483037", "0.4818713", "0.4815192", "0.48135427", "0.4813011", "0.4813011", "0.48025018", "0.47836602", "0.47785413", "0.47769225", "0.4772255", "0.47643697", "0.47557533", "0.47520572", "0.47489855", "0.47436932", "0.47417292", "0.47405416" ]
0.60616904
7
List infra segment ports List all the ports for an infra.
def list_infra_segment_ports_0_with_http_info(segment_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports_0 ...' end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports_0, must be greater than or equal to 0.' end # resource path local_var_path = '/global-infra/segments/{segment-id}/ports'.sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_infra_segment_ports_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 list_infra_segment_ports(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id, opts)\n data\n end", "def list_infra_segment_ports(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id, opts)\n data\n end", "def inports\n all_ports :in\n end", "def index\n @dev_ports = DevPort.all\n end", "def index\n @port_services = PortService.all\n end", "def index\n @ports = Port.all\n end", "def san_network_ports\n if san_nics.length == sans.length \n san_nics.map {|x| x.port_name }\n else\n []\n end\n end", "def list_infra_segment_ports_0(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_0_with_http_info(segment_id, opts)\n data\n end", "def ports\n enum_for(:each_port).to_a\n end", "def index\n @simple_portins = SimplePortin.all\n end", "def index\n @switch_ports = SwitchPort.all\n end", "def san_interfaces\n if san_nics.length == sans.length \n ports = san_network_ports().sort\n ips = san_nodes.map{|x| x.ip_address.to_s }.sort\n #return [] if ports.length != ips.length \n ports.zip(ips)\n else\n []\n end\n end", "def get_ports_list\n get_uri = @controller.get_node_operational_uri(self)\n response = @controller.rest_agent.get_request(get_uri)\n check_response_for_success(response) do |body|\n if body.has_key?('node') && body['node'].is_a?(Array) &&\n body['node'][0].has_key?('node-connector')\n ports = []\n body['node'][0]['node-connector'].each do |port|\n ports << port['flow-node-inventory:port-number']\n end\n NetconfResponse.new(NetconfResponseStatus::OK, ports)\n else\n NetconfResponse.new(NetconfResponseStatus::DATA_NOT_FOUND)\n end\n end\n end", "def input_port_list\n input_ports.values\n end", "def port_names\n (1..port_count).map {|i| \"Te 0/%s\" % i}\n end", "def san_nics\n x = nics.find_all_by_network_type('san', :order =>:port_name)\n x = [] if x.nil?\n x\n end", "def output_port_list\n output_ports.values\n end", "def ports\n return get_request(address(\"ports\"), @token)\n end", "def allports\n result = @ports.allports\n result[1]\n end", "def ports\n # prevent original array from being changed\n @ports.dup\n end", "def index\n @port_of_calls = PortOfCall.all\n end", "def outports\n all_ports :out\n end", "def san_paths\n san_array_node = self.sans.first.san_array_node\n return [] if san_array_node.nil?\n x = san_array_node.san_interfaces\n return [] if x.length < 1\n xx = x.enum_slice((x.length / 2)).to_a \n # permitation of san controllers\n san_port_array = xx.first.zip(xx.last).flatten(1)\n san_interfaces.map{|saniface| [saniface.first, \n san_port_array[saniface.last.split('.').last.to_i % san_port_array.length].last] }\n end", "def port_names\n raise NotImplementedError\n end", "def index\n @infractors = Infractor.all\n end", "def network_interfaces\n sans = san_network_ports\n n = clusters.map{|x| x.vlan}.sort\n if has_mgmt? then\n n << 4000\n end\n app = n.map{|x| \"vlan#{x}\"}\n app.concat(sans)\n end", "def port_names\n @ports.keys\n end", "def list_infra_segment_ports_with_http_info(segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports ...'\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.list_infra_segment_ports\"\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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports'.sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_infra_segment_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_infra_segment_ports_with_http_info(segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports ...'\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.list_infra_segment_ports\"\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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports'.sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_infra_segment_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def listIPs\n ips = []\n cloud_desc.network_interfaces.each { |iface|\n ips << iface.network_ip\n if iface.access_configs\n iface.access_configs.each { |acfg|\n ips << acfg.nat_ip if acfg.nat_ip\n }\n end\n }\n ips\n end", "def index\n @port_models = PortModel.all\n end", "def lan_nics\n x = nics.find_all_by_network_type('lan', :order =>:port_name)\n x = [] if x.nil?\n x\n end", "def get_interfaces\n @list = %x(/usr/sbin/networksetup -listallnetworkservices).split(\"\\n\").drop(1)\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 print_all(vm, ports)\n @env.ui.info(I18n.t(\"port_command.details\"))\n @env.ui.info(\"\")\n ports.each do |host, guest|\n @env.ui.info(\"#{guest.to_s.rjust(6)} (guest) => #{host} (host)\")\n @env.ui.machine(\"forwarded_port\", guest, host, target: vm.name.to_s)\n end\n return 0\n end", "def index\n @infraccions = Infraccion.all\n end", "def connected_ports; end", "def ports\n [@free_ports, @allocated_ports].flatten\n end", "def index\n @port_panels = PortPanel.all\n end", "def ports\n unless @ports\n @ports = []\n @host.xpath(\"ReportItem\").each do |port|\n @ports << port['port']\n end\n @ports.uniq!\n @ports.sort!\n end\n @ports\n end", "def get_network_ports(network_id)\n get(\"cloud-instances/#{guid}/networks/#{network_id}/ports\")[\"ports\"]\n end", "def ports_details\n ports = @template['NetworkSettings']['Ports']\n\n [].tap do |pdetails|\n ports.each do |private_port, public_ports|\n pport, type = private_port.split('/')\n\n if public_ports.nil?\n pdetails << { 'PrivatePort' => pport, 'Type' => type }\n else\n public_ports.each do |host|\n pdetails << { 'IP' => host['HostIp'], 'PrivatePort' => pport,\n 'PublicPort' => host['HostPort'], 'Type' => type }\n end\n end\n end\n end\n end", "def servlist(mask = nil, type = nil)\n send_data(\"SERVLIST #{mask} #{type}\".strip)\n end", "def index\n @ingressos = Ingresso.all\n end", "def index\n @ipc_all_acs = IpcAllAc.all\n end", "def ingress_interface\n list = config_get('itd_service', 'ingress_interface', @get_args)\n rlist = []\n list.each do |intf, next_hop|\n intf.gsub!('Eth', 'ethernet ')\n intf.gsub!('Po', 'port-channel ')\n intf.gsub!('Vlan', 'vlan ')\n next_hop = '' if next_hop.nil?\n rlist << [intf, next_hop]\n end\n rlist\n end", "def read_used_ports\n ports = []\n execute(\"list\", \"vms\").split(\"\\n\").each do |line|\n if line =~ /^\".+?\" \\{(.+?)\\}$/\n uuid = $1.to_s\n\n # Ignore our own used ports\n next if uuid == @uuid\n\n read_forwarded_ports(uuid, true).each do |_, _, hostport, _|\n ports << hostport\n end\n end\n end\n\n ports\n end", "def index\r\n @firewalls = Firewall.all\r\n end", "def index\n @microports = Microport.all\n end", "def list_ports_a\n loca = Cable.find_by_id(cable_id).location_a_id\n \n Devport.where(\"location_id = \" + loca.to_s + \" AND (fiber_out_id = 0 )\") # OR fiber_out_id = 0)\") -(25 June)\n end", "def output_port_names\n output_ports.keys\n end", "def list_port(port, index = [], types = nil)\n types = port.metadata[:type] if types.nil?\n\n content = \"<ol>\"\n i = 0\n types.each do |type|\n if type.is_a?(Array)\n content += \"<li><br />\" +\n list_port(port, index + [i], type) + \"</li>\"\n else\n content += \"<li>(#{type})<p>\" +\n TavernaPlayer.port_renderer.render(port, index + [i]) +\n \"</p></li>\"\n end\n i += 1\n end\n\n content += \"</ol>\"\nend", "def servlist(mask = nil, type = nil)\n raw \"SERVLIST #{mask} #{type}\".strip << \"\\r\\n\"\n end", "def index\n @cabinet_infrastructure_types = InfrastructureType.all\n end", "def list_all_infra_segments(opts = {})\n data, _status_code, _headers = list_all_infra_segments_with_http_info(opts)\n data\n end", "def index\n @ip_lists = IpList.all\n end", "def read_used_ports\n end", "def switch_ports\r\n SwitchPortsController.instance\r\n end", "def input_port_names\n input_ports.keys\n end", "def index\n @spis = Spi.all\n end", "def router_nat_list_all(timeout=10)\n\t\t\t\t\t\tnat_cmd = \"iptables -t nat -nvL\"\n\t\t\t\t\t\trouter_send_cmd(nat_cmd, timeout)\n\t\t\t\tend", "def ip_all\n Socket.getifaddrs.map do |iface|\n next unless iface.addr.ipv4?\n\n puts \"\\nName: : #{iface.name}\"\n puts \"Address: :' + #{iface.addr.ip_address}\"\n end\nend", "def mx_vlan_ports\r\n MXVLANPortsController.instance\r\n end", "def udp_service_discovery_ports=(ports)\n service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/UDPPortScan')\n service_ports.attributes['mode'] = 'custom'\n REXML::XPath.first(service_ports, './portList').text = ports.join(',')\n end", "def interfaces_list\n [\n {\n 'uri' => '/catalogues',\n 'method' => 'GET',\n 'purpose' => 'REST API Structure and Capability Discovery'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'GET',\n 'purpose' => 'List all NSs or specific NS',\n 'special' => 'Use version=last to retrieve NSs last version'\n },\n {\n 'uri' => '/catalogues/network-services/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific NS by its uuid'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'POST',\n 'purpose' => 'Store a new NS'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored NS specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/network-services/{id}',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored NS by its uuid',\n 'special' => 'Use status=[inactive, active, delete] to update NSD status'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific NS specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/network-services/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific NS by its uuid'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'GET',\n 'purpose' => 'List all VNFs or specific VNF',\n 'special' => 'Use version=last to retrieve VNFs last version'\n },\n {\n 'uri' => '/catalogues/vnfs/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific VNF by its uuid'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'POST',\n 'purpose' => 'Store a new VNF'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored VNF specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/vnfs/{id}',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored VNF by its uuid',\n 'special' => 'Use status=[inactive, active, delete] to update VNFD status'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific VNF specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/vnfs/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific VNF by its uuid'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'GET',\n 'purpose' => 'List all Packages or specific Package',\n 'special' => 'Use version=last to retrieve Packages last version'\n },\n {\n 'uri' => '/catalogues/packages/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific Package by its uuid'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'POST',\n 'purpose' => 'Store a new Package'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored Package specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/packages/{id}',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored Package by its uuid',\n 'special' => 'Use status=[inactive, active, delete] to update PD status'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific Package specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/packages/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific Package by its uuid'\n },\n {\n 'uri' => '/catalogues/packages/{id}/status',\n 'method' => 'PUT',\n 'purpose' => 'Updates the status of a Package {\"status\": \"active\" / \"inactive\"} as valid json payloads'\n },\n {\n 'uri' => '/catalogues/son-packages',\n 'method' => 'GET',\n 'purpose' => 'List all son-packages or specific son-package'\n },\n {\n 'uri' => '/catalogues/son-packages',\n 'method' => 'POST',\n 'purpose' => 'Store a new son-package'\n },\n {\n 'uri' => '/catalogues/son-packages/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific son-package by its uuid'\n },\n {\n 'uri' => '/catalogues/son-packages/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Remove a son-package'\n }\n ]\n end", "def read_forwarded_ports(uuid=nil, active_only=false)\n end", "def list_tier1_segment_ports(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def firewalls_list\n return [] unless configured?\n\n @service.fetch_all do |token|\n @service.list_firewalls(@gcp_config['project'], page_token: token)\n end.map(&:name)\n end", "def exposed_ports\n { 22 => {} }.merge(Hash.new @ports)\n end", "def public_endpoints\n\t\t\[email protected] {|e| e.public_port_name != nil}\n\t\tend", "def index\n @idti_services = IdtiService.all\n end", "def tcp_service_discovery_ports=(ports)\n service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/TCPPortScan')\n service_ports.attributes['mode'] = 'custom'\n service_ports.attributes['method'] = 'syn'\n REXML::XPath.first(service_ports, './portList').text = ports.join(',')\n end", "def network_interfaces\n netifcs = []\n procfs_file(\"net\", \"dev\") do |file|\n file.read.scan(NET_DATA) do |columns|\n type = case columns[0]\n when /^eth/ then NetworkInterface::ETHERNET_TYPE\n when /^lo/ then NetworkInterface::LOOPBACK_TYPE\n end\n\n netifcs << NetworkInterface.new(columns[0].to_sym, columns[1].to_i,\n columns[3].to_i, columns[4].to_i,\n columns[9].to_i, columns[11].to_i,\n type)\n end\n end\n netifcs\n end", "def list\n all.each { |device| puts(device.pretty_name) }\n end", "def index\n @infrastructures = Infrastructure.all\n end", "def list\n cf_get(path: \"#{uri_prefix}/virtual_dns\")\n end", "def index\n @network_dvrs = NetworkDvr.all\n end", "def current_open_ports\n tcp_ports = []\n udp_ports = []\n security_group.ip_permissions.each do |hsh|\n proto, from, to = hsh['ipProtocol'], hsh['fromPort'], hsh['toPort']\n case proto\n when 'tcp'\n tcp_ports.push Range.new(from, to).to_a\n when 'udp'\n udp_ports.push Range.new(from, to).to_a\n end\n end\n {tcp: tcp_ports.flatten, udp: udp_ports.flatten}\n end", "def forward_port_definitions\n # Get all the port mappings in the order they're defined and\n # organize them by their guestport, taking the \"last one wins\"\n # approach.\n guest_port_mapping = {}\n @env[:machine].config.vm.forwarded_ports.each do |options|\n guest_port_mapping[options[:guestport]] = options\n end\n\n # Return the values, since the order doesn't really matter\n guest_port_mapping.values\n end", "def each_port\r\n return debug('No WAN Service') unless @wan_service\r\n i = 0\r\n ok = true\r\n while ok\r\n hash = send_action(@wan_service, 'GetGenericPortMappingEntry', NewPortMappingIndex: i)\r\n if hash[:is_error]\r\n ok = false\r\n elsif xml = hash[:xml]\r\n yield(PortMapping.new(\r\n xml.get_text('NewExternalPort').to_s.to_i,\r\n xml.get_text('NewProtocol').to_s,\r\n xml.get_text('NewInternalPort').to_s.to_i,\r\n xml.get_text('NewInternalClient').to_s,\r\n xml.get_text('NewPortMappingDescription').to_s,\r\n xml.get_text('NewLeaseDuration').to_s.to_i,\r\n xml.get_text('NewEnabled').to_s == '1',\r\n xml.get_text('NewRemoteHost').to_s\r\n )\r\n )\r\n end\r\n i += 1\r\n end\r\n return i\r\n end", "def exclude_tcp_service_discovery_ports=(ports)\n service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/ExcludedTCPPortScan')\n REXML::XPath.first(service_ports, './portList').text = ports.join(',')\n end", "def read_forwarded_ports(uuid=nil, active_only=false)\n uuid ||= @uuid\n\n @logger.debug(\"read_forward_ports: uuid=#{uuid} active_only=#{active_only}\")\n\n results = []\n current_nic = nil\n execute(\"showvminfo\", uuid, \"--machinereadable\").split(\"\\n\").each do |line|\n # This is how we find the nic that a FP is attached to,\n # since this comes first.\n current_nic = $1.to_i if line =~ /^nic(\\d+)=\".+?\"$/\n\n # If we care about active VMs only, then we check the state\n # to verify the VM is running.\n if active_only && line =~ /^VMState=\"(.+?)\"$/ && $1.to_s != \"running\"\n return []\n end\n\n # Parse out the forwarded port information\n if line =~ /^Forwarding.+?=\"(.+?),.+?,.*?,(.+?),.*?,(.+?)\"$/\n result = [current_nic, $1.to_s, $2.to_i, $3.to_i]\n @logger.debug(\" - #{result.inspect}\")\n results << result\n end\n end\n\n results\n end", "def list\n @def_items = Def_Items\n @list_items = List_Items\n @menu_name = \"スクールバス:ダイヤグラム表\"\n @collection_options = {:collection_template => \"list\", :entity_template => \"list_entity\"}\n @collection = BusDiagram.find :all, \n :page => current_page,\n :scope => :self, \n :assert_time => @bus_departure_time,\n :select => select_items(@def_items, @list_items + [:id, :run_id]),\n :order => \"diagram_type, holiday, station, hour\"\n end", "def get_port_map\n response = @client.rest_get(@data['uri'] + '/port-map')\n response.body\n end", "def list_ip(containers) # rubocop:disable Metrics/AbcSize\n @options[:container] = containers\n container\n instance_data = list.body\n instance_data = JSON.parse(instance_data)\n vcableid = instance_data['vcable_id']\n abort('Error network configuration is not present') if vcableid.nil?\n internalip = instance_data['ip']\n iputil = IPUtil.new(id_domain, user, passwd, restendpoint)\n basecontainer = containers.split('/')\n usercontainer = '/' + basecontainer[1] + '/' + basecontainer[2] + '/' \n vcabledetails = JSON.parse(iputil.discover(usercontainer, 'vcable', vcableid, 'association').body)\n vcabledetails = vcabledetails['result']\n vcabledetails = vcabledetails.at(0)\n extipaddress = vcabledetails['ip']\n return internalip, extipaddress\n end", "def base_ports(traversed)\n traversed.push self\n ports = []\n if (base = @resolved_base)\n base = base.idltype.resolved_type.node if base.is_a?(IDL::AST::Typedef)\n ports = base.ports(true, traversed) unless traversed.include?(base)\n end\n ports\n end", "def base_ports(traversed)\n traversed.push self\n ports = []\n if (base = @resolved_base)\n base = base.idltype.resolved_type.node if base.is_a?(IDL::AST::Typedef)\n ports = base.ports(true, traversed) unless traversed.include?(base)\n end\n ports\n end", "def read_used_ports\n # Ignore our own used ports\n read_forwarded_ports(true).reject { |r| r[:guest].include?(@uuid) }\n end", "def get_ports_brief_info\n get_uri = @controller.get_node_operational_uri(self)\n response = @controller.rest_agent.get_request(get_uri)\n check_response_for_success(response) do |body|\n if body.has_key?('node') && body['node'].is_a?(Array) &&\n body['node'][0].has_key?('node-connector')\n ports_info = []\n body['node'][0]['node-connector'].each do |port|\n port_info = {'id' => port['id'],\n 'number' => port['flow-node-inventory:port-number'],\n 'name' => port['flow-node-inventory:name'],\n 'mac-address' => port['flow-node-inventory:hardware-address'],\n 'current-feature' => port['flow-node-inventory:current-feature'].upcase}\n ports_info << port_info\n end\n NetconfResponse.new(NetconfResponseStatus::OK, ports_info)\n else\n NetconfResponse.new(NetconfResponseStatus::DATA_NOT_FOUND)\n end\n end\n end", "def listIPs\n MU::Cloud::AWS::Server.getAddresses(cloud_desc).first\n end", "def index\n @ip_names = IpName.all\n end", "def stations_list\n @route.get_stations_list\n end", "def index\n @servidores = Servidor.all\n end", "def show\n @ip_list = IPAddress(@network.network)\n @network_ips = @network.addresses\n end", "def index\n @scanhosts = Scanhost.all\n end", "def list_tier1_segment_ports_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def list_resources\n resources = []\n addr = create_address(:sliceID => @@sliceID, :domain => @@domain)\n resource_prefix = \"#{addr.generate_address}/\"\n nodes = list_nodes(@@domain)\n nodes.each{|node|\n next if !node.include?(resource_prefix)\n node.slice!(resource_prefix)\n resources << node if !node.empty?\n }\n resources\n end", "def network_names(net)\n net[\"portgroup\"]\n end", "def index\n @segment_types = SegmentType.all\n end", "def list_ips options={}\n if ip_version==6\n # Only list ips that have a resolutions\n AddressResolution.for_subnet(self).map &:ip\n else\n if range?\n ips = []\n if options[:include_network]\n ips << cidr.nth(0).to_s\n end\n (cidr.len - 2).times do |i|\n ips << cidr.nth(i + 1).to_s\n end\n if options[:include_gateway]\n ips << cidr.nth(cidr.len - 1).to_s\n end\n ips\n #cidr.to_a#.enumerate[1..-2]\n else\n [ip]\n end\n end\n end" ]
[ "0.6584873", "0.6584873", "0.63043344", "0.6189929", "0.6107027", "0.6079997", "0.6078611", "0.606136", "0.60575294", "0.59425247", "0.5907358", "0.583002", "0.58196825", "0.580064", "0.5745751", "0.5739763", "0.5730383", "0.5651597", "0.55790615", "0.5557052", "0.55295897", "0.55168474", "0.5431424", "0.5426658", "0.54085714", "0.5376959", "0.53653914", "0.5362417", "0.5362417", "0.5357532", "0.5354604", "0.5346208", "0.5323472", "0.5292288", "0.5267204", "0.52668387", "0.5242392", "0.5201581", "0.51982", "0.5177645", "0.50988597", "0.50984573", "0.5097501", "0.5095132", "0.5093128", "0.5074616", "0.5071178", "0.50695765", "0.5052521", "0.5052091", "0.5050876", "0.5034529", "0.50171787", "0.5013266", "0.5008552", "0.49934438", "0.49884534", "0.49701795", "0.4967231", "0.4967215", "0.49664286", "0.49644497", "0.49580476", "0.49417588", "0.49351975", "0.49315122", "0.49297982", "0.49149933", "0.49058172", "0.49020845", "0.49020344", "0.48862514", "0.48816478", "0.48786914", "0.48759142", "0.48754662", "0.48639062", "0.4859833", "0.48551232", "0.48504817", "0.484764", "0.4836932", "0.4830302", "0.48185638", "0.48145077", "0.48131928", "0.48131928", "0.4813095", "0.48021567", "0.4781827", "0.47771943", "0.47751552", "0.4770785", "0.4764002", "0.4754184", "0.47524324", "0.47475585", "0.47435045", "0.4740549", "0.47393972" ]
0.5328547
32
List Tier1 segment ports List all the ports for a Tier1 segment.
def list_tier1_segment_ports(tier_1_id, segment_id, opts = {}) data, _status_code, _headers = list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_tier1_segment_ports_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports\"\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.list_tier1_segment_ports\"\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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports_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.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports_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_mac_table_in_csv_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_in_csv_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def index\n @simple_portins = SimplePortin.all\n end", "def get_tier1_segment_port_mac_table_in_csv(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_in_csv_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def san_network_ports\n if san_nics.length == sans.length \n san_nics.map {|x| x.port_name }\n else\n []\n end\n end", "def index\n @ports = Port.all\n end", "def index\n @dev_ports = DevPort.all\n end", "def port_names\n (1..port_count).map {|i| \"Te 0/%s\" % i}\n end", "def allports\n result = @ports.allports\n result[1]\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def index\n @switch_ports = SwitchPort.all\n end", "def get_tier1_segment_port_mac_table(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def ports\n enum_for(:each_port).to_a\n end", "def index\n @port_services = PortService.all\n end", "def print_all(vm, ports)\n @env.ui.info(I18n.t(\"port_command.details\"))\n @env.ui.info(\"\")\n ports.each do |host, guest|\n @env.ui.info(\"#{guest.to_s.rjust(6)} (guest) => #{host} (host)\")\n @env.ui.machine(\"forwarded_port\", guest, host, target: vm.name.to_s)\n end\n return 0\n end", "def ports\n # prevent original array from being changed\n @ports.dup\n end", "def input_port_list\n input_ports.values\n end", "def switch_ports\r\n SwitchPortsController.instance\r\n end", "def ports\n return get_request(address(\"ports\"), @token)\n end", "def get_tier1_segment_port_mac_table_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_ports_list\n get_uri = @controller.get_node_operational_uri(self)\n response = @controller.rest_agent.get_request(get_uri)\n check_response_for_success(response) do |body|\n if body.has_key?('node') && body['node'].is_a?(Array) &&\n body['node'][0].has_key?('node-connector')\n ports = []\n body['node'][0]['node-connector'].each do |port|\n ports << port['flow-node-inventory:port-number']\n end\n NetconfResponse.new(NetconfResponseStatus::OK, ports)\n else\n NetconfResponse.new(NetconfResponseStatus::DATA_NOT_FOUND)\n end\n end\n end", "def ports\n unless @ports\n @ports = []\n @host.xpath(\"ReportItem\").each do |port|\n @ports << port['port']\n end\n @ports.uniq!\n @ports.sort!\n end\n @ports\n end", "def list_port(port, index = [], types = nil)\n types = port.metadata[:type] if types.nil?\n\n content = \"<ol>\"\n i = 0\n types.each do |type|\n if type.is_a?(Array)\n content += \"<li><br />\" +\n list_port(port, index + [i], type) + \"</li>\"\n else\n content += \"<li>(#{type})<p>\" +\n TavernaPlayer.port_renderer.render(port, index + [i]) +\n \"</p></li>\"\n end\n i += 1\n end\n\n content += \"</ol>\"\nend", "def index\n @port_of_calls = PortOfCall.all\n end", "def port_names\n @ports.keys\n end", "def tcp_service_discovery_ports=(ports)\n service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/TCPPortScan')\n service_ports.attributes['mode'] = 'custom'\n service_ports.attributes['method'] = 'syn'\n REXML::XPath.first(service_ports, './portList').text = ports.join(',')\n end", "def banners_on_ports(*params)\n slurp_stream(\"shodan/ports/#{params.join(\",\")}\") do |data|\n yield data\n end\n end", "def connected_ports; 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 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 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 ports_details\n ports = @template['NetworkSettings']['Ports']\n\n [].tap do |pdetails|\n ports.each do |private_port, public_ports|\n pport, type = private_port.split('/')\n\n if public_ports.nil?\n pdetails << { 'PrivatePort' => pport, 'Type' => type }\n else\n public_ports.each do |host|\n pdetails << { 'IP' => host['HostIp'], 'PrivatePort' => pport,\n 'PublicPort' => host['HostPort'], 'Type' => type }\n end\n end\n end\n end\n end", "def port_names\n raise NotImplementedError\n end", "def index\n @port_models = PortModel.all\n end", "def san_nics\n x = nics.find_all_by_network_type('san', :order =>:port_name)\n x = [] if x.nil?\n x\n end", "def mx_vlan_ports\r\n MXVLANPortsController.instance\r\n end", "def pids_on_ports(first=3000, count=4)\n last = first + count - 1\n `lsof -Fp -i tcp:#{first}-#{last}`.split(\"\\n\").map { |el| el[1,el.length].to_i }\nend", "def ports *ports\n @ports = *ports unless ports.length == 0\n @ports\n end", "def tcp_device_discovery_ports=(ports)\n tcp = REXML::XPath.first(@xml, 'ScanTemplate/DeviceDiscovery/CheckHosts/TCPHostCheck')\n REXML::XPath.first(tcp, './portList').text = ports.join(',')\n end", "def get_device_switch_ports(serial)\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'serial' => serial\r\n )\r\n # Prepare query url.\r\n _path_url = '/devices/{serial}/switchPorts'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'serial' => serial\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end", "def list_infra_segment_ports_0(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_0_with_http_info(segment_id, opts)\n data\n end", "def index\n if params[:switch_id] && @switch = Switch.find_by_id(params[:switch_id])\n @ports = @switch.ports.order(:id)\n elsif params[:slot_id] && @slot = Slot.find_by_id(params[:slot_id])\n @ports = @slot.ports.order(:id)\n else\n @ports = Port.order(:id)\n end\n end", "def inports\n all_ports :in\n end", "def output_port_list\n output_ports.values\n end", "def get_downlink_port_arp_table_for_tier1_segment_in_csv_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_in_csv_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def all_ports(type)\n SideJob.redis.smembers(\"#{redis_key}:#{type}ports\").reject {|name| name == '*'}.map {|name| SideJob::Port.new(self, type, name)}\n end", "def list_infra_segment_ports(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id, opts)\n data\n end", "def list_infra_segment_ports(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id, opts)\n data\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def get_downlink_port_statistics_for_tier1_segment_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_statistics_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def list_port_security_profile_bindings_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = list_port_security_profile_bindings_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def san_paths\n san_array_node = self.sans.first.san_array_node\n return [] if san_array_node.nil?\n x = san_array_node.san_interfaces\n return [] if x.length < 1\n xx = x.enum_slice((x.length / 2)).to_a \n # permitation of san controllers\n san_port_array = xx.first.zip(xx.last).flatten(1)\n san_interfaces.map{|saniface| [saniface.first, \n san_port_array[saniface.last.split('.').last.to_i % san_port_array.length].last] }\n end", "def ports\n [@free_ports, @allocated_ports].flatten\n end", "def get_downlink_port_arp_table_for_tier1_segment_in_csv(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_in_csv_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_downlink_port_statistics_for_tier1_segment(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_statistics_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def patch_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def input_port_names\n input_ports.keys\n end", "def device_ports(device_id)\n return get_request(address(\"ports?device_id=#{device_id}\"), @token)\n end", "def get_tier1_segment_port_mac_table_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_0, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table_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_mac_table_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table, 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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segments_by_state(tier_1_id, opts = {})\n data, _status_code, _headers = get_tier1_segments_by_state_with_http_info(tier_1_id, opts)\n data\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 list_port_qo_s_bindings_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = list_port_qo_s_bindings_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_network_ports(network_id)\n get(\"cloud-instances/#{guid}/networks/#{network_id}/ports\")[\"ports\"]\n end", "def switch_port_schedules\r\n SwitchPortSchedulesController.instance\r\n end", "def list_port_security_profile_bindings_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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_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}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].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 => 'PortSecurityProfileBindingMapListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#list_port_security_profile_bindings_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(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def create_or_replace_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def get_tier1_segment_port_mac_table_in_csv_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_0\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table?format=csv'.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 query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPortMacAddressCsvListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table_in_csv_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def base_ports(traversed)\n traversed.push self\n ports = []\n if (base = @resolved_base)\n base = base.idltype.resolved_type.node if base.is_a?(IDL::AST::Typedef)\n ports = base.ports(true, traversed) unless traversed.include?(base)\n end\n ports\n end", "def base_ports(traversed)\n traversed.push self\n ports = []\n if (base = @resolved_base)\n base = base.idltype.resolved_type.node if base.is_a?(IDL::AST::Typedef)\n ports = base.ports(true, traversed) unless traversed.include?(base)\n end\n ports\n end", "def list_port_security_profile_bindings_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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings, 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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].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 => 'PortSecurityProfileBindingMapListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#list_port_security_profile_bindings\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def display_port\n @port.each do |x|\n puts \"Company: #{x.name}\"\n puts \"Shares: #{x.shares}\"\n puts \"Price: #{x.price}#{x.currency}\"\n puts \"To USD: $#{sprintf('%.2f', x.con)}\"\n puts \"Total: #{x.total}#{x.currency}\"\n puts\n end\n end", "def index\n @port_panels = PortPanel.all\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_segment_dhcp_static_binding_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_segment_dhcp_static_binding_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def exclude_tcp_service_discovery_ports=(ports)\n service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/ExcludedTCPPortScan')\n REXML::XPath.first(service_ports, './portList').text = ports.join(',')\n end", "def get_downlink_port_arp_table_for_tier1_segment(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def list_port_security_profile_bindings(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = list_port_security_profile_bindings_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def delete_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def servlist(mask = nil, type = nil)\n send_data(\"SERVLIST #{mask} #{type}\".strip)\n end", "def list_tier1(opts = {})\n data, _status_code, _headers = list_tier1_with_http_info(opts)\n data\n end", "def create_or_replace_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def get_tier1_segments_by_state_0(tier_1_id, opts = {})\n data, _status_code, _headers = get_tier1_segments_by_state_0_with_http_info(tier_1_id, opts)\n data\n end", "def assignPorts (ixNet, realPort1, realPort2)\r\n chassis1 = realPort1[0]\r\n chassis2 = realPort2[0]\r\n card1 = realPort1[1]\r\n card2 = realPort2[1]\r\n port1 = realPort1[2]\r\n port2 = realPort2[2]\r\n\r\n root = @ixNet.getRoot()\r\n vport1 = @ixNet.add(root, 'vport')\r\n @ixNet.commit()\r\n vport1 = @ixNet.remapIds(vport1)[0]\r\n\r\n vport2 = @ixNet.add(root, 'vport')\r\n @ixNet.commit()\r\n vport2 = @ixNet.remapIds(vport2)[0]\r\n\r\n chassisObj1 = @ixNet.add(root + '/availableHardware', 'chassis')\r\n @ixNet.setAttribute(chassisObj1, '-hostname', chassis1)\r\n @ixNet.commit()\r\n chassisObj1 = @ixNet.remapIds(chassisObj1)[0]\r\n\r\n if (chassis1 != chassis2) then\r\n chassisObj2 = @ixNet.add(root + '/availableHardware', 'chassis')\r\n @ixNet.setAttribute(chassisObj2, '-hostname', chassis2)\r\n @ixNet.commit()\r\n chassisObj2 = @ixNet.remapIds(chassisObj2)[0]\r\n else\r\n chassisObj2 = chassisObj1\r\n end\r\n\r\n cardPortRef1 = chassisObj1 + '/card:'+card1+'/port:'+port1\r\n @ixNet.setMultiAttribute(vport1, '-connectedTo', cardPortRef1,\r\n '-rxMode', 'captureAndMeasure', '-name', 'Ethernet - 001')\r\n @ixNet.commit()\r\n\r\n cardPortRef2 = chassisObj2 + '/card:'+card2+'/port:'+port2\r\n @ixNet.setMultiAttribute(vport2, '-connectedTo', cardPortRef2,\r\n '-rxMode', 'captureAndMeasure', '-name', 'Ethernet - 002')\r\n @ixNet.commit()\r\nend", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_used_ports\n end", "def get_port_nodes\n props\n if @port_nodes.empty?\n # puts \"ports lazy\"\n pnodes = self.port_nodes() # TODO: not used, but should really compute everything instead of having to add ports manually!xb\n pnodes.each do |n|\n add_port n\n end\n end\n @port_nodes\n end", "def san_interfaces\n if san_nics.length == sans.length \n ports = san_network_ports().sort\n ips = san_nodes.map{|x| x.ip_address.to_s }.sort\n #return [] if ports.length != ips.length \n ports.zip(ips)\n else\n []\n end\n end", "def output_port_names\n output_ports.keys\n end", "def udp_service_discovery_ports=(ports)\n service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/UDPPortScan')\n service_ports.attributes['mode'] = 'custom'\n REXML::XPath.first(service_ports, './portList').text = ports.join(',')\n end", "def tagged_ports(switch)\n out = %x(snmpwalk -v 2c -c public #{switch} dot1qVlanStaticUntaggedPorts)\n lines = out.split(\"\\n\").select { |line| line.match(\"Hex-STRING\") }\n # Example line of data:\n # Q-BRIDGE-MIB::dot1qVlanStaticUntaggedPorts.1 = Hex-STRING: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF\n binlines = lines.map do |line|\n line.split(\":\")[3]\n end.map do |line|\n line.delete(' ')\n end.map do |line|\n line.hex.to_s(2).rjust(line.size*4, '0')\n end\n \n taggedports = []\n binlines.each do |line|\n binline = line.split(\"\")\n binline.each_index do |index|\n taggedports.push(index + 1) if binline[index] == \"0\"\n end\n end\n taggedports.sort.uniq\nend" ]
[ "0.6994915", "0.6221761", "0.6121615", "0.60014147", "0.59671587", "0.5894916", "0.57975626", "0.5783449", "0.5721173", "0.5714401", "0.57119435", "0.564467", "0.564467", "0.5567651", "0.5560343", "0.5478147", "0.54590434", "0.5425581", "0.54168046", "0.5408152", "0.5402787", "0.53939164", "0.5388436", "0.53786844", "0.53670853", "0.533646", "0.5305576", "0.52994823", "0.5297306", "0.5282745", "0.5232039", "0.5214511", "0.5202012", "0.5193155", "0.51879555", "0.5176897", "0.5176114", "0.51743746", "0.5168432", "0.51503724", "0.51319104", "0.5124494", "0.5122888", "0.51079285", "0.508682", "0.50827634", "0.50512516", "0.5026881", "0.5005287", "0.5004253", "0.5004225", "0.5004225", "0.5000963", "0.5000963", "0.49947888", "0.49768075", "0.49666357", "0.49654657", "0.4951001", "0.49384174", "0.49337703", "0.4932945", "0.49220756", "0.4909171", "0.4892066", "0.4887226", "0.48749626", "0.48691797", "0.4856396", "0.4851364", "0.48451564", "0.4842771", "0.4836886", "0.48244008", "0.48244008", "0.4823834", "0.48202422", "0.48202422", "0.4808279", "0.4801534", "0.47905788", "0.4779405", "0.477406", "0.47659189", "0.4765855", "0.47642258", "0.4758064", "0.47552246", "0.47549477", "0.4742786", "0.47317845", "0.4729647", "0.47278625", "0.47198346", "0.47187427", "0.47183654", "0.47131935", "0.4711669", "0.4706021", "0.47054872" ]
0.73961496
0
List Tier1 segment ports List all the ports for a Tier1 segment.
def list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports ...' 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports" end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports" 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, must be greater than or equal to 0.' end # resource path local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_tier1_segment_ports(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def list_tier1_segment_ports_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports_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.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports_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_mac_table_in_csv_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_in_csv_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def index\n @simple_portins = SimplePortin.all\n end", "def get_tier1_segment_port_mac_table_in_csv(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_in_csv_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def san_network_ports\n if san_nics.length == sans.length \n san_nics.map {|x| x.port_name }\n else\n []\n end\n end", "def index\n @ports = Port.all\n end", "def index\n @dev_ports = DevPort.all\n end", "def port_names\n (1..port_count).map {|i| \"Te 0/%s\" % i}\n end", "def allports\n result = @ports.allports\n result[1]\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def index\n @switch_ports = SwitchPort.all\n end", "def get_tier1_segment_port_mac_table(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def ports\n enum_for(:each_port).to_a\n end", "def index\n @port_services = PortService.all\n end", "def print_all(vm, ports)\n @env.ui.info(I18n.t(\"port_command.details\"))\n @env.ui.info(\"\")\n ports.each do |host, guest|\n @env.ui.info(\"#{guest.to_s.rjust(6)} (guest) => #{host} (host)\")\n @env.ui.machine(\"forwarded_port\", guest, host, target: vm.name.to_s)\n end\n return 0\n end", "def ports\n # prevent original array from being changed\n @ports.dup\n end", "def input_port_list\n input_ports.values\n end", "def switch_ports\r\n SwitchPortsController.instance\r\n end", "def ports\n return get_request(address(\"ports\"), @token)\n end", "def get_tier1_segment_port_mac_table_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_ports_list\n get_uri = @controller.get_node_operational_uri(self)\n response = @controller.rest_agent.get_request(get_uri)\n check_response_for_success(response) do |body|\n if body.has_key?('node') && body['node'].is_a?(Array) &&\n body['node'][0].has_key?('node-connector')\n ports = []\n body['node'][0]['node-connector'].each do |port|\n ports << port['flow-node-inventory:port-number']\n end\n NetconfResponse.new(NetconfResponseStatus::OK, ports)\n else\n NetconfResponse.new(NetconfResponseStatus::DATA_NOT_FOUND)\n end\n end\n end", "def ports\n unless @ports\n @ports = []\n @host.xpath(\"ReportItem\").each do |port|\n @ports << port['port']\n end\n @ports.uniq!\n @ports.sort!\n end\n @ports\n end", "def list_port(port, index = [], types = nil)\n types = port.metadata[:type] if types.nil?\n\n content = \"<ol>\"\n i = 0\n types.each do |type|\n if type.is_a?(Array)\n content += \"<li><br />\" +\n list_port(port, index + [i], type) + \"</li>\"\n else\n content += \"<li>(#{type})<p>\" +\n TavernaPlayer.port_renderer.render(port, index + [i]) +\n \"</p></li>\"\n end\n i += 1\n end\n\n content += \"</ol>\"\nend", "def index\n @port_of_calls = PortOfCall.all\n end", "def port_names\n @ports.keys\n end", "def tcp_service_discovery_ports=(ports)\n service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/TCPPortScan')\n service_ports.attributes['mode'] = 'custom'\n service_ports.attributes['method'] = 'syn'\n REXML::XPath.first(service_ports, './portList').text = ports.join(',')\n end", "def banners_on_ports(*params)\n slurp_stream(\"shodan/ports/#{params.join(\",\")}\") do |data|\n yield data\n end\n end", "def connected_ports; 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 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 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 ports_details\n ports = @template['NetworkSettings']['Ports']\n\n [].tap do |pdetails|\n ports.each do |private_port, public_ports|\n pport, type = private_port.split('/')\n\n if public_ports.nil?\n pdetails << { 'PrivatePort' => pport, 'Type' => type }\n else\n public_ports.each do |host|\n pdetails << { 'IP' => host['HostIp'], 'PrivatePort' => pport,\n 'PublicPort' => host['HostPort'], 'Type' => type }\n end\n end\n end\n end\n end", "def port_names\n raise NotImplementedError\n end", "def index\n @port_models = PortModel.all\n end", "def san_nics\n x = nics.find_all_by_network_type('san', :order =>:port_name)\n x = [] if x.nil?\n x\n end", "def mx_vlan_ports\r\n MXVLANPortsController.instance\r\n end", "def pids_on_ports(first=3000, count=4)\n last = first + count - 1\n `lsof -Fp -i tcp:#{first}-#{last}`.split(\"\\n\").map { |el| el[1,el.length].to_i }\nend", "def ports *ports\n @ports = *ports unless ports.length == 0\n @ports\n end", "def tcp_device_discovery_ports=(ports)\n tcp = REXML::XPath.first(@xml, 'ScanTemplate/DeviceDiscovery/CheckHosts/TCPHostCheck')\n REXML::XPath.first(tcp, './portList').text = ports.join(',')\n end", "def get_device_switch_ports(serial)\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'serial' => serial\r\n )\r\n # Prepare query url.\r\n _path_url = '/devices/{serial}/switchPorts'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'serial' => serial\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end", "def list_infra_segment_ports_0(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_0_with_http_info(segment_id, opts)\n data\n end", "def index\n if params[:switch_id] && @switch = Switch.find_by_id(params[:switch_id])\n @ports = @switch.ports.order(:id)\n elsif params[:slot_id] && @slot = Slot.find_by_id(params[:slot_id])\n @ports = @slot.ports.order(:id)\n else\n @ports = Port.order(:id)\n end\n end", "def inports\n all_ports :in\n end", "def output_port_list\n output_ports.values\n end", "def get_downlink_port_arp_table_for_tier1_segment_in_csv_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_in_csv_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def all_ports(type)\n SideJob.redis.smembers(\"#{redis_key}:#{type}ports\").reject {|name| name == '*'}.map {|name| SideJob::Port.new(self, type, name)}\n end", "def list_infra_segment_ports(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id, opts)\n data\n end", "def list_infra_segment_ports(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id, opts)\n data\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def get_downlink_port_statistics_for_tier1_segment_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_statistics_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def list_port_security_profile_bindings_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = list_port_security_profile_bindings_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def san_paths\n san_array_node = self.sans.first.san_array_node\n return [] if san_array_node.nil?\n x = san_array_node.san_interfaces\n return [] if x.length < 1\n xx = x.enum_slice((x.length / 2)).to_a \n # permitation of san controllers\n san_port_array = xx.first.zip(xx.last).flatten(1)\n san_interfaces.map{|saniface| [saniface.first, \n san_port_array[saniface.last.split('.').last.to_i % san_port_array.length].last] }\n end", "def ports\n [@free_ports, @allocated_ports].flatten\n end", "def get_downlink_port_arp_table_for_tier1_segment_in_csv(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_in_csv_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_downlink_port_statistics_for_tier1_segment(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_statistics_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def patch_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def input_port_names\n input_ports.keys\n end", "def device_ports(device_id)\n return get_request(address(\"ports?device_id=#{device_id}\"), @token)\n end", "def get_tier1_segment_port_mac_table_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_0, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table_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_mac_table_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table, 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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segments_by_state(tier_1_id, opts = {})\n data, _status_code, _headers = get_tier1_segments_by_state_with_http_info(tier_1_id, opts)\n data\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 list_port_qo_s_bindings_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = list_port_qo_s_bindings_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_network_ports(network_id)\n get(\"cloud-instances/#{guid}/networks/#{network_id}/ports\")[\"ports\"]\n end", "def switch_port_schedules\r\n SwitchPortSchedulesController.instance\r\n end", "def list_port_security_profile_bindings_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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_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}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].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 => 'PortSecurityProfileBindingMapListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#list_port_security_profile_bindings_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(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def create_or_replace_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def get_tier1_segment_port_mac_table_in_csv_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_0\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table?format=csv'.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 query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPortMacAddressCsvListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table_in_csv_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def base_ports(traversed)\n traversed.push self\n ports = []\n if (base = @resolved_base)\n base = base.idltype.resolved_type.node if base.is_a?(IDL::AST::Typedef)\n ports = base.ports(true, traversed) unless traversed.include?(base)\n end\n ports\n end", "def base_ports(traversed)\n traversed.push self\n ports = []\n if (base = @resolved_base)\n base = base.idltype.resolved_type.node if base.is_a?(IDL::AST::Typedef)\n ports = base.ports(true, traversed) unless traversed.include?(base)\n end\n ports\n end", "def list_port_security_profile_bindings_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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings, 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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].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 => 'PortSecurityProfileBindingMapListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#list_port_security_profile_bindings\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def display_port\n @port.each do |x|\n puts \"Company: #{x.name}\"\n puts \"Shares: #{x.shares}\"\n puts \"Price: #{x.price}#{x.currency}\"\n puts \"To USD: $#{sprintf('%.2f', x.con)}\"\n puts \"Total: #{x.total}#{x.currency}\"\n puts\n end\n end", "def index\n @port_panels = PortPanel.all\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_segment_dhcp_static_binding_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_segment_dhcp_static_binding_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def exclude_tcp_service_discovery_ports=(ports)\n service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/ExcludedTCPPortScan')\n REXML::XPath.first(service_ports, './portList').text = ports.join(',')\n end", "def get_downlink_port_arp_table_for_tier1_segment(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def list_port_security_profile_bindings(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = list_port_security_profile_bindings_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def delete_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def servlist(mask = nil, type = nil)\n send_data(\"SERVLIST #{mask} #{type}\".strip)\n end", "def list_tier1(opts = {})\n data, _status_code, _headers = list_tier1_with_http_info(opts)\n data\n end", "def create_or_replace_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def get_tier1_segments_by_state_0(tier_1_id, opts = {})\n data, _status_code, _headers = get_tier1_segments_by_state_0_with_http_info(tier_1_id, opts)\n data\n end", "def assignPorts (ixNet, realPort1, realPort2)\r\n chassis1 = realPort1[0]\r\n chassis2 = realPort2[0]\r\n card1 = realPort1[1]\r\n card2 = realPort2[1]\r\n port1 = realPort1[2]\r\n port2 = realPort2[2]\r\n\r\n root = @ixNet.getRoot()\r\n vport1 = @ixNet.add(root, 'vport')\r\n @ixNet.commit()\r\n vport1 = @ixNet.remapIds(vport1)[0]\r\n\r\n vport2 = @ixNet.add(root, 'vport')\r\n @ixNet.commit()\r\n vport2 = @ixNet.remapIds(vport2)[0]\r\n\r\n chassisObj1 = @ixNet.add(root + '/availableHardware', 'chassis')\r\n @ixNet.setAttribute(chassisObj1, '-hostname', chassis1)\r\n @ixNet.commit()\r\n chassisObj1 = @ixNet.remapIds(chassisObj1)[0]\r\n\r\n if (chassis1 != chassis2) then\r\n chassisObj2 = @ixNet.add(root + '/availableHardware', 'chassis')\r\n @ixNet.setAttribute(chassisObj2, '-hostname', chassis2)\r\n @ixNet.commit()\r\n chassisObj2 = @ixNet.remapIds(chassisObj2)[0]\r\n else\r\n chassisObj2 = chassisObj1\r\n end\r\n\r\n cardPortRef1 = chassisObj1 + '/card:'+card1+'/port:'+port1\r\n @ixNet.setMultiAttribute(vport1, '-connectedTo', cardPortRef1,\r\n '-rxMode', 'captureAndMeasure', '-name', 'Ethernet - 001')\r\n @ixNet.commit()\r\n\r\n cardPortRef2 = chassisObj2 + '/card:'+card2+'/port:'+port2\r\n @ixNet.setMultiAttribute(vport2, '-connectedTo', cardPortRef2,\r\n '-rxMode', 'captureAndMeasure', '-name', 'Ethernet - 002')\r\n @ixNet.commit()\r\nend", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_used_ports\n end", "def get_port_nodes\n props\n if @port_nodes.empty?\n # puts \"ports lazy\"\n pnodes = self.port_nodes() # TODO: not used, but should really compute everything instead of having to add ports manually!xb\n pnodes.each do |n|\n add_port n\n end\n end\n @port_nodes\n end", "def san_interfaces\n if san_nics.length == sans.length \n ports = san_network_ports().sort\n ips = san_nodes.map{|x| x.ip_address.to_s }.sort\n #return [] if ports.length != ips.length \n ports.zip(ips)\n else\n []\n end\n end", "def output_port_names\n output_ports.keys\n end", "def udp_service_discovery_ports=(ports)\n service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/UDPPortScan')\n service_ports.attributes['mode'] = 'custom'\n REXML::XPath.first(service_ports, './portList').text = ports.join(',')\n end", "def tagged_ports(switch)\n out = %x(snmpwalk -v 2c -c public #{switch} dot1qVlanStaticUntaggedPorts)\n lines = out.split(\"\\n\").select { |line| line.match(\"Hex-STRING\") }\n # Example line of data:\n # Q-BRIDGE-MIB::dot1qVlanStaticUntaggedPorts.1 = Hex-STRING: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF\n binlines = lines.map do |line|\n line.split(\":\")[3]\n end.map do |line|\n line.delete(' ')\n end.map do |line|\n line.hex.to_s(2).rjust(line.size*4, '0')\n end\n \n taggedports = []\n binlines.each do |line|\n binline = line.split(\"\")\n binline.each_index do |index|\n taggedports.push(index + 1) if binline[index] == \"0\"\n end\n end\n taggedports.sort.uniq\nend" ]
[ "0.73961496", "0.6994915", "0.6121615", "0.60014147", "0.59671587", "0.5894916", "0.57975626", "0.5783449", "0.5721173", "0.5714401", "0.57119435", "0.564467", "0.564467", "0.5567651", "0.5560343", "0.5478147", "0.54590434", "0.5425581", "0.54168046", "0.5408152", "0.5402787", "0.53939164", "0.5388436", "0.53786844", "0.53670853", "0.533646", "0.5305576", "0.52994823", "0.5297306", "0.5282745", "0.5232039", "0.5214511", "0.5202012", "0.5193155", "0.51879555", "0.5176897", "0.5176114", "0.51743746", "0.5168432", "0.51503724", "0.51319104", "0.5124494", "0.5122888", "0.51079285", "0.508682", "0.50827634", "0.50512516", "0.5026881", "0.5005287", "0.5004253", "0.5004225", "0.5004225", "0.5000963", "0.5000963", "0.49947888", "0.49768075", "0.49666357", "0.49654657", "0.4951001", "0.49384174", "0.49337703", "0.4932945", "0.49220756", "0.4909171", "0.4892066", "0.4887226", "0.48749626", "0.48691797", "0.4856396", "0.4851364", "0.48451564", "0.4842771", "0.4836886", "0.48244008", "0.48244008", "0.4823834", "0.48202422", "0.48202422", "0.4808279", "0.4801534", "0.47905788", "0.4779405", "0.477406", "0.47659189", "0.4765855", "0.47642258", "0.4758064", "0.47552246", "0.47549477", "0.4742786", "0.47317845", "0.4729647", "0.47278625", "0.47198346", "0.47187427", "0.47183654", "0.47131935", "0.4711669", "0.4706021", "0.47054872" ]
0.6221761
2
List Tier1 segment ports List all the ports for a Tier1 segment.
def list_tier1_segment_ports_0(tier_1_id, segment_id, opts = {}) data, _status_code, _headers = list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_tier1_segment_ports(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports\"\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.list_tier1_segment_ports\"\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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports_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.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports_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_mac_table_in_csv_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_in_csv_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def index\n @simple_portins = SimplePortin.all\n end", "def get_tier1_segment_port_mac_table_in_csv(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_in_csv_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def san_network_ports\n if san_nics.length == sans.length \n san_nics.map {|x| x.port_name }\n else\n []\n end\n end", "def index\n @ports = Port.all\n end", "def index\n @dev_ports = DevPort.all\n end", "def port_names\n (1..port_count).map {|i| \"Te 0/%s\" % i}\n end", "def allports\n result = @ports.allports\n result[1]\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def index\n @switch_ports = SwitchPort.all\n end", "def get_tier1_segment_port_mac_table(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def ports\n enum_for(:each_port).to_a\n end", "def index\n @port_services = PortService.all\n end", "def print_all(vm, ports)\n @env.ui.info(I18n.t(\"port_command.details\"))\n @env.ui.info(\"\")\n ports.each do |host, guest|\n @env.ui.info(\"#{guest.to_s.rjust(6)} (guest) => #{host} (host)\")\n @env.ui.machine(\"forwarded_port\", guest, host, target: vm.name.to_s)\n end\n return 0\n end", "def ports\n # prevent original array from being changed\n @ports.dup\n end", "def input_port_list\n input_ports.values\n end", "def switch_ports\r\n SwitchPortsController.instance\r\n end", "def ports\n return get_request(address(\"ports\"), @token)\n end", "def get_tier1_segment_port_mac_table_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_ports_list\n get_uri = @controller.get_node_operational_uri(self)\n response = @controller.rest_agent.get_request(get_uri)\n check_response_for_success(response) do |body|\n if body.has_key?('node') && body['node'].is_a?(Array) &&\n body['node'][0].has_key?('node-connector')\n ports = []\n body['node'][0]['node-connector'].each do |port|\n ports << port['flow-node-inventory:port-number']\n end\n NetconfResponse.new(NetconfResponseStatus::OK, ports)\n else\n NetconfResponse.new(NetconfResponseStatus::DATA_NOT_FOUND)\n end\n end\n end", "def ports\n unless @ports\n @ports = []\n @host.xpath(\"ReportItem\").each do |port|\n @ports << port['port']\n end\n @ports.uniq!\n @ports.sort!\n end\n @ports\n end", "def list_port(port, index = [], types = nil)\n types = port.metadata[:type] if types.nil?\n\n content = \"<ol>\"\n i = 0\n types.each do |type|\n if type.is_a?(Array)\n content += \"<li><br />\" +\n list_port(port, index + [i], type) + \"</li>\"\n else\n content += \"<li>(#{type})<p>\" +\n TavernaPlayer.port_renderer.render(port, index + [i]) +\n \"</p></li>\"\n end\n i += 1\n end\n\n content += \"</ol>\"\nend", "def index\n @port_of_calls = PortOfCall.all\n end", "def port_names\n @ports.keys\n end", "def tcp_service_discovery_ports=(ports)\n service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/TCPPortScan')\n service_ports.attributes['mode'] = 'custom'\n service_ports.attributes['method'] = 'syn'\n REXML::XPath.first(service_ports, './portList').text = ports.join(',')\n end", "def banners_on_ports(*params)\n slurp_stream(\"shodan/ports/#{params.join(\",\")}\") do |data|\n yield data\n end\n end", "def connected_ports; 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 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 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 ports_details\n ports = @template['NetworkSettings']['Ports']\n\n [].tap do |pdetails|\n ports.each do |private_port, public_ports|\n pport, type = private_port.split('/')\n\n if public_ports.nil?\n pdetails << { 'PrivatePort' => pport, 'Type' => type }\n else\n public_ports.each do |host|\n pdetails << { 'IP' => host['HostIp'], 'PrivatePort' => pport,\n 'PublicPort' => host['HostPort'], 'Type' => type }\n end\n end\n end\n end\n end", "def port_names\n raise NotImplementedError\n end", "def index\n @port_models = PortModel.all\n end", "def san_nics\n x = nics.find_all_by_network_type('san', :order =>:port_name)\n x = [] if x.nil?\n x\n end", "def mx_vlan_ports\r\n MXVLANPortsController.instance\r\n end", "def pids_on_ports(first=3000, count=4)\n last = first + count - 1\n `lsof -Fp -i tcp:#{first}-#{last}`.split(\"\\n\").map { |el| el[1,el.length].to_i }\nend", "def ports *ports\n @ports = *ports unless ports.length == 0\n @ports\n end", "def tcp_device_discovery_ports=(ports)\n tcp = REXML::XPath.first(@xml, 'ScanTemplate/DeviceDiscovery/CheckHosts/TCPHostCheck')\n REXML::XPath.first(tcp, './portList').text = ports.join(',')\n end", "def get_device_switch_ports(serial)\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'serial' => serial\r\n )\r\n # Prepare query url.\r\n _path_url = '/devices/{serial}/switchPorts'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'serial' => serial\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end", "def list_infra_segment_ports_0(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_0_with_http_info(segment_id, opts)\n data\n end", "def index\n if params[:switch_id] && @switch = Switch.find_by_id(params[:switch_id])\n @ports = @switch.ports.order(:id)\n elsif params[:slot_id] && @slot = Slot.find_by_id(params[:slot_id])\n @ports = @slot.ports.order(:id)\n else\n @ports = Port.order(:id)\n end\n end", "def inports\n all_ports :in\n end", "def output_port_list\n output_ports.values\n end", "def get_downlink_port_arp_table_for_tier1_segment_in_csv_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_in_csv_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def all_ports(type)\n SideJob.redis.smembers(\"#{redis_key}:#{type}ports\").reject {|name| name == '*'}.map {|name| SideJob::Port.new(self, type, name)}\n end", "def list_infra_segment_ports(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id, opts)\n data\n end", "def list_infra_segment_ports(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id, opts)\n data\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def get_downlink_port_statistics_for_tier1_segment_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_statistics_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def list_port_security_profile_bindings_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = list_port_security_profile_bindings_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def san_paths\n san_array_node = self.sans.first.san_array_node\n return [] if san_array_node.nil?\n x = san_array_node.san_interfaces\n return [] if x.length < 1\n xx = x.enum_slice((x.length / 2)).to_a \n # permitation of san controllers\n san_port_array = xx.first.zip(xx.last).flatten(1)\n san_interfaces.map{|saniface| [saniface.first, \n san_port_array[saniface.last.split('.').last.to_i % san_port_array.length].last] }\n end", "def ports\n [@free_ports, @allocated_ports].flatten\n end", "def get_downlink_port_arp_table_for_tier1_segment_in_csv(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_in_csv_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_downlink_port_statistics_for_tier1_segment(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_statistics_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def patch_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def input_port_names\n input_ports.keys\n end", "def device_ports(device_id)\n return get_request(address(\"ports?device_id=#{device_id}\"), @token)\n end", "def get_tier1_segment_port_mac_table_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_0, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table_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_mac_table_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table, 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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segments_by_state(tier_1_id, opts = {})\n data, _status_code, _headers = get_tier1_segments_by_state_with_http_info(tier_1_id, opts)\n data\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 list_port_qo_s_bindings_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = list_port_qo_s_bindings_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_network_ports(network_id)\n get(\"cloud-instances/#{guid}/networks/#{network_id}/ports\")[\"ports\"]\n end", "def switch_port_schedules\r\n SwitchPortSchedulesController.instance\r\n end", "def list_port_security_profile_bindings_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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_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}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].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 => 'PortSecurityProfileBindingMapListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#list_port_security_profile_bindings_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(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def create_or_replace_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def get_tier1_segment_port_mac_table_in_csv_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_0\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table?format=csv'.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 query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPortMacAddressCsvListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table_in_csv_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def base_ports(traversed)\n traversed.push self\n ports = []\n if (base = @resolved_base)\n base = base.idltype.resolved_type.node if base.is_a?(IDL::AST::Typedef)\n ports = base.ports(true, traversed) unless traversed.include?(base)\n end\n ports\n end", "def base_ports(traversed)\n traversed.push self\n ports = []\n if (base = @resolved_base)\n base = base.idltype.resolved_type.node if base.is_a?(IDL::AST::Typedef)\n ports = base.ports(true, traversed) unless traversed.include?(base)\n end\n ports\n end", "def list_port_security_profile_bindings_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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings, 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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].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 => 'PortSecurityProfileBindingMapListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#list_port_security_profile_bindings\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def display_port\n @port.each do |x|\n puts \"Company: #{x.name}\"\n puts \"Shares: #{x.shares}\"\n puts \"Price: #{x.price}#{x.currency}\"\n puts \"To USD: $#{sprintf('%.2f', x.con)}\"\n puts \"Total: #{x.total}#{x.currency}\"\n puts\n end\n end", "def index\n @port_panels = PortPanel.all\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_segment_dhcp_static_binding_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_segment_dhcp_static_binding_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def exclude_tcp_service_discovery_ports=(ports)\n service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/ExcludedTCPPortScan')\n REXML::XPath.first(service_ports, './portList').text = ports.join(',')\n end", "def get_downlink_port_arp_table_for_tier1_segment(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def list_port_security_profile_bindings(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = list_port_security_profile_bindings_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def delete_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def servlist(mask = nil, type = nil)\n send_data(\"SERVLIST #{mask} #{type}\".strip)\n end", "def list_tier1(opts = {})\n data, _status_code, _headers = list_tier1_with_http_info(opts)\n data\n end", "def create_or_replace_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def get_tier1_segments_by_state_0(tier_1_id, opts = {})\n data, _status_code, _headers = get_tier1_segments_by_state_0_with_http_info(tier_1_id, opts)\n data\n end", "def assignPorts (ixNet, realPort1, realPort2)\r\n chassis1 = realPort1[0]\r\n chassis2 = realPort2[0]\r\n card1 = realPort1[1]\r\n card2 = realPort2[1]\r\n port1 = realPort1[2]\r\n port2 = realPort2[2]\r\n\r\n root = @ixNet.getRoot()\r\n vport1 = @ixNet.add(root, 'vport')\r\n @ixNet.commit()\r\n vport1 = @ixNet.remapIds(vport1)[0]\r\n\r\n vport2 = @ixNet.add(root, 'vport')\r\n @ixNet.commit()\r\n vport2 = @ixNet.remapIds(vport2)[0]\r\n\r\n chassisObj1 = @ixNet.add(root + '/availableHardware', 'chassis')\r\n @ixNet.setAttribute(chassisObj1, '-hostname', chassis1)\r\n @ixNet.commit()\r\n chassisObj1 = @ixNet.remapIds(chassisObj1)[0]\r\n\r\n if (chassis1 != chassis2) then\r\n chassisObj2 = @ixNet.add(root + '/availableHardware', 'chassis')\r\n @ixNet.setAttribute(chassisObj2, '-hostname', chassis2)\r\n @ixNet.commit()\r\n chassisObj2 = @ixNet.remapIds(chassisObj2)[0]\r\n else\r\n chassisObj2 = chassisObj1\r\n end\r\n\r\n cardPortRef1 = chassisObj1 + '/card:'+card1+'/port:'+port1\r\n @ixNet.setMultiAttribute(vport1, '-connectedTo', cardPortRef1,\r\n '-rxMode', 'captureAndMeasure', '-name', 'Ethernet - 001')\r\n @ixNet.commit()\r\n\r\n cardPortRef2 = chassisObj2 + '/card:'+card2+'/port:'+port2\r\n @ixNet.setMultiAttribute(vport2, '-connectedTo', cardPortRef2,\r\n '-rxMode', 'captureAndMeasure', '-name', 'Ethernet - 002')\r\n @ixNet.commit()\r\nend", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_used_ports\n end", "def get_port_nodes\n props\n if @port_nodes.empty?\n # puts \"ports lazy\"\n pnodes = self.port_nodes() # TODO: not used, but should really compute everything instead of having to add ports manually!xb\n pnodes.each do |n|\n add_port n\n end\n end\n @port_nodes\n end", "def san_interfaces\n if san_nics.length == sans.length \n ports = san_network_ports().sort\n ips = san_nodes.map{|x| x.ip_address.to_s }.sort\n #return [] if ports.length != ips.length \n ports.zip(ips)\n else\n []\n end\n end", "def output_port_names\n output_ports.keys\n end", "def udp_service_discovery_ports=(ports)\n service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/UDPPortScan')\n service_ports.attributes['mode'] = 'custom'\n REXML::XPath.first(service_ports, './portList').text = ports.join(',')\n end", "def tagged_ports(switch)\n out = %x(snmpwalk -v 2c -c public #{switch} dot1qVlanStaticUntaggedPorts)\n lines = out.split(\"\\n\").select { |line| line.match(\"Hex-STRING\") }\n # Example line of data:\n # Q-BRIDGE-MIB::dot1qVlanStaticUntaggedPorts.1 = Hex-STRING: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF\n binlines = lines.map do |line|\n line.split(\":\")[3]\n end.map do |line|\n line.delete(' ')\n end.map do |line|\n line.hex.to_s(2).rjust(line.size*4, '0')\n end\n \n taggedports = []\n binlines.each do |line|\n binline = line.split(\"\")\n binline.each_index do |index|\n taggedports.push(index + 1) if binline[index] == \"0\"\n end\n end\n taggedports.sort.uniq\nend" ]
[ "0.73961496", "0.6221761", "0.6121615", "0.60014147", "0.59671587", "0.5894916", "0.57975626", "0.5783449", "0.5721173", "0.5714401", "0.57119435", "0.564467", "0.564467", "0.5567651", "0.5560343", "0.5478147", "0.54590434", "0.5425581", "0.54168046", "0.5408152", "0.5402787", "0.53939164", "0.5388436", "0.53786844", "0.53670853", "0.533646", "0.5305576", "0.52994823", "0.5297306", "0.5282745", "0.5232039", "0.5214511", "0.5202012", "0.5193155", "0.51879555", "0.5176897", "0.5176114", "0.51743746", "0.5168432", "0.51503724", "0.51319104", "0.5124494", "0.5122888", "0.51079285", "0.508682", "0.50827634", "0.50512516", "0.5026881", "0.5005287", "0.5004253", "0.5004225", "0.5004225", "0.5000963", "0.5000963", "0.49947888", "0.49768075", "0.49666357", "0.49654657", "0.4951001", "0.49384174", "0.49337703", "0.4932945", "0.49220756", "0.4909171", "0.4892066", "0.4887226", "0.48749626", "0.48691797", "0.4856396", "0.4851364", "0.48451564", "0.4842771", "0.4836886", "0.48244008", "0.48244008", "0.4823834", "0.48202422", "0.48202422", "0.4808279", "0.4801534", "0.47905788", "0.4779405", "0.477406", "0.47659189", "0.4765855", "0.47642258", "0.4758064", "0.47552246", "0.47549477", "0.4742786", "0.47317845", "0.4729647", "0.47278625", "0.47198346", "0.47187427", "0.47183654", "0.47131935", "0.4711669", "0.4706021", "0.47054872" ]
0.6994915
1
List Tier1 segment ports List all the ports for a Tier1 segment.
def list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_0" end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_0, must be greater than or equal to 0.' end # resource path local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports_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 list_tier1_segment_ports(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def list_tier1_segment_ports_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports\"\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.list_tier1_segment_ports\"\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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segment_port_mac_table_in_csv_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_in_csv_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def index\n @simple_portins = SimplePortin.all\n end", "def get_tier1_segment_port_mac_table_in_csv(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_in_csv_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def san_network_ports\n if san_nics.length == sans.length \n san_nics.map {|x| x.port_name }\n else\n []\n end\n end", "def index\n @ports = Port.all\n end", "def index\n @dev_ports = DevPort.all\n end", "def port_names\n (1..port_count).map {|i| \"Te 0/%s\" % i}\n end", "def allports\n result = @ports.allports\n result[1]\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def index\n @switch_ports = SwitchPort.all\n end", "def get_tier1_segment_port_mac_table(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def ports\n enum_for(:each_port).to_a\n end", "def index\n @port_services = PortService.all\n end", "def print_all(vm, ports)\n @env.ui.info(I18n.t(\"port_command.details\"))\n @env.ui.info(\"\")\n ports.each do |host, guest|\n @env.ui.info(\"#{guest.to_s.rjust(6)} (guest) => #{host} (host)\")\n @env.ui.machine(\"forwarded_port\", guest, host, target: vm.name.to_s)\n end\n return 0\n end", "def ports\n # prevent original array from being changed\n @ports.dup\n end", "def input_port_list\n input_ports.values\n end", "def switch_ports\r\n SwitchPortsController.instance\r\n end", "def ports\n return get_request(address(\"ports\"), @token)\n end", "def get_tier1_segment_port_mac_table_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_ports_list\n get_uri = @controller.get_node_operational_uri(self)\n response = @controller.rest_agent.get_request(get_uri)\n check_response_for_success(response) do |body|\n if body.has_key?('node') && body['node'].is_a?(Array) &&\n body['node'][0].has_key?('node-connector')\n ports = []\n body['node'][0]['node-connector'].each do |port|\n ports << port['flow-node-inventory:port-number']\n end\n NetconfResponse.new(NetconfResponseStatus::OK, ports)\n else\n NetconfResponse.new(NetconfResponseStatus::DATA_NOT_FOUND)\n end\n end\n end", "def ports\n unless @ports\n @ports = []\n @host.xpath(\"ReportItem\").each do |port|\n @ports << port['port']\n end\n @ports.uniq!\n @ports.sort!\n end\n @ports\n end", "def list_port(port, index = [], types = nil)\n types = port.metadata[:type] if types.nil?\n\n content = \"<ol>\"\n i = 0\n types.each do |type|\n if type.is_a?(Array)\n content += \"<li><br />\" +\n list_port(port, index + [i], type) + \"</li>\"\n else\n content += \"<li>(#{type})<p>\" +\n TavernaPlayer.port_renderer.render(port, index + [i]) +\n \"</p></li>\"\n end\n i += 1\n end\n\n content += \"</ol>\"\nend", "def index\n @port_of_calls = PortOfCall.all\n end", "def port_names\n @ports.keys\n end", "def tcp_service_discovery_ports=(ports)\n service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/TCPPortScan')\n service_ports.attributes['mode'] = 'custom'\n service_ports.attributes['method'] = 'syn'\n REXML::XPath.first(service_ports, './portList').text = ports.join(',')\n end", "def banners_on_ports(*params)\n slurp_stream(\"shodan/ports/#{params.join(\",\")}\") do |data|\n yield data\n end\n end", "def connected_ports; 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 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 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 port_names\n raise NotImplementedError\n end", "def ports_details\n ports = @template['NetworkSettings']['Ports']\n\n [].tap do |pdetails|\n ports.each do |private_port, public_ports|\n pport, type = private_port.split('/')\n\n if public_ports.nil?\n pdetails << { 'PrivatePort' => pport, 'Type' => type }\n else\n public_ports.each do |host|\n pdetails << { 'IP' => host['HostIp'], 'PrivatePort' => pport,\n 'PublicPort' => host['HostPort'], 'Type' => type }\n end\n end\n end\n end\n end", "def index\n @port_models = PortModel.all\n end", "def san_nics\n x = nics.find_all_by_network_type('san', :order =>:port_name)\n x = [] if x.nil?\n x\n end", "def mx_vlan_ports\r\n MXVLANPortsController.instance\r\n end", "def pids_on_ports(first=3000, count=4)\n last = first + count - 1\n `lsof -Fp -i tcp:#{first}-#{last}`.split(\"\\n\").map { |el| el[1,el.length].to_i }\nend", "def ports *ports\n @ports = *ports unless ports.length == 0\n @ports\n end", "def tcp_device_discovery_ports=(ports)\n tcp = REXML::XPath.first(@xml, 'ScanTemplate/DeviceDiscovery/CheckHosts/TCPHostCheck')\n REXML::XPath.first(tcp, './portList').text = ports.join(',')\n end", "def get_device_switch_ports(serial)\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'serial' => serial\r\n )\r\n # Prepare query url.\r\n _path_url = '/devices/{serial}/switchPorts'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'serial' => serial\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end", "def list_infra_segment_ports_0(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_0_with_http_info(segment_id, opts)\n data\n end", "def index\n if params[:switch_id] && @switch = Switch.find_by_id(params[:switch_id])\n @ports = @switch.ports.order(:id)\n elsif params[:slot_id] && @slot = Slot.find_by_id(params[:slot_id])\n @ports = @slot.ports.order(:id)\n else\n @ports = Port.order(:id)\n end\n end", "def inports\n all_ports :in\n end", "def output_port_list\n output_ports.values\n end", "def get_downlink_port_arp_table_for_tier1_segment_in_csv_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_in_csv_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def all_ports(type)\n SideJob.redis.smembers(\"#{redis_key}:#{type}ports\").reject {|name| name == '*'}.map {|name| SideJob::Port.new(self, type, name)}\n end", "def list_infra_segment_ports(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id, opts)\n data\n end", "def list_infra_segment_ports(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id, opts)\n data\n end", "def get_downlink_port_statistics_for_tier1_segment_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_statistics_for_tier1_segment_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def list_port_security_profile_bindings_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = list_port_security_profile_bindings_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def san_paths\n san_array_node = self.sans.first.san_array_node\n return [] if san_array_node.nil?\n x = san_array_node.san_interfaces\n return [] if x.length < 1\n xx = x.enum_slice((x.length / 2)).to_a \n # permitation of san controllers\n san_port_array = xx.first.zip(xx.last).flatten(1)\n san_interfaces.map{|saniface| [saniface.first, \n san_port_array[saniface.last.split('.').last.to_i % san_port_array.length].last] }\n end", "def ports\n [@free_ports, @allocated_ports].flatten\n end", "def get_downlink_port_arp_table_for_tier1_segment_in_csv(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_in_csv_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_downlink_port_statistics_for_tier1_segment(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_statistics_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def patch_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def input_port_names\n input_ports.keys\n end", "def device_ports(device_id)\n return get_request(address(\"ports?device_id=#{device_id}\"), @token)\n end", "def get_tier1_segment_port_mac_table_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_0, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table_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_mac_table_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table, 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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segments_by_state(tier_1_id, opts = {})\n data, _status_code, _headers = get_tier1_segments_by_state_with_http_info(tier_1_id, opts)\n data\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 list_port_qo_s_bindings_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = list_port_qo_s_bindings_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_network_ports(network_id)\n get(\"cloud-instances/#{guid}/networks/#{network_id}/ports\")[\"ports\"]\n end", "def switch_port_schedules\r\n SwitchPortSchedulesController.instance\r\n end", "def list_port_security_profile_bindings_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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_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}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].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 => 'PortSecurityProfileBindingMapListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#list_port_security_profile_bindings_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(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def create_or_replace_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def get_tier1_segment_port_mac_table_in_csv_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_in_csv_0\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table?format=csv'.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 query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/csv'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPortMacAddressCsvListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table_in_csv_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def base_ports(traversed)\n traversed.push self\n ports = []\n if (base = @resolved_base)\n base = base.idltype.resolved_type.node if base.is_a?(IDL::AST::Typedef)\n ports = base.ports(true, traversed) unless traversed.include?(base)\n end\n ports\n end", "def base_ports(traversed)\n traversed.push self\n ports = []\n if (base = @resolved_base)\n base = base.idltype.resolved_type.node if base.is_a?(IDL::AST::Typedef)\n ports = base.ports(true, traversed) unless traversed.include?(base)\n end\n ports\n end", "def list_port_security_profile_bindings_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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings, 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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].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 => 'PortSecurityProfileBindingMapListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#list_port_security_profile_bindings\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def display_port\n @port.each do |x|\n puts \"Company: #{x.name}\"\n puts \"Shares: #{x.shares}\"\n puts \"Price: #{x.price}#{x.currency}\"\n puts \"To USD: $#{sprintf('%.2f', x.con)}\"\n puts \"Total: #{x.total}#{x.currency}\"\n puts\n end\n end", "def index\n @port_panels = PortPanel.all\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_segment_dhcp_static_binding_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_segment_dhcp_static_binding_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def get_downlink_port_arp_table_for_tier1_segment(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = get_downlink_port_arp_table_for_tier1_segment_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def exclude_tcp_service_discovery_ports=(ports)\n service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/ExcludedTCPPortScan')\n REXML::XPath.first(service_ports, './portList').text = ports.join(',')\n end", "def list_port_security_profile_bindings(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = list_port_security_profile_bindings_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def delete_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def servlist(mask = nil, type = nil)\n send_data(\"SERVLIST #{mask} #{type}\".strip)\n end", "def list_tier1(opts = {})\n data, _status_code, _headers = list_tier1_with_http_info(opts)\n data\n end", "def create_or_replace_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def get_tier1_segments_by_state_0(tier_1_id, opts = {})\n data, _status_code, _headers = get_tier1_segments_by_state_0_with_http_info(tier_1_id, opts)\n data\n end", "def assignPorts (ixNet, realPort1, realPort2)\r\n chassis1 = realPort1[0]\r\n chassis2 = realPort2[0]\r\n card1 = realPort1[1]\r\n card2 = realPort2[1]\r\n port1 = realPort1[2]\r\n port2 = realPort2[2]\r\n\r\n root = @ixNet.getRoot()\r\n vport1 = @ixNet.add(root, 'vport')\r\n @ixNet.commit()\r\n vport1 = @ixNet.remapIds(vport1)[0]\r\n\r\n vport2 = @ixNet.add(root, 'vport')\r\n @ixNet.commit()\r\n vport2 = @ixNet.remapIds(vport2)[0]\r\n\r\n chassisObj1 = @ixNet.add(root + '/availableHardware', 'chassis')\r\n @ixNet.setAttribute(chassisObj1, '-hostname', chassis1)\r\n @ixNet.commit()\r\n chassisObj1 = @ixNet.remapIds(chassisObj1)[0]\r\n\r\n if (chassis1 != chassis2) then\r\n chassisObj2 = @ixNet.add(root + '/availableHardware', 'chassis')\r\n @ixNet.setAttribute(chassisObj2, '-hostname', chassis2)\r\n @ixNet.commit()\r\n chassisObj2 = @ixNet.remapIds(chassisObj2)[0]\r\n else\r\n chassisObj2 = chassisObj1\r\n end\r\n\r\n cardPortRef1 = chassisObj1 + '/card:'+card1+'/port:'+port1\r\n @ixNet.setMultiAttribute(vport1, '-connectedTo', cardPortRef1,\r\n '-rxMode', 'captureAndMeasure', '-name', 'Ethernet - 001')\r\n @ixNet.commit()\r\n\r\n cardPortRef2 = chassisObj2 + '/card:'+card2+'/port:'+port2\r\n @ixNet.setMultiAttribute(vport2, '-connectedTo', cardPortRef2,\r\n '-rxMode', 'captureAndMeasure', '-name', 'Ethernet - 002')\r\n @ixNet.commit()\r\nend", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_port_nodes\n props\n if @port_nodes.empty?\n # puts \"ports lazy\"\n pnodes = self.port_nodes() # TODO: not used, but should really compute everything instead of having to add ports manually!xb\n pnodes.each do |n|\n add_port n\n end\n end\n @port_nodes\n end", "def read_used_ports\n end", "def san_interfaces\n if san_nics.length == sans.length \n ports = san_network_ports().sort\n ips = san_nodes.map{|x| x.ip_address.to_s }.sort\n #return [] if ports.length != ips.length \n ports.zip(ips)\n else\n []\n end\n end", "def output_port_names\n output_ports.keys\n end", "def udp_service_discovery_ports=(ports)\n service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/UDPPortScan')\n service_ports.attributes['mode'] = 'custom'\n REXML::XPath.first(service_ports, './portList').text = ports.join(',')\n end", "def tagged_ports(switch)\n out = %x(snmpwalk -v 2c -c public #{switch} dot1qVlanStaticUntaggedPorts)\n lines = out.split(\"\\n\").select { |line| line.match(\"Hex-STRING\") }\n # Example line of data:\n # Q-BRIDGE-MIB::dot1qVlanStaticUntaggedPorts.1 = Hex-STRING: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF\n binlines = lines.map do |line|\n line.split(\":\")[3]\n end.map do |line|\n line.delete(' ')\n end.map do |line|\n line.hex.to_s(2).rjust(line.size*4, '0')\n end\n \n taggedports = []\n binlines.each do |line|\n binline = line.split(\"\")\n binline.each_index do |index|\n taggedports.push(index + 1) if binline[index] == \"0\"\n end\n end\n taggedports.sort.uniq\nend" ]
[ "0.73965734", "0.69955516", "0.6222411", "0.60023457", "0.5965747", "0.5896025", "0.5795441", "0.57811743", "0.5718091", "0.57126063", "0.57095695", "0.5646011", "0.5646011", "0.55688214", "0.55582154", "0.547859", "0.54564196", "0.5423515", "0.54148567", "0.5406033", "0.54001033", "0.53927326", "0.5385644", "0.5379088", "0.53642714", "0.5334176", "0.53043175", "0.52973145", "0.52950764", "0.52809954", "0.52313995", "0.5212274", "0.52035207", "0.5194671", "0.5189436", "0.51751983", "0.5174802", "0.51721156", "0.5167138", "0.5148221", "0.5129331", "0.5123439", "0.5121155", "0.510639", "0.50854635", "0.50807726", "0.50498426", "0.5023413", "0.5007121", "0.50025535", "0.50025535", "0.5002441", "0.50020355", "0.50020355", "0.49959207", "0.49763173", "0.49656203", "0.4963071", "0.49530715", "0.4940303", "0.4935663", "0.4934245", "0.49235713", "0.4907238", "0.48896185", "0.48876667", "0.48753566", "0.48704138", "0.4858252", "0.4850655", "0.48430035", "0.48406938", "0.48370963", "0.48263815", "0.48263815", "0.48247498", "0.48188356", "0.48188356", "0.4808485", "0.4799623", "0.478853", "0.4780749", "0.47754124", "0.47663763", "0.47660848", "0.47646835", "0.47576234", "0.47566846", "0.47523382", "0.47444242", "0.473366", "0.47308463", "0.4727637", "0.47211504", "0.47168043", "0.4716062", "0.4711892", "0.4708883", "0.4704549", "0.47044978" ]
0.6122332
3
Patch an infra segment port Create an infra segment port if it does not exist based on the IDs, or update existing port information by replacing the port object fields which presents in the request body.
def patch_infra_segment_port(segment_id, port_id, segment_port, opts = {}) patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_0(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def create_or_replace_infra_segment_port_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_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_infra_segment_port_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_port(port, fixed_ips) \n data = { 'port' => { 'fixed_ips' => fixed_ips } }\n return put_request(address(\"ports/\"+port), data, @token)\n end", "def create_or_replace_infra_segment_port_0_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_port(portName, attributes)\n @data['ports'].each do |port|\n next unless port['name'] == portName\n attributes.each { |key, value| port[key.to_s] = value }\n response = @client.rest_put(@data['uri'] + '/ports', 'body' => port)\n @client.response_handler(response)\n end\n end", "def update\n respond_to do |format|\n if @port.update(port_params)\n format.html { redirect_to @port, notice: \"Port was successfully updated.\" }\n format.json { render :show, status: :ok, location: @port }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @port.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n data\n end", "def create_or_replace_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n data\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def update\n respond_to do |format|\n if @dev_port.update(dev_port_params)\n format.html { redirect_to @dev_port, notice: 'Dev port was successfully updated.' }\n format.json { render :show, status: :ok, location: @dev_port }\n else\n format.html { render :edit }\n format.json { render json: @dev_port.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_infra_segment_port_0(segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts)\n data\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 patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_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 patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n respond_to do |format|\n if @port_service.update(port_service_params)\n format.html { redirect_to @port_service, notice: 'Port service was successfully updated.' }\n format.json { render :show, status: :ok, location: @port_service }\n else\n format.html { render :edit }\n format.json { render json: @port_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_port_service\n @port_service = PortService.find(params[:id])\n end", "def update\n\n respond_to do |format|\n if @port.update(port_params)\n SetPortRateLimitJob.perform_later(@port)\n format.html { redirect_to @port.portable, notice: \"Port was successfully updated.\" }\n format.json { render :show, status: :ok, location: @port }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @port.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 set_dev_port\n @dev_port = DevPort.find(params[:id])\n end", "def set_devport_fiber_id\n #binding.pry\n #get the devport assigned\n dvprt = Devport.find_by_id(porta) #cannot be nill...user chose already a valid port\n \n #june-25 adjustments:\n dvprt.fiber_out_id = id #(porta)\n dvprt.save\n dvprt = Devport.find_by_id(portb)\n dvprt.fiber_in_id = id #(portb)\n dvprt.save\n \n #this is commented-out by adjustment in June-25. Porta->fiber_out, Portb->fiber_in\n #if dvprt.fiber_in_id == 0\n # dvprt.fiber_in_id = id\n #elsif dvprt.fiber_out_id == 0\n # dvprt.fiber_out_id = id\n #else\n # dvprt.fiber_in_id = id #overwrite it then\n #end\n \n #save that one devport\n dvprt.save\n \n #now do the same for portb...\n #dvprt = Devport.find_by_id(portb) #cannot be nill...use chose already a valid port\n #if dvprt.fiber_in_id == 0\n # dvprt.fiber_in_id = id\n #elsif dvprt.fiber_out_id == 0\n # dvprt.fiber_out_id = id\n #else\n # dvprt.fiber_in_id = id #overwrite it then\n #end\n \n #save that one too...\n #dvprt.save\n\n \n end", "def update!(**args)\n @container_port = args[:container_port] if args.key?(:container_port)\n end", "def port=(new_port=\"\")\n (raise CloudLB::Exception::MissingArgument, \"Must provide a new port\") if new_port.to_s.empty?\n (raise CloudLB::Exception::Syntax, \"Port must be numeric\") unless new_port.to_s =~ /^\\d+$/\n body = {\"port\" => new_port.to_s}\n update(body)\n end", "def delete_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_infra_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.delete_infra_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.delete_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_infra_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.delete_infra_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.delete_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_infra_segment_port_security_profile_binding_0_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#patch_infra_segment_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def delete_infra_segment_port_0_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_infra_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_infra_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_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update!(**args)\n @ingress_port = args[:ingress_port] if args.key?(:ingress_port)\n @psc_uri = args[:psc_uri] if args.key?(:psc_uri)\n end", "def update\n respond_to do |format|\n if @port_of_call.update(port_of_call_params)\n format.html { redirect_to @port_of_call, notice: 'Port of call was successfully updated.' }\n format.json { render :show, status: :ok, location: @port_of_call }\n else\n format.html { render :edit }\n format.json { render json: @port_of_call.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch_infra_segment_port_security_profile_binding_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding ...'\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#patch_infra_segment_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n respond_to do |format|\n if @simple_portin.update(simple_portin_params)\n format.html { redirect_to @simple_portin, notice: 'Simple portin was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @simple_portin.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @port_model.update(port_model_params)\n format.html { redirect_to @port_model, notice: 'Port model was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @port_model.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_port_of_call\n @port_of_call = PortOfCall.find(params[:id])\n end", "def create_or_update_infra_segment_port_security_profile_binding_0_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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 => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_infra_segment_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_update_infra_segment_port_security_profile_binding_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding ...'\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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 => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_infra_segment_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_security_profile_binding(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n patch_infra_segment_port_security_profile_binding_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n nil\n end", "def port_service_params\n params.require(:port_service).permit(:port_id, :service_id)\n end", "def update_device_switch_port(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'serial' => options['serial'],\r\n 'number' => options['number']\r\n )\r\n # Prepare query url.\r\n _path_url = '/devices/{serial}/switchPorts/{number}'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'serial' => options['serial'],\r\n 'number' => options['number']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json',\r\n 'content-type' => 'application/json; charset=utf-8'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.put(\r\n _query_url,\r\n headers: _headers,\r\n parameters: options['update_device_switch_port'].to_json\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end", "def patch_infra_segment(segment_id, segment, opts = {})\n patch_infra_segment_with_http_info(segment_id, segment, opts)\n nil\n end", "def patch_infra_segment(segment_id, segment, opts = {})\n patch_infra_segment_with_http_info(segment_id, segment, opts)\n nil\n end", "def dev_port_params\n params.require(:dev_port).permit(:name, :portno, :type, :RackID, :odfid, :fiberid)\n end", "def patch_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#patch_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_dpg(dpg, vlan_id, num_ports)\n spec = RbVmomi::VIM::DVPortgroupConfigSpec.new\n\n changed = false\n\n orig_spec = RbVmomi::VIM::DVPortgroupConfigSpec.new\n orig_spec.numPorts = dpg['config.numPorts']\n orig_spec.defaultPortConfig = RbVmomi::VIM::VMwareDVSPortSetting.new\n orig_spec.defaultPortConfig.vlan = RbVmomi::VIM::VmwareDistributedVirtualSwitchVlanIdSpec.new\n orig_spec.defaultPortConfig.vlan.vlanId = dpg['config.defaultPortConfig.vlan.vlanId']\n orig_spec.defaultPortConfig.vlan.inherited = false\n\n if num_ports && num_ports != orig_spec.numPorts\n spec.numPorts = num_ports\n changed = true\n end\n\n # earlyBinding. A free DistributedVirtualPort will be selected and\n # assigned to a VirtualMachine when the virtual machine is reconfigured\n # to connect to the portgroup.\n spec.type = \"earlyBinding\"\n\n if vlan_id != orig_spec.defaultPortConfig.vlan.vlanId\n spec.defaultPortConfig = RbVmomi::VIM::VMwareDVSPortSetting.new\n spec.defaultPortConfig.vlan = RbVmomi::VIM::VmwareDistributedVirtualSwitchVlanIdSpec.new\n spec.defaultPortConfig.vlan.vlanId = vlan_id\n spec.defaultPortConfig.vlan.inherited = false\n changed = true\n end\n\n if changed\n\n spec.configVersion = dpg['config.configVersion']\n\n begin\n dpg.item.ReconfigureDVPortgroup_Task(:spec => spec).wait_for_completion\n rescue Exception => e\n raise \"The Distributed port group #{dpg['name']} could not be created. \"\\\n \"Reason: #{e.message}\"\n end\n\n @net_rollback << {:action => :update_dpg, :dpg => dpg.item, :name => dpg['name'], :spec => orig_spec}\n end\n\n end", "def patch_infra_segment_port_security_profile_binding_0(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n patch_infra_segment_port_security_profile_binding_0_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n nil\n end", "def move_port_to_subnets(port_id, subnet_ids)\n id_list = Array.new()\n subnet_ids.each do |id|\n id_list << { \"subnet_id\" => id }\n end\n return update_port(port_id, id_list)\n end", "def update\n respond_to do |format|\n if @switch_port.update(switch_port_params)\n format.html { redirect_to @switch_port, notice: 'Switch port was successfully updated.' }\n format.json { render :show, status: :ok, location: @switch_port }\n else\n format.html { render :edit }\n format.json { render json: @switch_port.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def create_or_replace_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def patch_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#patch_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n @porter = Porter.find(params[:id])\n\n respond_to do |format|\n if @porter.update_attributes(params[:porter])\n format.html { redirect_to @porter, notice: 'Porter was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @porter.errors, status: :unprocessable_entity }\n end\n end\n end", "def port=(val)\n @j_del.setPort(val)\n self\n end", "def set_port_model\n @port_model = PortModel.find(params[:id])\n end", "def port=(new_port)\n return if new_port == port\n reset!\n @desired_port = new_port\n start!\n end", "def patch_port_security_profile_binding(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n patch_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n nil\n end", "def create_or_update_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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 => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_update_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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 => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding_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_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def update\n respond_to do |format|\n if @port_panel.update(port_panel_params)\n format.html { redirect_to @port_panel, notice: 'Port panel was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @port_panel.errors, status: :unprocessable_entity }\n end\n end\n end", "def get_infra_segment_port_0_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_simple_portin\n @simple_portin = SimplePortin.find(params[:id])\n end", "def delete_infra_segment_port_security_profile_binding_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding ...'\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#delete_infra_segment_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def portgroup=(value)\n new_backing = RbVmomi::VIM.VirtualEthernetCardNetworkBackingInfo(\n :deviceName => value\n )\n vnic_new = vnic\n vnic_new.backing = new_backing\n spec = RbVmomi::VIM.VirtualMachineConfigSpec({\n :deviceChange => [{\n :operation => :edit,\n :device => vnic_new\n }]\n })\n vm.ReconfigVM_Task(:spec => spec).wait_for_completion\n end", "def update\n port_params = portfolio_params\n allocation_ids = Set.new()\n if port_params[:allocations_attributes].present?\n port_params[:allocations_attributes].each do |allocation|\n if allocation[:id].present?\n allocation_ids << allocation[:id].to_i\n allocation.delete(:asset_class_id)\n end\n # delete any allocations with weight of 0\n if allocation[:weight] == BigDecimal.new(\"0.0\")\n allocation[:_delete] = true\n end\n end\n @portfolio.allocations.each do |allocation|\n # If an allocation isn't in allocations_attributes, add it there and mark\n # it for deletion.\n unless allocation_ids.include?(allocation.id)\n port_params[:allocations_attributes] << {id: allocation.id, _delete: true}\n end\n end\n end\n # TODO: what about if the ID isn't included but the asset class already has\n # an allocation on this portfolio?\n if @portfolio.update(port_params)\n head :no_content\n else\n render json: @portfolio.errors, status: :unprocessable_entity\n end\n end", "def delete_infra_segment_port_security_profile_binding_0_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#delete_infra_segment_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_port_security_profile_binding_0(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n patch_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n nil\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n if params[:switch_id] && @switch = Switch.find_by_id(params[:switch_id])\n @port = @switch.ports.new(port_params)\n end\n\n if params[:slot_id] && @slot = Slot.find_by_id(params[:slot_id])\n @port = @slot.ports.new(port_params)\n end\n\n respond_to do |format|\n if @port.save\n format.html { redirect_to @port, notice: \"Port was successfully created.\" }\n format.json { render :show, status: :created, location: @port }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @port.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!(**args)\n @control_plane_node_port = args[:control_plane_node_port] if args.key?(:control_plane_node_port)\n @ingress_http_node_port = args[:ingress_http_node_port] if args.key?(:ingress_http_node_port)\n @ingress_https_node_port = args[:ingress_https_node_port] if args.key?(:ingress_https_node_port)\n @konnectivity_server_node_port = args[:konnectivity_server_node_port] if args.key?(:konnectivity_server_node_port)\n end", "def delete_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#delete_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#delete_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @dev_port = DevPort.new(dev_port_params)\n\n respond_to do |format|\n if @dev_port.save\n format.html { redirect_to @dev_port, notice: 'Dev port was successfully created.' }\n format.json { render :show, status: :created, location: @dev_port }\n else\n format.html { render :new }\n format.json { render json: @dev_port.errors, status: :unprocessable_entity }\n end\n end\n end", "def reset_port_protection\n response = @client.rest_put(@data['uri'] + '/resetportprotection')\n @client.response_handler(response)\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 patch(path, to: nil, as: nil, **constraints, &blk)\n add_route(::Rack::PATCH, path, to, as, constraints, &blk)\n end", "def port(new_port)\n unless port_valid? new_port\n raise Urb::InvalidUrl 'Try to set a invalid value to port'\n end\n\n @port = new_port\n\n self\n end", "def create_or_update_infra_segment_port_security_profile_binding(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n data, _status_code, _headers = create_or_update_infra_segment_port_security_profile_binding_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n data\n end", "def create\n @port = Port.new(port_params)\n\n respond_to do |format|\n if @port.save\n format.html { redirect_to @port, notice: \"Port was successfully created.\" }\n format.json { render :show, status: :created, location: @port }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @port.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @rapport.update(rapport_params)\n format.html { redirect_to @rapport, notice: 'Rapport was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @rapport.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @dynamic_segment = args[:dynamic_segment] if args.key?(:dynamic_segment)\n @segment_id = args[:segment_id] if args.key?(:segment_id)\n end", "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "def set_port(port, value_mask)\n send_request(FUNCTION_SET_PORT, [port, value_mask], 'k C', 0, '')\n end", "def patch_infra_segment_0(segment_id, segment, opts = {})\n patch_infra_segment_0_with_http_info(segment_id, segment, opts)\n nil\n end", "def set_rapport\n Rapport.find(params[:id] || params[:rapport_id])\n #@rapport = case id\n # when 'paris' then Rapport.last\n # else Rapport.find(id)\n #end\n end", "def update\n respond_to do |format|\n if @rapport.update(rapport_params)\n format.html { redirect_to @rapport, notice: 'Rapport was successfully updated.' }\n format.json { render :show, status: :ok, location: @rapport }\n else\n format.html { render :edit }\n format.json { render json: @rapport.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @control_plane_load_balancer_port = args[:control_plane_load_balancer_port] if args.key?(:control_plane_load_balancer_port)\n end", "def update!(**args)\n @control_plane_load_balancer_port = args[:control_plane_load_balancer_port] if args.key?(:control_plane_load_balancer_port)\n end" ]
[ "0.664973", "0.664973", "0.662917", "0.6542741", "0.649528", "0.649528", "0.6400293", "0.637784", "0.6031174", "0.60145444", "0.59648347", "0.59648347", "0.5906005", "0.5906005", "0.58422637", "0.5786168", "0.5729818", "0.57155526", "0.57020277", "0.5692224", "0.5689798", "0.56686395", "0.5656537", "0.5588914", "0.5584063", "0.5580346", "0.5492382", "0.54796004", "0.546711", "0.5435854", "0.5435854", "0.5405455", "0.5405455", "0.54042536", "0.53934366", "0.5386405", "0.53707814", "0.5312787", "0.5281113", "0.5279082", "0.5266165", "0.52530336", "0.5250014", "0.5207668", "0.5194199", "0.5158863", "0.5137574", "0.51047546", "0.51047546", "0.50673145", "0.5047494", "0.5035595", "0.50334764", "0.5031208", "0.5028395", "0.5025651", "0.5025651", "0.50202453", "0.5017036", "0.5000973", "0.49652165", "0.494361", "0.49379906", "0.49346974", "0.4927782", "0.4927782", "0.49272698", "0.4912766", "0.4911736", "0.48890603", "0.48879275", "0.48576346", "0.48539728", "0.48462775", "0.48423076", "0.48396152", "0.48327002", "0.4818421", "0.47970417", "0.47889414", "0.4783604", "0.47682407", "0.47631288", "0.47586894", "0.47483456", "0.4744963", "0.47447762", "0.4739364", "0.4734433", "0.4734168", "0.47337243", "0.4723804", "0.471353", "0.47104478", "0.47081932", "0.47068113", "0.47059", "0.4697468", "0.4697468" ]
0.6765491
1
Patch an infra segment port Create an infra segment port if it does not exist based on the IDs, or update existing port information by replacing the port object fields which presents in the request body.
def patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_segment_port ...' end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_segment_port" end # verify the required parameter 'port_id' is set if @api_client.config.client_side_validation && port_id.nil? fail ArgumentError, "Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_segment_port" end # verify the required parameter 'segment_port' is set if @api_client.config.client_side_validation && segment_port.nil? fail ArgumentError, "Missing the required parameter 'segment_port' when calling PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_segment_port" end # resource path local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_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(segment_port) 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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_0(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def create_or_replace_infra_segment_port_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_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_infra_segment_port_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_port(port, fixed_ips) \n data = { 'port' => { 'fixed_ips' => fixed_ips } }\n return put_request(address(\"ports/\"+port), data, @token)\n end", "def create_or_replace_infra_segment_port_0_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_port(portName, attributes)\n @data['ports'].each do |port|\n next unless port['name'] == portName\n attributes.each { |key, value| port[key.to_s] = value }\n response = @client.rest_put(@data['uri'] + '/ports', 'body' => port)\n @client.response_handler(response)\n end\n end", "def update\n respond_to do |format|\n if @port.update(port_params)\n format.html { redirect_to @port, notice: \"Port was successfully updated.\" }\n format.json { render :show, status: :ok, location: @port }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @port.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n data\n end", "def create_or_replace_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n data\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def update\n respond_to do |format|\n if @dev_port.update(dev_port_params)\n format.html { redirect_to @dev_port, notice: 'Dev port was successfully updated.' }\n format.json { render :show, status: :ok, location: @dev_port }\n else\n format.html { render :edit }\n format.json { render json: @dev_port.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_infra_segment_port_0(segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts)\n data\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 patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_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 patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n respond_to do |format|\n if @port_service.update(port_service_params)\n format.html { redirect_to @port_service, notice: 'Port service was successfully updated.' }\n format.json { render :show, status: :ok, location: @port_service }\n else\n format.html { render :edit }\n format.json { render json: @port_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_port_service\n @port_service = PortService.find(params[:id])\n end", "def update\n\n respond_to do |format|\n if @port.update(port_params)\n SetPortRateLimitJob.perform_later(@port)\n format.html { redirect_to @port.portable, notice: \"Port was successfully updated.\" }\n format.json { render :show, status: :ok, location: @port }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @port.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 set_dev_port\n @dev_port = DevPort.find(params[:id])\n end", "def set_devport_fiber_id\n #binding.pry\n #get the devport assigned\n dvprt = Devport.find_by_id(porta) #cannot be nill...user chose already a valid port\n \n #june-25 adjustments:\n dvprt.fiber_out_id = id #(porta)\n dvprt.save\n dvprt = Devport.find_by_id(portb)\n dvprt.fiber_in_id = id #(portb)\n dvprt.save\n \n #this is commented-out by adjustment in June-25. Porta->fiber_out, Portb->fiber_in\n #if dvprt.fiber_in_id == 0\n # dvprt.fiber_in_id = id\n #elsif dvprt.fiber_out_id == 0\n # dvprt.fiber_out_id = id\n #else\n # dvprt.fiber_in_id = id #overwrite it then\n #end\n \n #save that one devport\n dvprt.save\n \n #now do the same for portb...\n #dvprt = Devport.find_by_id(portb) #cannot be nill...use chose already a valid port\n #if dvprt.fiber_in_id == 0\n # dvprt.fiber_in_id = id\n #elsif dvprt.fiber_out_id == 0\n # dvprt.fiber_out_id = id\n #else\n # dvprt.fiber_in_id = id #overwrite it then\n #end\n \n #save that one too...\n #dvprt.save\n\n \n end", "def update!(**args)\n @container_port = args[:container_port] if args.key?(:container_port)\n end", "def port=(new_port=\"\")\n (raise CloudLB::Exception::MissingArgument, \"Must provide a new port\") if new_port.to_s.empty?\n (raise CloudLB::Exception::Syntax, \"Port must be numeric\") unless new_port.to_s =~ /^\\d+$/\n body = {\"port\" => new_port.to_s}\n update(body)\n end", "def delete_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_infra_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.delete_infra_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.delete_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_infra_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.delete_infra_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.delete_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_infra_segment_port_security_profile_binding_0_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#patch_infra_segment_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def delete_infra_segment_port_0_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_infra_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_infra_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_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update!(**args)\n @ingress_port = args[:ingress_port] if args.key?(:ingress_port)\n @psc_uri = args[:psc_uri] if args.key?(:psc_uri)\n end", "def update\n respond_to do |format|\n if @port_of_call.update(port_of_call_params)\n format.html { redirect_to @port_of_call, notice: 'Port of call was successfully updated.' }\n format.json { render :show, status: :ok, location: @port_of_call }\n else\n format.html { render :edit }\n format.json { render json: @port_of_call.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch_infra_segment_port_security_profile_binding_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding ...'\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#patch_infra_segment_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n respond_to do |format|\n if @simple_portin.update(simple_portin_params)\n format.html { redirect_to @simple_portin, notice: 'Simple portin was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @simple_portin.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @port_model.update(port_model_params)\n format.html { redirect_to @port_model, notice: 'Port model was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @port_model.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_port_of_call\n @port_of_call = PortOfCall.find(params[:id])\n end", "def create_or_update_infra_segment_port_security_profile_binding_0_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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 => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_infra_segment_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_update_infra_segment_port_security_profile_binding_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding ...'\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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 => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_infra_segment_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_security_profile_binding(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n patch_infra_segment_port_security_profile_binding_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n nil\n end", "def port_service_params\n params.require(:port_service).permit(:port_id, :service_id)\n end", "def update_device_switch_port(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'serial' => options['serial'],\r\n 'number' => options['number']\r\n )\r\n # Prepare query url.\r\n _path_url = '/devices/{serial}/switchPorts/{number}'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'serial' => options['serial'],\r\n 'number' => options['number']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json',\r\n 'content-type' => 'application/json; charset=utf-8'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.put(\r\n _query_url,\r\n headers: _headers,\r\n parameters: options['update_device_switch_port'].to_json\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end", "def patch_infra_segment(segment_id, segment, opts = {})\n patch_infra_segment_with_http_info(segment_id, segment, opts)\n nil\n end", "def patch_infra_segment(segment_id, segment, opts = {})\n patch_infra_segment_with_http_info(segment_id, segment, opts)\n nil\n end", "def dev_port_params\n params.require(:dev_port).permit(:name, :portno, :type, :RackID, :odfid, :fiberid)\n end", "def patch_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#patch_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_dpg(dpg, vlan_id, num_ports)\n spec = RbVmomi::VIM::DVPortgroupConfigSpec.new\n\n changed = false\n\n orig_spec = RbVmomi::VIM::DVPortgroupConfigSpec.new\n orig_spec.numPorts = dpg['config.numPorts']\n orig_spec.defaultPortConfig = RbVmomi::VIM::VMwareDVSPortSetting.new\n orig_spec.defaultPortConfig.vlan = RbVmomi::VIM::VmwareDistributedVirtualSwitchVlanIdSpec.new\n orig_spec.defaultPortConfig.vlan.vlanId = dpg['config.defaultPortConfig.vlan.vlanId']\n orig_spec.defaultPortConfig.vlan.inherited = false\n\n if num_ports && num_ports != orig_spec.numPorts\n spec.numPorts = num_ports\n changed = true\n end\n\n # earlyBinding. A free DistributedVirtualPort will be selected and\n # assigned to a VirtualMachine when the virtual machine is reconfigured\n # to connect to the portgroup.\n spec.type = \"earlyBinding\"\n\n if vlan_id != orig_spec.defaultPortConfig.vlan.vlanId\n spec.defaultPortConfig = RbVmomi::VIM::VMwareDVSPortSetting.new\n spec.defaultPortConfig.vlan = RbVmomi::VIM::VmwareDistributedVirtualSwitchVlanIdSpec.new\n spec.defaultPortConfig.vlan.vlanId = vlan_id\n spec.defaultPortConfig.vlan.inherited = false\n changed = true\n end\n\n if changed\n\n spec.configVersion = dpg['config.configVersion']\n\n begin\n dpg.item.ReconfigureDVPortgroup_Task(:spec => spec).wait_for_completion\n rescue Exception => e\n raise \"The Distributed port group #{dpg['name']} could not be created. \"\\\n \"Reason: #{e.message}\"\n end\n\n @net_rollback << {:action => :update_dpg, :dpg => dpg.item, :name => dpg['name'], :spec => orig_spec}\n end\n\n end", "def patch_infra_segment_port_security_profile_binding_0(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n patch_infra_segment_port_security_profile_binding_0_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n nil\n end", "def move_port_to_subnets(port_id, subnet_ids)\n id_list = Array.new()\n subnet_ids.each do |id|\n id_list << { \"subnet_id\" => id }\n end\n return update_port(port_id, id_list)\n end", "def update\n respond_to do |format|\n if @switch_port.update(switch_port_params)\n format.html { redirect_to @switch_port, notice: 'Switch port was successfully updated.' }\n format.json { render :show, status: :ok, location: @switch_port }\n else\n format.html { render :edit }\n format.json { render json: @switch_port.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def create_or_replace_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def patch_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#patch_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n @porter = Porter.find(params[:id])\n\n respond_to do |format|\n if @porter.update_attributes(params[:porter])\n format.html { redirect_to @porter, notice: 'Porter was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @porter.errors, status: :unprocessable_entity }\n end\n end\n end", "def port=(val)\n @j_del.setPort(val)\n self\n end", "def set_port_model\n @port_model = PortModel.find(params[:id])\n end", "def port=(new_port)\n return if new_port == port\n reset!\n @desired_port = new_port\n start!\n end", "def patch_port_security_profile_binding(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n patch_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n nil\n end", "def create_or_update_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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 => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_update_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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 => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n respond_to do |format|\n if @port_panel.update(port_panel_params)\n format.html { redirect_to @port_panel, notice: 'Port panel was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @port_panel.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def get_infra_segment_port_0_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_simple_portin\n @simple_portin = SimplePortin.find(params[:id])\n end", "def delete_infra_segment_port_security_profile_binding_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding ...'\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#delete_infra_segment_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def portgroup=(value)\n new_backing = RbVmomi::VIM.VirtualEthernetCardNetworkBackingInfo(\n :deviceName => value\n )\n vnic_new = vnic\n vnic_new.backing = new_backing\n spec = RbVmomi::VIM.VirtualMachineConfigSpec({\n :deviceChange => [{\n :operation => :edit,\n :device => vnic_new\n }]\n })\n vm.ReconfigVM_Task(:spec => spec).wait_for_completion\n end", "def update\n port_params = portfolio_params\n allocation_ids = Set.new()\n if port_params[:allocations_attributes].present?\n port_params[:allocations_attributes].each do |allocation|\n if allocation[:id].present?\n allocation_ids << allocation[:id].to_i\n allocation.delete(:asset_class_id)\n end\n # delete any allocations with weight of 0\n if allocation[:weight] == BigDecimal.new(\"0.0\")\n allocation[:_delete] = true\n end\n end\n @portfolio.allocations.each do |allocation|\n # If an allocation isn't in allocations_attributes, add it there and mark\n # it for deletion.\n unless allocation_ids.include?(allocation.id)\n port_params[:allocations_attributes] << {id: allocation.id, _delete: true}\n end\n end\n end\n # TODO: what about if the ID isn't included but the asset class already has\n # an allocation on this portfolio?\n if @portfolio.update(port_params)\n head :no_content\n else\n render json: @portfolio.errors, status: :unprocessable_entity\n end\n end", "def delete_infra_segment_port_security_profile_binding_0_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#delete_infra_segment_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_port_security_profile_binding_0(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n patch_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n nil\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n if params[:switch_id] && @switch = Switch.find_by_id(params[:switch_id])\n @port = @switch.ports.new(port_params)\n end\n\n if params[:slot_id] && @slot = Slot.find_by_id(params[:slot_id])\n @port = @slot.ports.new(port_params)\n end\n\n respond_to do |format|\n if @port.save\n format.html { redirect_to @port, notice: \"Port was successfully created.\" }\n format.json { render :show, status: :created, location: @port }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @port.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!(**args)\n @control_plane_node_port = args[:control_plane_node_port] if args.key?(:control_plane_node_port)\n @ingress_http_node_port = args[:ingress_http_node_port] if args.key?(:ingress_http_node_port)\n @ingress_https_node_port = args[:ingress_https_node_port] if args.key?(:ingress_https_node_port)\n @konnectivity_server_node_port = args[:konnectivity_server_node_port] if args.key?(:konnectivity_server_node_port)\n end", "def delete_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#delete_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#delete_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @dev_port = DevPort.new(dev_port_params)\n\n respond_to do |format|\n if @dev_port.save\n format.html { redirect_to @dev_port, notice: 'Dev port was successfully created.' }\n format.json { render :show, status: :created, location: @dev_port }\n else\n format.html { render :new }\n format.json { render json: @dev_port.errors, status: :unprocessable_entity }\n end\n end\n end", "def reset_port_protection\n response = @client.rest_put(@data['uri'] + '/resetportprotection')\n @client.response_handler(response)\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 patch(path, to: nil, as: nil, **constraints, &blk)\n add_route(::Rack::PATCH, path, to, as, constraints, &blk)\n end", "def port(new_port)\n unless port_valid? new_port\n raise Urb::InvalidUrl 'Try to set a invalid value to port'\n end\n\n @port = new_port\n\n self\n end", "def update\n respond_to do |format|\n if @rapport.update(rapport_params)\n format.html { redirect_to @rapport, notice: 'Rapport was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @rapport.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_update_infra_segment_port_security_profile_binding(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n data, _status_code, _headers = create_or_update_infra_segment_port_security_profile_binding_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n data\n end", "def create\n @port = Port.new(port_params)\n\n respond_to do |format|\n if @port.save\n format.html { redirect_to @port, notice: \"Port was successfully created.\" }\n format.json { render :show, status: :created, location: @port }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @port.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @dynamic_segment = args[:dynamic_segment] if args.key?(:dynamic_segment)\n @segment_id = args[:segment_id] if args.key?(:segment_id)\n end", "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "def set_port(port, value_mask)\n send_request(FUNCTION_SET_PORT, [port, value_mask], 'k C', 0, '')\n end", "def update\n respond_to do |format|\n if @rapport.update(rapport_params)\n format.html { redirect_to @rapport, notice: 'Rapport was successfully updated.' }\n format.json { render :show, status: :ok, location: @rapport }\n else\n format.html { render :edit }\n format.json { render json: @rapport.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_rapport\n Rapport.find(params[:id] || params[:rapport_id])\n #@rapport = case id\n # when 'paris' then Rapport.last\n # else Rapport.find(id)\n #end\n end", "def patch_infra_segment_0(segment_id, segment, opts = {})\n patch_infra_segment_0_with_http_info(segment_id, segment, opts)\n nil\n end", "def update!(**args)\n @control_plane_load_balancer_port = args[:control_plane_load_balancer_port] if args.key?(:control_plane_load_balancer_port)\n end", "def update!(**args)\n @control_plane_load_balancer_port = args[:control_plane_load_balancer_port] if args.key?(:control_plane_load_balancer_port)\n end" ]
[ "0.67659867", "0.67659867", "0.6629633", "0.6542348", "0.6495142", "0.6495142", "0.64018244", "0.6377367", "0.60335255", "0.60168886", "0.59638894", "0.59638894", "0.5906643", "0.5906643", "0.5844488", "0.57846606", "0.5729075", "0.57158774", "0.57021433", "0.5691512", "0.56901395", "0.5671283", "0.5657291", "0.5591039", "0.5583144", "0.55804735", "0.5491438", "0.548142", "0.546849", "0.5436668", "0.5436668", "0.5405325", "0.5405325", "0.54049635", "0.53928286", "0.53868014", "0.53726435", "0.5314425", "0.5282111", "0.5280767", "0.5268535", "0.52528703", "0.52501905", "0.52081966", "0.51955515", "0.51610386", "0.51395595", "0.5103268", "0.5103268", "0.5068558", "0.50485986", "0.5035857", "0.5034015", "0.5032209", "0.5030838", "0.5024084", "0.5024084", "0.502102", "0.50188965", "0.50017625", "0.49657932", "0.49446374", "0.493932", "0.49352455", "0.49286878", "0.49286878", "0.49275202", "0.4914274", "0.49109218", "0.48897097", "0.48877496", "0.48587328", "0.48544344", "0.48460254", "0.48431736", "0.48403373", "0.4833407", "0.48189837", "0.47961095", "0.47884956", "0.47859788", "0.47691318", "0.47644156", "0.47582343", "0.47483942", "0.47451392", "0.47445968", "0.47406736", "0.47359383", "0.4735006", "0.47337228", "0.4723789", "0.4713215", "0.47115415", "0.47080067", "0.47069946", "0.4706158", "0.46992895", "0.46992895" ]
0.6650553
3
Patch an infra segment port Create an infra segment port if it does not exist based on the IDs, or update existing port information by replacing the port object fields which presents in the request body.
def patch_infra_segment_port_0(segment_id, port_id, segment_port, opts = {}) patch_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_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_infra_segment_port_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_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_infra_segment_port_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_port(port, fixed_ips) \n data = { 'port' => { 'fixed_ips' => fixed_ips } }\n return put_request(address(\"ports/\"+port), data, @token)\n end", "def create_or_replace_infra_segment_port_0_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_port(portName, attributes)\n @data['ports'].each do |port|\n next unless port['name'] == portName\n attributes.each { |key, value| port[key.to_s] = value }\n response = @client.rest_put(@data['uri'] + '/ports', 'body' => port)\n @client.response_handler(response)\n end\n end", "def update\n respond_to do |format|\n if @port.update(port_params)\n format.html { redirect_to @port, notice: \"Port was successfully updated.\" }\n format.json { render :show, status: :ok, location: @port }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @port.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n data\n end", "def create_or_replace_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n data\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def update\n respond_to do |format|\n if @dev_port.update(dev_port_params)\n format.html { redirect_to @dev_port, notice: 'Dev port was successfully updated.' }\n format.json { render :show, status: :ok, location: @dev_port }\n else\n format.html { render :edit }\n format.json { render json: @dev_port.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_infra_segment_port_0(segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts)\n data\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 patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_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 patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n respond_to do |format|\n if @port_service.update(port_service_params)\n format.html { redirect_to @port_service, notice: 'Port service was successfully updated.' }\n format.json { render :show, status: :ok, location: @port_service }\n else\n format.html { render :edit }\n format.json { render json: @port_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_port_service\n @port_service = PortService.find(params[:id])\n end", "def update\n\n respond_to do |format|\n if @port.update(port_params)\n SetPortRateLimitJob.perform_later(@port)\n format.html { redirect_to @port.portable, notice: \"Port was successfully updated.\" }\n format.json { render :show, status: :ok, location: @port }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @port.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 set_dev_port\n @dev_port = DevPort.find(params[:id])\n end", "def set_devport_fiber_id\n #binding.pry\n #get the devport assigned\n dvprt = Devport.find_by_id(porta) #cannot be nill...user chose already a valid port\n \n #june-25 adjustments:\n dvprt.fiber_out_id = id #(porta)\n dvprt.save\n dvprt = Devport.find_by_id(portb)\n dvprt.fiber_in_id = id #(portb)\n dvprt.save\n \n #this is commented-out by adjustment in June-25. Porta->fiber_out, Portb->fiber_in\n #if dvprt.fiber_in_id == 0\n # dvprt.fiber_in_id = id\n #elsif dvprt.fiber_out_id == 0\n # dvprt.fiber_out_id = id\n #else\n # dvprt.fiber_in_id = id #overwrite it then\n #end\n \n #save that one devport\n dvprt.save\n \n #now do the same for portb...\n #dvprt = Devport.find_by_id(portb) #cannot be nill...use chose already a valid port\n #if dvprt.fiber_in_id == 0\n # dvprt.fiber_in_id = id\n #elsif dvprt.fiber_out_id == 0\n # dvprt.fiber_out_id = id\n #else\n # dvprt.fiber_in_id = id #overwrite it then\n #end\n \n #save that one too...\n #dvprt.save\n\n \n end", "def update!(**args)\n @container_port = args[:container_port] if args.key?(:container_port)\n end", "def port=(new_port=\"\")\n (raise CloudLB::Exception::MissingArgument, \"Must provide a new port\") if new_port.to_s.empty?\n (raise CloudLB::Exception::Syntax, \"Port must be numeric\") unless new_port.to_s =~ /^\\d+$/\n body = {\"port\" => new_port.to_s}\n update(body)\n end", "def delete_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_infra_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.delete_infra_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.delete_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_infra_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.delete_infra_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.delete_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_infra_segment_port_security_profile_binding_0_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#patch_infra_segment_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def delete_infra_segment_port_0_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_infra_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_infra_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_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update!(**args)\n @ingress_port = args[:ingress_port] if args.key?(:ingress_port)\n @psc_uri = args[:psc_uri] if args.key?(:psc_uri)\n end", "def update\n respond_to do |format|\n if @port_of_call.update(port_of_call_params)\n format.html { redirect_to @port_of_call, notice: 'Port of call was successfully updated.' }\n format.json { render :show, status: :ok, location: @port_of_call }\n else\n format.html { render :edit }\n format.json { render json: @port_of_call.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch_infra_segment_port_security_profile_binding_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding ...'\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#patch_infra_segment_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n respond_to do |format|\n if @simple_portin.update(simple_portin_params)\n format.html { redirect_to @simple_portin, notice: 'Simple portin was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @simple_portin.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @port_model.update(port_model_params)\n format.html { redirect_to @port_model, notice: 'Port model was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @port_model.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_port_of_call\n @port_of_call = PortOfCall.find(params[:id])\n end", "def create_or_update_infra_segment_port_security_profile_binding_0_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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 => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_infra_segment_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_update_infra_segment_port_security_profile_binding_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding ...'\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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 => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_infra_segment_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_security_profile_binding(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n patch_infra_segment_port_security_profile_binding_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n nil\n end", "def port_service_params\n params.require(:port_service).permit(:port_id, :service_id)\n end", "def update_device_switch_port(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'serial' => options['serial'],\r\n 'number' => options['number']\r\n )\r\n # Prepare query url.\r\n _path_url = '/devices/{serial}/switchPorts/{number}'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'serial' => options['serial'],\r\n 'number' => options['number']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json',\r\n 'content-type' => 'application/json; charset=utf-8'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.put(\r\n _query_url,\r\n headers: _headers,\r\n parameters: options['update_device_switch_port'].to_json\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end", "def patch_infra_segment(segment_id, segment, opts = {})\n patch_infra_segment_with_http_info(segment_id, segment, opts)\n nil\n end", "def patch_infra_segment(segment_id, segment, opts = {})\n patch_infra_segment_with_http_info(segment_id, segment, opts)\n nil\n end", "def dev_port_params\n params.require(:dev_port).permit(:name, :portno, :type, :RackID, :odfid, :fiberid)\n end", "def patch_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#patch_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_dpg(dpg, vlan_id, num_ports)\n spec = RbVmomi::VIM::DVPortgroupConfigSpec.new\n\n changed = false\n\n orig_spec = RbVmomi::VIM::DVPortgroupConfigSpec.new\n orig_spec.numPorts = dpg['config.numPorts']\n orig_spec.defaultPortConfig = RbVmomi::VIM::VMwareDVSPortSetting.new\n orig_spec.defaultPortConfig.vlan = RbVmomi::VIM::VmwareDistributedVirtualSwitchVlanIdSpec.new\n orig_spec.defaultPortConfig.vlan.vlanId = dpg['config.defaultPortConfig.vlan.vlanId']\n orig_spec.defaultPortConfig.vlan.inherited = false\n\n if num_ports && num_ports != orig_spec.numPorts\n spec.numPorts = num_ports\n changed = true\n end\n\n # earlyBinding. A free DistributedVirtualPort will be selected and\n # assigned to a VirtualMachine when the virtual machine is reconfigured\n # to connect to the portgroup.\n spec.type = \"earlyBinding\"\n\n if vlan_id != orig_spec.defaultPortConfig.vlan.vlanId\n spec.defaultPortConfig = RbVmomi::VIM::VMwareDVSPortSetting.new\n spec.defaultPortConfig.vlan = RbVmomi::VIM::VmwareDistributedVirtualSwitchVlanIdSpec.new\n spec.defaultPortConfig.vlan.vlanId = vlan_id\n spec.defaultPortConfig.vlan.inherited = false\n changed = true\n end\n\n if changed\n\n spec.configVersion = dpg['config.configVersion']\n\n begin\n dpg.item.ReconfigureDVPortgroup_Task(:spec => spec).wait_for_completion\n rescue Exception => e\n raise \"The Distributed port group #{dpg['name']} could not be created. \"\\\n \"Reason: #{e.message}\"\n end\n\n @net_rollback << {:action => :update_dpg, :dpg => dpg.item, :name => dpg['name'], :spec => orig_spec}\n end\n\n end", "def patch_infra_segment_port_security_profile_binding_0(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n patch_infra_segment_port_security_profile_binding_0_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n nil\n end", "def move_port_to_subnets(port_id, subnet_ids)\n id_list = Array.new()\n subnet_ids.each do |id|\n id_list << { \"subnet_id\" => id }\n end\n return update_port(port_id, id_list)\n end", "def update\n respond_to do |format|\n if @switch_port.update(switch_port_params)\n format.html { redirect_to @switch_port, notice: 'Switch port was successfully updated.' }\n format.json { render :show, status: :ok, location: @switch_port }\n else\n format.html { render :edit }\n format.json { render json: @switch_port.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def create_or_replace_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def patch_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#patch_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n @porter = Porter.find(params[:id])\n\n respond_to do |format|\n if @porter.update_attributes(params[:porter])\n format.html { redirect_to @porter, notice: 'Porter was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @porter.errors, status: :unprocessable_entity }\n end\n end\n end", "def port=(val)\n @j_del.setPort(val)\n self\n end", "def set_port_model\n @port_model = PortModel.find(params[:id])\n end", "def port=(new_port)\n return if new_port == port\n reset!\n @desired_port = new_port\n start!\n end", "def patch_port_security_profile_binding(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n patch_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n nil\n end", "def create_or_update_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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 => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_update_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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 => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n respond_to do |format|\n if @port_panel.update(port_panel_params)\n format.html { redirect_to @port_panel, notice: 'Port panel was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @port_panel.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def get_infra_segment_port_0_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_simple_portin\n @simple_portin = SimplePortin.find(params[:id])\n end", "def delete_infra_segment_port_security_profile_binding_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding ...'\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#delete_infra_segment_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def portgroup=(value)\n new_backing = RbVmomi::VIM.VirtualEthernetCardNetworkBackingInfo(\n :deviceName => value\n )\n vnic_new = vnic\n vnic_new.backing = new_backing\n spec = RbVmomi::VIM.VirtualMachineConfigSpec({\n :deviceChange => [{\n :operation => :edit,\n :device => vnic_new\n }]\n })\n vm.ReconfigVM_Task(:spec => spec).wait_for_completion\n end", "def update\n port_params = portfolio_params\n allocation_ids = Set.new()\n if port_params[:allocations_attributes].present?\n port_params[:allocations_attributes].each do |allocation|\n if allocation[:id].present?\n allocation_ids << allocation[:id].to_i\n allocation.delete(:asset_class_id)\n end\n # delete any allocations with weight of 0\n if allocation[:weight] == BigDecimal.new(\"0.0\")\n allocation[:_delete] = true\n end\n end\n @portfolio.allocations.each do |allocation|\n # If an allocation isn't in allocations_attributes, add it there and mark\n # it for deletion.\n unless allocation_ids.include?(allocation.id)\n port_params[:allocations_attributes] << {id: allocation.id, _delete: true}\n end\n end\n end\n # TODO: what about if the ID isn't included but the asset class already has\n # an allocation on this portfolio?\n if @portfolio.update(port_params)\n head :no_content\n else\n render json: @portfolio.errors, status: :unprocessable_entity\n end\n end", "def delete_infra_segment_port_security_profile_binding_0_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#delete_infra_segment_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_port_security_profile_binding_0(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n patch_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n nil\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n if params[:switch_id] && @switch = Switch.find_by_id(params[:switch_id])\n @port = @switch.ports.new(port_params)\n end\n\n if params[:slot_id] && @slot = Slot.find_by_id(params[:slot_id])\n @port = @slot.ports.new(port_params)\n end\n\n respond_to do |format|\n if @port.save\n format.html { redirect_to @port, notice: \"Port was successfully created.\" }\n format.json { render :show, status: :created, location: @port }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @port.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!(**args)\n @control_plane_node_port = args[:control_plane_node_port] if args.key?(:control_plane_node_port)\n @ingress_http_node_port = args[:ingress_http_node_port] if args.key?(:ingress_http_node_port)\n @ingress_https_node_port = args[:ingress_https_node_port] if args.key?(:ingress_https_node_port)\n @konnectivity_server_node_port = args[:konnectivity_server_node_port] if args.key?(:konnectivity_server_node_port)\n end", "def delete_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#delete_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#delete_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @dev_port = DevPort.new(dev_port_params)\n\n respond_to do |format|\n if @dev_port.save\n format.html { redirect_to @dev_port, notice: 'Dev port was successfully created.' }\n format.json { render :show, status: :created, location: @dev_port }\n else\n format.html { render :new }\n format.json { render json: @dev_port.errors, status: :unprocessable_entity }\n end\n end\n end", "def reset_port_protection\n response = @client.rest_put(@data['uri'] + '/resetportprotection')\n @client.response_handler(response)\n end", "def patch(path, to: nil, as: nil, **constraints, &blk)\n add_route(::Rack::PATCH, path, to, as, constraints, &blk)\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 port(new_port)\n unless port_valid? new_port\n raise Urb::InvalidUrl 'Try to set a invalid value to port'\n end\n\n @port = new_port\n\n self\n end", "def update\n respond_to do |format|\n if @rapport.update(rapport_params)\n format.html { redirect_to @rapport, notice: 'Rapport was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @rapport.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_update_infra_segment_port_security_profile_binding(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n data, _status_code, _headers = create_or_update_infra_segment_port_security_profile_binding_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n data\n end", "def create\n @port = Port.new(port_params)\n\n respond_to do |format|\n if @port.save\n format.html { redirect_to @port, notice: \"Port was successfully created.\" }\n format.json { render :show, status: :created, location: @port }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @port.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @dynamic_segment = args[:dynamic_segment] if args.key?(:dynamic_segment)\n @segment_id = args[:segment_id] if args.key?(:segment_id)\n end", "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "def set_port(port, value_mask)\n send_request(FUNCTION_SET_PORT, [port, value_mask], 'k C', 0, '')\n end", "def update\n respond_to do |format|\n if @rapport.update(rapport_params)\n format.html { redirect_to @rapport, notice: 'Rapport was successfully updated.' }\n format.json { render :show, status: :ok, location: @rapport }\n else\n format.html { render :edit }\n format.json { render json: @rapport.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_rapport\n Rapport.find(params[:id] || params[:rapport_id])\n #@rapport = case id\n # when 'paris' then Rapport.last\n # else Rapport.find(id)\n #end\n end", "def patch_infra_segment_0(segment_id, segment, opts = {})\n patch_infra_segment_0_with_http_info(segment_id, segment, opts)\n nil\n end", "def update!(**args)\n @control_plane_load_balancer_port = args[:control_plane_load_balancer_port] if args.key?(:control_plane_load_balancer_port)\n end", "def update!(**args)\n @control_plane_load_balancer_port = args[:control_plane_load_balancer_port] if args.key?(:control_plane_load_balancer_port)\n end" ]
[ "0.6764421", "0.6764421", "0.66494536", "0.66494536", "0.66286886", "0.6494407", "0.6494407", "0.64019126", "0.637683", "0.60324186", "0.6015857", "0.5963122", "0.5963122", "0.59069395", "0.59069395", "0.5843229", "0.5784217", "0.57292145", "0.5715677", "0.57020575", "0.56916547", "0.5689951", "0.5670304", "0.5657725", "0.5590594", "0.5583376", "0.55804557", "0.5490624", "0.54805577", "0.5468828", "0.5435568", "0.5435568", "0.5404689", "0.5404689", "0.54042166", "0.5392198", "0.5385809", "0.5372324", "0.5313599", "0.52811915", "0.5279494", "0.52674556", "0.52534306", "0.52492857", "0.52072203", "0.51943976", "0.5159358", "0.5138715", "0.5102378", "0.5102378", "0.50664955", "0.5048159", "0.50351596", "0.5033179", "0.50326777", "0.50296277", "0.50241476", "0.50241476", "0.502072", "0.5017875", "0.50022274", "0.4965988", "0.49450073", "0.49391168", "0.49348408", "0.49276885", "0.49276885", "0.4927189", "0.49124599", "0.4910943", "0.48887855", "0.4887748", "0.48576102", "0.48540887", "0.48461226", "0.48424786", "0.4839372", "0.48332942", "0.48185658", "0.47961715", "0.47892618", "0.4784895", "0.47686964", "0.47638395", "0.47584593", "0.4748431", "0.4745274", "0.47448093", "0.47407857", "0.4735409", "0.47342336", "0.4734188", "0.47214717", "0.47138244", "0.4711983", "0.4707663", "0.4707526", "0.47056106", "0.46991342", "0.46991342" ]
0.65411717
5
Patch an infra segment port Create an infra segment port if it does not exist based on the IDs, or update existing port information by replacing the port object fields which presents in the request body.
def patch_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_segment_port_0 ...' end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_segment_port_0" end # verify the required parameter 'port_id' is set if @api_client.config.client_side_validation && port_id.nil? fail ArgumentError, "Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_segment_port_0" end # verify the required parameter 'segment_port' is set if @api_client.config.client_side_validation && segment_port.nil? fail ArgumentError, "Missing the required parameter 'segment_port' when calling PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_segment_port_0" end # resource path local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_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(segment_port) 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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port_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 patch_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_0(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def create_or_replace_infra_segment_port_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_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_infra_segment_port_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_port(port, fixed_ips) \n data = { 'port' => { 'fixed_ips' => fixed_ips } }\n return put_request(address(\"ports/\"+port), data, @token)\n end", "def create_or_replace_infra_segment_port_0_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_port(portName, attributes)\n @data['ports'].each do |port|\n next unless port['name'] == portName\n attributes.each { |key, value| port[key.to_s] = value }\n response = @client.rest_put(@data['uri'] + '/ports', 'body' => port)\n @client.response_handler(response)\n end\n end", "def update\n respond_to do |format|\n if @port.update(port_params)\n format.html { redirect_to @port, notice: \"Port was successfully updated.\" }\n format.json { render :show, status: :ok, location: @port }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @port.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n data\n end", "def create_or_replace_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n data\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def update\n respond_to do |format|\n if @dev_port.update(dev_port_params)\n format.html { redirect_to @dev_port, notice: 'Dev port was successfully updated.' }\n format.json { render :show, status: :ok, location: @dev_port }\n else\n format.html { render :edit }\n format.json { render json: @dev_port.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_infra_segment_port_0(segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts)\n data\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 patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_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 patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n respond_to do |format|\n if @port_service.update(port_service_params)\n format.html { redirect_to @port_service, notice: 'Port service was successfully updated.' }\n format.json { render :show, status: :ok, location: @port_service }\n else\n format.html { render :edit }\n format.json { render json: @port_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_port_service\n @port_service = PortService.find(params[:id])\n end", "def update\n\n respond_to do |format|\n if @port.update(port_params)\n SetPortRateLimitJob.perform_later(@port)\n format.html { redirect_to @port.portable, notice: \"Port was successfully updated.\" }\n format.json { render :show, status: :ok, location: @port }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @port.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 set_dev_port\n @dev_port = DevPort.find(params[:id])\n end", "def set_devport_fiber_id\n #binding.pry\n #get the devport assigned\n dvprt = Devport.find_by_id(porta) #cannot be nill...user chose already a valid port\n \n #june-25 adjustments:\n dvprt.fiber_out_id = id #(porta)\n dvprt.save\n dvprt = Devport.find_by_id(portb)\n dvprt.fiber_in_id = id #(portb)\n dvprt.save\n \n #this is commented-out by adjustment in June-25. Porta->fiber_out, Portb->fiber_in\n #if dvprt.fiber_in_id == 0\n # dvprt.fiber_in_id = id\n #elsif dvprt.fiber_out_id == 0\n # dvprt.fiber_out_id = id\n #else\n # dvprt.fiber_in_id = id #overwrite it then\n #end\n \n #save that one devport\n dvprt.save\n \n #now do the same for portb...\n #dvprt = Devport.find_by_id(portb) #cannot be nill...use chose already a valid port\n #if dvprt.fiber_in_id == 0\n # dvprt.fiber_in_id = id\n #elsif dvprt.fiber_out_id == 0\n # dvprt.fiber_out_id = id\n #else\n # dvprt.fiber_in_id = id #overwrite it then\n #end\n \n #save that one too...\n #dvprt.save\n\n \n end", "def update!(**args)\n @container_port = args[:container_port] if args.key?(:container_port)\n end", "def port=(new_port=\"\")\n (raise CloudLB::Exception::MissingArgument, \"Must provide a new port\") if new_port.to_s.empty?\n (raise CloudLB::Exception::Syntax, \"Port must be numeric\") unless new_port.to_s =~ /^\\d+$/\n body = {\"port\" => new_port.to_s}\n update(body)\n end", "def delete_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_infra_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.delete_infra_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.delete_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_infra_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.delete_infra_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.delete_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_security_profile_binding_0_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#patch_infra_segment_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def delete_infra_segment_port_0_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_infra_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_infra_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_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update!(**args)\n @ingress_port = args[:ingress_port] if args.key?(:ingress_port)\n @psc_uri = args[:psc_uri] if args.key?(:psc_uri)\n end", "def update\n respond_to do |format|\n if @port_of_call.update(port_of_call_params)\n format.html { redirect_to @port_of_call, notice: 'Port of call was successfully updated.' }\n format.json { render :show, status: :ok, location: @port_of_call }\n else\n format.html { render :edit }\n format.json { render json: @port_of_call.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch_infra_segment_port_security_profile_binding_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding ...'\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_infra_segment_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#patch_infra_segment_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n respond_to do |format|\n if @simple_portin.update(simple_portin_params)\n format.html { redirect_to @simple_portin, notice: 'Simple portin was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @simple_portin.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @port_model.update(port_model_params)\n format.html { redirect_to @port_model, notice: 'Port model was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @port_model.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_port_of_call\n @port_of_call = PortOfCall.find(params[:id])\n end", "def create_or_update_infra_segment_port_security_profile_binding_0_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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 => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_infra_segment_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_update_infra_segment_port_security_profile_binding_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding ...'\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_infra_segment_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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 => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_infra_segment_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_security_profile_binding(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n patch_infra_segment_port_security_profile_binding_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n nil\n end", "def port_service_params\n params.require(:port_service).permit(:port_id, :service_id)\n end", "def update_device_switch_port(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'serial' => options['serial'],\r\n 'number' => options['number']\r\n )\r\n # Prepare query url.\r\n _path_url = '/devices/{serial}/switchPorts/{number}'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'serial' => options['serial'],\r\n 'number' => options['number']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json',\r\n 'content-type' => 'application/json; charset=utf-8'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.put(\r\n _query_url,\r\n headers: _headers,\r\n parameters: options['update_device_switch_port'].to_json\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end", "def patch_infra_segment(segment_id, segment, opts = {})\n patch_infra_segment_with_http_info(segment_id, segment, opts)\n nil\n end", "def patch_infra_segment(segment_id, segment, opts = {})\n patch_infra_segment_with_http_info(segment_id, segment, opts)\n nil\n end", "def dev_port_params\n params.require(:dev_port).permit(:name, :portno, :type, :RackID, :odfid, :fiberid)\n end", "def patch_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#patch_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_dpg(dpg, vlan_id, num_ports)\n spec = RbVmomi::VIM::DVPortgroupConfigSpec.new\n\n changed = false\n\n orig_spec = RbVmomi::VIM::DVPortgroupConfigSpec.new\n orig_spec.numPorts = dpg['config.numPorts']\n orig_spec.defaultPortConfig = RbVmomi::VIM::VMwareDVSPortSetting.new\n orig_spec.defaultPortConfig.vlan = RbVmomi::VIM::VmwareDistributedVirtualSwitchVlanIdSpec.new\n orig_spec.defaultPortConfig.vlan.vlanId = dpg['config.defaultPortConfig.vlan.vlanId']\n orig_spec.defaultPortConfig.vlan.inherited = false\n\n if num_ports && num_ports != orig_spec.numPorts\n spec.numPorts = num_ports\n changed = true\n end\n\n # earlyBinding. A free DistributedVirtualPort will be selected and\n # assigned to a VirtualMachine when the virtual machine is reconfigured\n # to connect to the portgroup.\n spec.type = \"earlyBinding\"\n\n if vlan_id != orig_spec.defaultPortConfig.vlan.vlanId\n spec.defaultPortConfig = RbVmomi::VIM::VMwareDVSPortSetting.new\n spec.defaultPortConfig.vlan = RbVmomi::VIM::VmwareDistributedVirtualSwitchVlanIdSpec.new\n spec.defaultPortConfig.vlan.vlanId = vlan_id\n spec.defaultPortConfig.vlan.inherited = false\n changed = true\n end\n\n if changed\n\n spec.configVersion = dpg['config.configVersion']\n\n begin\n dpg.item.ReconfigureDVPortgroup_Task(:spec => spec).wait_for_completion\n rescue Exception => e\n raise \"The Distributed port group #{dpg['name']} could not be created. \"\\\n \"Reason: #{e.message}\"\n end\n\n @net_rollback << {:action => :update_dpg, :dpg => dpg.item, :name => dpg['name'], :spec => orig_spec}\n end\n\n end", "def patch_infra_segment_port_security_profile_binding_0(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n patch_infra_segment_port_security_profile_binding_0_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n nil\n end", "def move_port_to_subnets(port_id, subnet_ids)\n id_list = Array.new()\n subnet_ids.each do |id|\n id_list << { \"subnet_id\" => id }\n end\n return update_port(port_id, id_list)\n end", "def update\n respond_to do |format|\n if @switch_port.update(switch_port_params)\n format.html { redirect_to @switch_port, notice: 'Switch port was successfully updated.' }\n format.json { render :show, status: :ok, location: @switch_port }\n else\n format.html { render :edit }\n format.json { render json: @switch_port.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def create_or_replace_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def patch_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#patch_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n @porter = Porter.find(params[:id])\n\n respond_to do |format|\n if @porter.update_attributes(params[:porter])\n format.html { redirect_to @porter, notice: 'Porter was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @porter.errors, status: :unprocessable_entity }\n end\n end\n end", "def port=(val)\n @j_del.setPort(val)\n self\n end", "def set_port_model\n @port_model = PortModel.find(params[:id])\n end", "def port=(new_port)\n return if new_port == port\n reset!\n @desired_port = new_port\n start!\n end", "def patch_port_security_profile_binding(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n patch_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n nil\n end", "def create_or_update_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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 => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_update_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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 => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n respond_to do |format|\n if @port_panel.update(port_panel_params)\n format.html { redirect_to @port_panel, notice: 'Port panel was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @port_panel.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def get_infra_segment_port_0_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_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_infra_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_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_simple_portin\n @simple_portin = SimplePortin.find(params[:id])\n end", "def delete_infra_segment_port_security_profile_binding_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding ...'\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#delete_infra_segment_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def portgroup=(value)\n new_backing = RbVmomi::VIM.VirtualEthernetCardNetworkBackingInfo(\n :deviceName => value\n )\n vnic_new = vnic\n vnic_new.backing = new_backing\n spec = RbVmomi::VIM.VirtualMachineConfigSpec({\n :deviceChange => [{\n :operation => :edit,\n :device => vnic_new\n }]\n })\n vm.ReconfigVM_Task(:spec => spec).wait_for_completion\n end", "def update\n port_params = portfolio_params\n allocation_ids = Set.new()\n if port_params[:allocations_attributes].present?\n port_params[:allocations_attributes].each do |allocation|\n if allocation[:id].present?\n allocation_ids << allocation[:id].to_i\n allocation.delete(:asset_class_id)\n end\n # delete any allocations with weight of 0\n if allocation[:weight] == BigDecimal.new(\"0.0\")\n allocation[:_delete] = true\n end\n end\n @portfolio.allocations.each do |allocation|\n # If an allocation isn't in allocations_attributes, add it there and mark\n # it for deletion.\n unless allocation_ids.include?(allocation.id)\n port_params[:allocations_attributes] << {id: allocation.id, _delete: true}\n end\n end\n end\n # TODO: what about if the ID isn't included but the asset class already has\n # an allocation on this portfolio?\n if @portfolio.update(port_params)\n head :no_content\n else\n render json: @portfolio.errors, status: :unprocessable_entity\n end\n end", "def delete_infra_segment_port_security_profile_binding_0_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_infra_segment_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#delete_infra_segment_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_port_security_profile_binding_0(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n patch_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n nil\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n if params[:switch_id] && @switch = Switch.find_by_id(params[:switch_id])\n @port = @switch.ports.new(port_params)\n end\n\n if params[:slot_id] && @slot = Slot.find_by_id(params[:slot_id])\n @port = @slot.ports.new(port_params)\n end\n\n respond_to do |format|\n if @port.save\n format.html { redirect_to @port, notice: \"Port was successfully created.\" }\n format.json { render :show, status: :created, location: @port }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @port.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!(**args)\n @control_plane_node_port = args[:control_plane_node_port] if args.key?(:control_plane_node_port)\n @ingress_http_node_port = args[:ingress_http_node_port] if args.key?(:ingress_http_node_port)\n @ingress_https_node_port = args[:ingress_https_node_port] if args.key?(:ingress_https_node_port)\n @konnectivity_server_node_port = args[:konnectivity_server_node_port] if args.key?(:konnectivity_server_node_port)\n end", "def delete_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#delete_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#delete_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @dev_port = DevPort.new(dev_port_params)\n\n respond_to do |format|\n if @dev_port.save\n format.html { redirect_to @dev_port, notice: 'Dev port was successfully created.' }\n format.json { render :show, status: :created, location: @dev_port }\n else\n format.html { render :new }\n format.json { render json: @dev_port.errors, status: :unprocessable_entity }\n end\n end\n end", "def reset_port_protection\n response = @client.rest_put(@data['uri'] + '/resetportprotection')\n @client.response_handler(response)\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 patch(path, to: nil, as: nil, **constraints, &blk)\n add_route(::Rack::PATCH, path, to, as, constraints, &blk)\n end", "def port(new_port)\n unless port_valid? new_port\n raise Urb::InvalidUrl 'Try to set a invalid value to port'\n end\n\n @port = new_port\n\n self\n end", "def create_or_update_infra_segment_port_security_profile_binding(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n data, _status_code, _headers = create_or_update_infra_segment_port_security_profile_binding_with_http_info(segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n data\n end", "def create\n @port = Port.new(port_params)\n\n respond_to do |format|\n if @port.save\n format.html { redirect_to @port, notice: \"Port was successfully created.\" }\n format.json { render :show, status: :created, location: @port }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @port.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @rapport.update(rapport_params)\n format.html { redirect_to @rapport, notice: 'Rapport was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @rapport.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @dynamic_segment = args[:dynamic_segment] if args.key?(:dynamic_segment)\n @segment_id = args[:segment_id] if args.key?(:segment_id)\n end", "def set_port(port, value_mask)\n send_request(FUNCTION_SET_PORT, [port, value_mask], 'k C', 0, '')\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 @rapport.update(rapport_params)\n format.html { redirect_to @rapport, notice: 'Rapport was successfully updated.' }\n format.json { render :show, status: :ok, location: @rapport }\n else\n format.html { render :edit }\n format.json { render json: @rapport.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_rapport\n Rapport.find(params[:id] || params[:rapport_id])\n #@rapport = case id\n # when 'paris' then Rapport.last\n # else Rapport.find(id)\n #end\n end", "def patch_infra_segment_0(segment_id, segment, opts = {})\n patch_infra_segment_0_with_http_info(segment_id, segment, opts)\n nil\n end", "def update!(**args)\n @control_plane_load_balancer_port = args[:control_plane_load_balancer_port] if args.key?(:control_plane_load_balancer_port)\n end", "def update!(**args)\n @control_plane_load_balancer_port = args[:control_plane_load_balancer_port] if args.key?(:control_plane_load_balancer_port)\n end" ]
[ "0.6763732", "0.6763732", "0.66494226", "0.66494226", "0.6541392", "0.64953655", "0.64953655", "0.6400876", "0.63778764", "0.6032902", "0.6015575", "0.59633845", "0.59633845", "0.5906623", "0.5906623", "0.5843207", "0.57849133", "0.5729158", "0.5714489", "0.57009923", "0.5691581", "0.56887573", "0.56697917", "0.56575364", "0.55904764", "0.5583383", "0.55805093", "0.5491734", "0.5480681", "0.5467404", "0.54360944", "0.54360944", "0.5405972", "0.54031587", "0.54031587", "0.5391197", "0.5386587", "0.5372357", "0.5313525", "0.5282787", "0.5280053", "0.526729", "0.5253625", "0.52519906", "0.52098256", "0.51950264", "0.5160357", "0.51393294", "0.51021445", "0.51021445", "0.5068215", "0.50489175", "0.5035104", "0.50344354", "0.5032146", "0.5030336", "0.50239754", "0.50239754", "0.50216514", "0.501664", "0.50018", "0.49661592", "0.49443626", "0.49389064", "0.49367425", "0.492927", "0.49277174", "0.49277174", "0.49136505", "0.49110103", "0.4889001", "0.48888156", "0.48595852", "0.48536488", "0.48456258", "0.48421293", "0.48414966", "0.4833657", "0.48181897", "0.47981262", "0.47872463", "0.47852927", "0.47701222", "0.47650728", "0.47595966", "0.47492766", "0.4744564", "0.4743255", "0.47406864", "0.47358838", "0.47347668", "0.4734423", "0.47239637", "0.4711455", "0.4710903", "0.47066855", "0.47064754", "0.4706333", "0.46991104", "0.46991104" ]
0.6628931
4
Patch a Tier1 segment port Create a Tier1 segment port if it does not exist based on the IDs, or update existing port information by replacing the port object fields which presents in the request body.
def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {}) patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\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 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_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 delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\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(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def create_or_replace_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\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_or_replace_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\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 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 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 patch_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#patch_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#patch_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def update_port(portName, attributes)\n @data['ports'].each do |port|\n next unless port['name'] == portName\n attributes.each { |key, value| port[key.to_s] = value }\n response = @client.rest_put(@data['uri'] + '/ports', 'body' => port)\n @client.response_handler(response)\n end\n end", "def patch_tier1(tier_1_id, tier1, opts = {})\n patch_tier1_with_http_info(tier_1_id, tier1, opts)\n nil\n end", "def update_port(port, fixed_ips) \n data = { 'port' => { 'fixed_ips' => fixed_ips } }\n return put_request(address(\"ports/\"+port), data, @token)\n end", "def list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports\"\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.list_tier1_segment_ports\"\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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_port_security_profile_binding_0(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n patch_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n nil\n end", "def patch_tier1_0(tier_1_id, tier1, opts = {})\n patch_tier1_0_with_http_info(tier_1_id, tier1, opts)\n nil\n end", "def create_or_update_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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 => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_port_security_profile_binding(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n patch_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n nil\n end", "def update\n respond_to do |format|\n if @port.update(port_params)\n format.html { redirect_to @port, notice: \"Port was successfully updated.\" }\n format.json { render :show, status: :ok, location: @port }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @port.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch_infra_segment_port_0(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts)\n nil\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_or_replace_infra_segment_port_0_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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_infra_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_update_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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 => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports_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.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_infra_segment_port_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_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_infra_segment_port_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_port_qo_s_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_qos_profile_binding_map_id, port_qo_s_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding_0\"\n end\n # verify the required parameter 'port_qos_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_qos_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qos_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding_0\"\n end\n # verify the required parameter 'port_qo_s_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_qo_s_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qo_s_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-qos-profile-binding-maps/{port-qos-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-qos-profile-binding-map-id' + '}', port_qos_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_qo_s_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi#patch_port_qo_s_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\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 delete_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#delete_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_port_service\n @port_service = PortService.find(params[:id])\n end", "def patch_port_qo_s_binding_with_http_info(tier_1_id, segment_id, port_id, port_qos_profile_binding_map_id, port_qo_s_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding\"\n end\n # verify the required parameter 'port_qos_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_qos_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qos_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding\"\n end\n # verify the required parameter 'port_qo_s_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_qo_s_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qo_s_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-qos-profile-binding-maps/{port-qos-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-qos-profile-binding-map-id' + '}', port_qos_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_qo_s_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi#patch_port_qo_s_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#delete_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_dev_port\n @dev_port = DevPort.find(params[:id])\n end", "def patch_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def update_device_switch_port(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'serial' => options['serial'],\r\n 'number' => options['number']\r\n )\r\n # Prepare query url.\r\n _path_url = '/devices/{serial}/switchPorts/{number}'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'serial' => options['serial'],\r\n 'number' => options['number']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json',\r\n 'content-type' => 'application/json; charset=utf-8'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.put(\r\n _query_url,\r\n headers: _headers,\r\n parameters: options['update_device_switch_port'].to_json\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end", "def set_devport_fiber_id\n #binding.pry\n #get the devport assigned\n dvprt = Devport.find_by_id(porta) #cannot be nill...user chose already a valid port\n \n #june-25 adjustments:\n dvprt.fiber_out_id = id #(porta)\n dvprt.save\n dvprt = Devport.find_by_id(portb)\n dvprt.fiber_in_id = id #(portb)\n dvprt.save\n \n #this is commented-out by adjustment in June-25. Porta->fiber_out, Portb->fiber_in\n #if dvprt.fiber_in_id == 0\n # dvprt.fiber_in_id = id\n #elsif dvprt.fiber_out_id == 0\n # dvprt.fiber_out_id = id\n #else\n # dvprt.fiber_in_id = id #overwrite it then\n #end\n \n #save that one devport\n dvprt.save\n \n #now do the same for portb...\n #dvprt = Devport.find_by_id(portb) #cannot be nill...use chose already a valid port\n #if dvprt.fiber_in_id == 0\n # dvprt.fiber_in_id = id\n #elsif dvprt.fiber_out_id == 0\n # dvprt.fiber_out_id = id\n #else\n # dvprt.fiber_in_id = id #overwrite it then\n #end\n \n #save that one too...\n #dvprt.save\n\n \n end", "def update\n @porter = Porter.find(params[:id])\n\n respond_to do |format|\n if @porter.update_attributes(params[:porter])\n format.html { redirect_to @porter, notice: 'Porter was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @porter.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if params[:switch_id] && @switch = Switch.find_by_id(params[:switch_id])\n @port = @switch.ports.new(port_params)\n end\n\n if params[:slot_id] && @slot = Slot.find_by_id(params[:slot_id])\n @port = @slot.ports.new(port_params)\n end\n\n respond_to do |format|\n if @port.save\n format.html { redirect_to @port, notice: \"Port was successfully created.\" }\n format.json { render :show, status: :created, location: @port }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @port.errors, status: :unprocessable_entity }\n end\n end\n end", "def list_tier1_segment_ports(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def update_port_qo_s_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_qos_profile_binding_map_id, port_qo_s_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding_0\"\n end\n # verify the required parameter 'port_qos_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_qos_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qos_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding_0\"\n end\n # verify the required parameter 'port_qo_s_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_qo_s_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qo_s_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-qos-profile-binding-maps/{port-qos-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-qos-profile-binding-map-id' + '}', port_qos_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_qo_s_profile_binding_map)\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 => 'PortQoSProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi#update_port_qo_s_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_port_of_call\n @port_of_call = PortOfCall.find(params[:id])\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 dev_port_params\n params.require(:dev_port).permit(:name, :portno, :type, :RackID, :odfid, :fiberid)\n end", "def set_porter\n @porter = Porter.find(params[:id])\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 update\n respond_to do |format|\n if @dev_port.update(dev_port_params)\n format.html { redirect_to @dev_port, notice: 'Dev port was successfully updated.' }\n format.json { render :show, status: :ok, location: @dev_port }\n else\n format.html { render :edit }\n format.json { render json: @dev_port.errors, status: :unprocessable_entity }\n end\n end\n 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 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\n respond_to do |format|\n if @port.update(port_params)\n SetPortRateLimitJob.perform_later(@port)\n format.html { redirect_to @port.portable, notice: \"Port was successfully updated.\" }\n format.json { render :show, status: :ok, location: @port }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @port.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_port_qo_s_binding_with_http_info(tier_1_id, segment_id, port_id, port_qos_profile_binding_map_id, port_qo_s_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding\"\n end\n # verify the required parameter 'port_qos_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_qos_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qos_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding\"\n end\n # verify the required parameter 'port_qo_s_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_qo_s_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qo_s_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-qos-profile-binding-maps/{port-qos-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-qos-profile-binding-map-id' + '}', port_qos_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_qo_s_profile_binding_map)\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 => 'PortQoSProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi#update_port_qo_s_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def port=(new_port)\n return if new_port == port\n reset!\n @desired_port = new_port\n start!\n end", "def delete_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def get_tier1_segment_port_mac_table_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table, 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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table\\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 update\n respond_to do |format|\n if @simple_portin.update(simple_portin_params)\n format.html { redirect_to @simple_portin, notice: 'Simple portin was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @simple_portin.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_simple_portin\n @simple_portin = SimplePortin.find(params[:id])\n end", "def port=(new_port=\"\")\n (raise CloudLB::Exception::MissingArgument, \"Must provide a new port\") if new_port.to_s.empty?\n (raise CloudLB::Exception::Syntax, \"Port must be numeric\") unless new_port.to_s =~ /^\\d+$/\n body = {\"port\" => new_port.to_s}\n update(body)\n end", "def set_port_model\n @port_model = PortModel.find(params[:id])\n end", "def get_tier1_segment_port_mac_table_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_0, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def delete_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\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 update\n respond_to do |format|\n if @port_service.update(port_service_params)\n format.html { redirect_to @port_service, notice: 'Port service was successfully updated.' }\n format.json { render :show, status: :ok, location: @port_service }\n else\n format.html { render :edit }\n format.json { render json: @port_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def port=(val)\n @j_del.setPort(val)\n self\n end", "def get_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def port_params\n params.require(:port).permit(:port_number, :name, :description, :up_rate, :down_rate, :rate_unit, :subscriber_id)\n end", "def update\n respond_to do |format|\n if @port_of_call.update(port_of_call_params)\n format.html { redirect_to @port_of_call, notice: 'Port of call was successfully updated.' }\n format.json { render :show, status: :ok, location: @port_of_call }\n else\n format.html { render :edit }\n format.json { render json: @port_of_call.errors, status: :unprocessable_entity }\n end\n end\n end", "def port_service_params\n params.require(:port_service).permit(:port_id, :service_id)\n end", "def get_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#get_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_segment_ports_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def delete_port_qo_s_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_qos_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.delete_port_qo_s_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.delete_port_qo_s_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.delete_port_qo_s_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.delete_port_qo_s_binding_0\"\n end\n # verify the required parameter 'port_qos_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_qos_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qos_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.delete_port_qo_s_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-qos-profile-binding-maps/{port-qos-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-qos-profile-binding-map-id' + '}', port_qos_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi#delete_port_qo_s_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_update_segment_security_profile_binding_0_with_http_info(tier_1_id, segment_id, segment_security_profile_binding_map_id, segment_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/segment-security-profile-binding-maps/{segment-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'segment-security-profile-binding-map-id' + '}', segment_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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_security_profile_binding_map)\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 => 'SegmentSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_segment_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#patch_tier1_interface\\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 patch_segment_dhcp_static_binding_0_with_http_info(tier_1_id, segment_id, binding_id, dhcp_static_binding_config, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDHCPDHCPStaticBindingsSegmentsBindingsFixedApi.patch_segment_dhcp_static_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDHCPDHCPStaticBindingsSegmentsBindingsFixedApi.patch_segment_dhcp_static_binding_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 PolicyNetworkingIPManagementDHCPDHCPStaticBindingsSegmentsBindingsFixedApi.patch_segment_dhcp_static_binding_0\"\n end\n # verify the required parameter 'binding_id' is set\n if @api_client.config.client_side_validation && binding_id.nil?\n fail ArgumentError, \"Missing the required parameter 'binding_id' when calling PolicyNetworkingIPManagementDHCPDHCPStaticBindingsSegmentsBindingsFixedApi.patch_segment_dhcp_static_binding_0\"\n end\n # verify the required parameter 'dhcp_static_binding_config' is set\n if @api_client.config.client_side_validation && dhcp_static_binding_config.nil?\n fail ArgumentError, \"Missing the required parameter 'dhcp_static_binding_config' when calling PolicyNetworkingIPManagementDHCPDHCPStaticBindingsSegmentsBindingsFixedApi.patch_segment_dhcp_static_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/dhcp-static-binding-configs/{binding-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'binding-id' + '}', binding_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(dhcp_static_binding_config)\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: PolicyNetworkingIPManagementDHCPDHCPStaticBindingsSegmentsBindingsFixedApi#patch_segment_dhcp_static_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def assignPorts (ixNet, realPort1, realPort2)\r\n chassis1 = realPort1[0]\r\n chassis2 = realPort2[0]\r\n card1 = realPort1[1]\r\n card2 = realPort2[1]\r\n port1 = realPort1[2]\r\n port2 = realPort2[2]\r\n\r\n root = @ixNet.getRoot()\r\n vport1 = @ixNet.add(root, 'vport')\r\n @ixNet.commit()\r\n vport1 = @ixNet.remapIds(vport1)[0]\r\n\r\n vport2 = @ixNet.add(root, 'vport')\r\n @ixNet.commit()\r\n vport2 = @ixNet.remapIds(vport2)[0]\r\n\r\n chassisObj1 = @ixNet.add(root + '/availableHardware', 'chassis')\r\n @ixNet.setAttribute(chassisObj1, '-hostname', chassis1)\r\n @ixNet.commit()\r\n chassisObj1 = @ixNet.remapIds(chassisObj1)[0]\r\n\r\n if (chassis1 != chassis2) then\r\n chassisObj2 = @ixNet.add(root + '/availableHardware', 'chassis')\r\n @ixNet.setAttribute(chassisObj2, '-hostname', chassis2)\r\n @ixNet.commit()\r\n chassisObj2 = @ixNet.remapIds(chassisObj2)[0]\r\n else\r\n chassisObj2 = chassisObj1\r\n end\r\n\r\n cardPortRef1 = chassisObj1 + '/card:'+card1+'/port:'+port1\r\n @ixNet.setMultiAttribute(vport1, '-connectedTo', cardPortRef1,\r\n '-rxMode', 'captureAndMeasure', '-name', 'Ethernet - 001')\r\n @ixNet.commit()\r\n\r\n cardPortRef2 = chassisObj2 + '/card:'+card2+'/port:'+port2\r\n @ixNet.setMultiAttribute(vport2, '-connectedTo', cardPortRef2,\r\n '-rxMode', 'captureAndMeasure', '-name', 'Ethernet - 002')\r\n @ixNet.commit()\r\nend", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#patch_tier1_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update!(**args)\n @ingress_port = args[:ingress_port] if args.key?(:ingress_port)\n @psc_uri = args[:psc_uri] if args.key?(:psc_uri)\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#patch_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_port_security_profile_bindings_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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings, 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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].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 => 'PortSecurityProfileBindingMapListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#list_port_security_profile_bindings\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#get_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_update_segment_security_profile_binding_with_http_info(tier_1_id, segment_id, segment_security_profile_binding_map_id, segment_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/segment-security-profile-binding-maps/{segment-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'segment-security-profile-binding-map-id' + '}', segment_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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_security_profile_binding_map)\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 => 'SegmentSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_segment_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_panier\n @panier = Panier.find(params[:id])\n end" ]
[ "0.7169536", "0.7166977", "0.71280086", "0.69106746", "0.68360215", "0.68137985", "0.67047143", "0.6367438", "0.63607687", "0.6309049", "0.6309049", "0.6254311", "0.6152272", "0.57754004", "0.57699335", "0.5726195", "0.5702035", "0.5686311", "0.5637342", "0.5602462", "0.5602462", "0.55934244", "0.55934244", "0.55901617", "0.5512739", "0.54697496", "0.54294926", "0.5385589", "0.5370642", "0.5356448", "0.5339005", "0.53133", "0.5307623", "0.53014094", "0.5293904", "0.52888983", "0.5274147", "0.5261385", "0.5261385", "0.5251439", "0.5246723", "0.52307", "0.51837254", "0.5182573", "0.51520264", "0.5137386", "0.51220244", "0.51220244", "0.50699925", "0.5018386", "0.5011271", "0.49991608", "0.4989486", "0.49637198", "0.49568805", "0.4956399", "0.4951481", "0.4941374", "0.4917324", "0.49160463", "0.49132946", "0.4866946", "0.48659715", "0.4856284", "0.48559654", "0.48502302", "0.48453382", "0.48339617", "0.4832743", "0.4806021", "0.48013037", "0.4786348", "0.47733694", "0.47702032", "0.47702032", "0.47478747", "0.4745958", "0.47284505", "0.47204718", "0.47107628", "0.47107628", "0.47096708", "0.46943966", "0.46942216", "0.4690352", "0.4671882", "0.4651016", "0.4649661", "0.4634074", "0.46293783", "0.46163356", "0.46148738", "0.46110612", "0.46083146", "0.46065035", "0.45987442", "0.4595411", "0.45953935", "0.45953044" ]
0.69880193
4
Patch a Tier1 segment port Create a Tier1 segment port if it does not exist based on the IDs, or update existing port information by replacing the port object fields which presents in the request body.
def patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_tier1_segment_port ...' 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 PolicyNetworkingConnectivitySegmentsPortsApi.patch_tier1_segment_port" end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.patch_tier1_segment_port" end # verify the required parameter 'port_id' is set if @api_client.config.client_side_validation && port_id.nil? fail ArgumentError, "Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.patch_tier1_segment_port" end # verify the required parameter 'segment_port' is set if @api_client.config.client_side_validation && segment_port.nil? fail ArgumentError, "Missing the required parameter 'segment_port' when calling PolicyNetworkingConnectivitySegmentsPortsApi.patch_tier1_segment_port" end # resource path 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) # 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(segment_port) 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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\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 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_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 delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\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(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def create_or_replace_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\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_or_replace_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\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 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 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 patch_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#patch_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#patch_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def update_port(portName, attributes)\n @data['ports'].each do |port|\n next unless port['name'] == portName\n attributes.each { |key, value| port[key.to_s] = value }\n response = @client.rest_put(@data['uri'] + '/ports', 'body' => port)\n @client.response_handler(response)\n end\n end", "def patch_tier1(tier_1_id, tier1, opts = {})\n patch_tier1_with_http_info(tier_1_id, tier1, opts)\n nil\n end", "def update_port(port, fixed_ips) \n data = { 'port' => { 'fixed_ips' => fixed_ips } }\n return put_request(address(\"ports/\"+port), data, @token)\n end", "def list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports\"\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.list_tier1_segment_ports\"\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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_port_security_profile_binding_0(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n patch_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n nil\n end", "def patch_tier1_0(tier_1_id, tier1, opts = {})\n patch_tier1_0_with_http_info(tier_1_id, tier1, opts)\n nil\n end", "def create_or_update_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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 => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_port_security_profile_binding(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n patch_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n nil\n end", "def update\n respond_to do |format|\n if @port.update(port_params)\n format.html { redirect_to @port, notice: \"Port was successfully updated.\" }\n format.json { render :show, status: :ok, location: @port }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @port.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch_infra_segment_port_0(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts)\n nil\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_or_replace_infra_segment_port_0_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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_infra_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_update_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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 => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports_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.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_infra_segment_port_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_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_infra_segment_port_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_port_qo_s_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_qos_profile_binding_map_id, port_qo_s_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding_0\"\n end\n # verify the required parameter 'port_qos_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_qos_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qos_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding_0\"\n end\n # verify the required parameter 'port_qo_s_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_qo_s_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qo_s_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-qos-profile-binding-maps/{port-qos-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-qos-profile-binding-map-id' + '}', port_qos_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_qo_s_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi#patch_port_qo_s_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\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 delete_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#delete_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_port_service\n @port_service = PortService.find(params[:id])\n end", "def patch_port_qo_s_binding_with_http_info(tier_1_id, segment_id, port_id, port_qos_profile_binding_map_id, port_qo_s_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding\"\n end\n # verify the required parameter 'port_qos_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_qos_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qos_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding\"\n end\n # verify the required parameter 'port_qo_s_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_qo_s_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qo_s_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-qos-profile-binding-maps/{port-qos-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-qos-profile-binding-map-id' + '}', port_qos_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_qo_s_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi#patch_port_qo_s_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#delete_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_dev_port\n @dev_port = DevPort.find(params[:id])\n end", "def patch_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def update_device_switch_port(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'serial' => options['serial'],\r\n 'number' => options['number']\r\n )\r\n # Prepare query url.\r\n _path_url = '/devices/{serial}/switchPorts/{number}'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'serial' => options['serial'],\r\n 'number' => options['number']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json',\r\n 'content-type' => 'application/json; charset=utf-8'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.put(\r\n _query_url,\r\n headers: _headers,\r\n parameters: options['update_device_switch_port'].to_json\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end", "def set_devport_fiber_id\n #binding.pry\n #get the devport assigned\n dvprt = Devport.find_by_id(porta) #cannot be nill...user chose already a valid port\n \n #june-25 adjustments:\n dvprt.fiber_out_id = id #(porta)\n dvprt.save\n dvprt = Devport.find_by_id(portb)\n dvprt.fiber_in_id = id #(portb)\n dvprt.save\n \n #this is commented-out by adjustment in June-25. Porta->fiber_out, Portb->fiber_in\n #if dvprt.fiber_in_id == 0\n # dvprt.fiber_in_id = id\n #elsif dvprt.fiber_out_id == 0\n # dvprt.fiber_out_id = id\n #else\n # dvprt.fiber_in_id = id #overwrite it then\n #end\n \n #save that one devport\n dvprt.save\n \n #now do the same for portb...\n #dvprt = Devport.find_by_id(portb) #cannot be nill...use chose already a valid port\n #if dvprt.fiber_in_id == 0\n # dvprt.fiber_in_id = id\n #elsif dvprt.fiber_out_id == 0\n # dvprt.fiber_out_id = id\n #else\n # dvprt.fiber_in_id = id #overwrite it then\n #end\n \n #save that one too...\n #dvprt.save\n\n \n end", "def update\n @porter = Porter.find(params[:id])\n\n respond_to do |format|\n if @porter.update_attributes(params[:porter])\n format.html { redirect_to @porter, notice: 'Porter was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @porter.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if params[:switch_id] && @switch = Switch.find_by_id(params[:switch_id])\n @port = @switch.ports.new(port_params)\n end\n\n if params[:slot_id] && @slot = Slot.find_by_id(params[:slot_id])\n @port = @slot.ports.new(port_params)\n end\n\n respond_to do |format|\n if @port.save\n format.html { redirect_to @port, notice: \"Port was successfully created.\" }\n format.json { render :show, status: :created, location: @port }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @port.errors, status: :unprocessable_entity }\n end\n end\n end", "def list_tier1_segment_ports(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def update_port_qo_s_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_qos_profile_binding_map_id, port_qo_s_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding_0\"\n end\n # verify the required parameter 'port_qos_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_qos_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qos_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding_0\"\n end\n # verify the required parameter 'port_qo_s_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_qo_s_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qo_s_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-qos-profile-binding-maps/{port-qos-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-qos-profile-binding-map-id' + '}', port_qos_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_qo_s_profile_binding_map)\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 => 'PortQoSProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi#update_port_qo_s_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_port_of_call\n @port_of_call = PortOfCall.find(params[:id])\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 dev_port_params\n params.require(:dev_port).permit(:name, :portno, :type, :RackID, :odfid, :fiberid)\n end", "def set_porter\n @porter = Porter.find(params[:id])\n end", "def update\n respond_to do |format|\n if @dev_port.update(dev_port_params)\n format.html { redirect_to @dev_port, notice: 'Dev port was successfully updated.' }\n format.json { render :show, status: :ok, location: @dev_port }\n else\n format.html { render :edit }\n format.json { render json: @dev_port.errors, status: :unprocessable_entity }\n end\n end\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 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 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\n respond_to do |format|\n if @port.update(port_params)\n SetPortRateLimitJob.perform_later(@port)\n format.html { redirect_to @port.portable, notice: \"Port was successfully updated.\" }\n format.json { render :show, status: :ok, location: @port }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @port.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_port_qo_s_binding_with_http_info(tier_1_id, segment_id, port_id, port_qos_profile_binding_map_id, port_qo_s_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding\"\n end\n # verify the required parameter 'port_qos_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_qos_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qos_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding\"\n end\n # verify the required parameter 'port_qo_s_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_qo_s_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qo_s_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-qos-profile-binding-maps/{port-qos-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-qos-profile-binding-map-id' + '}', port_qos_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_qo_s_profile_binding_map)\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 => 'PortQoSProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi#update_port_qo_s_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def port=(new_port)\n return if new_port == port\n reset!\n @desired_port = new_port\n start!\n end", "def delete_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def get_tier1_segment_port_mac_table_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table, 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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table\\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 update\n respond_to do |format|\n if @simple_portin.update(simple_portin_params)\n format.html { redirect_to @simple_portin, notice: 'Simple portin was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @simple_portin.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_simple_portin\n @simple_portin = SimplePortin.find(params[:id])\n end", "def port=(new_port=\"\")\n (raise CloudLB::Exception::MissingArgument, \"Must provide a new port\") if new_port.to_s.empty?\n (raise CloudLB::Exception::Syntax, \"Port must be numeric\") unless new_port.to_s =~ /^\\d+$/\n body = {\"port\" => new_port.to_s}\n update(body)\n end", "def set_port_model\n @port_model = PortModel.find(params[:id])\n end", "def get_tier1_segment_port_mac_table_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_0, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def delete_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def update\n respond_to do |format|\n if @port_service.update(port_service_params)\n format.html { redirect_to @port_service, notice: 'Port service was successfully updated.' }\n format.json { render :show, status: :ok, location: @port_service }\n else\n format.html { render :edit }\n format.json { render json: @port_service.errors, status: :unprocessable_entity }\n end\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 port=(val)\n @j_del.setPort(val)\n self\n end", "def get_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def port_params\n params.require(:port).permit(:port_number, :name, :description, :up_rate, :down_rate, :rate_unit, :subscriber_id)\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def update\n respond_to do |format|\n if @port_of_call.update(port_of_call_params)\n format.html { redirect_to @port_of_call, notice: 'Port of call was successfully updated.' }\n format.json { render :show, status: :ok, location: @port_of_call }\n else\n format.html { render :edit }\n format.json { render json: @port_of_call.errors, status: :unprocessable_entity }\n end\n end\n end", "def port_service_params\n params.require(:port_service).permit(:port_id, :service_id)\n end", "def get_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#get_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_segment_ports_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def delete_port_qo_s_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_qos_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.delete_port_qo_s_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.delete_port_qo_s_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.delete_port_qo_s_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.delete_port_qo_s_binding_0\"\n end\n # verify the required parameter 'port_qos_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_qos_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qos_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.delete_port_qo_s_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-qos-profile-binding-maps/{port-qos-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-qos-profile-binding-map-id' + '}', port_qos_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi#delete_port_qo_s_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_update_segment_security_profile_binding_0_with_http_info(tier_1_id, segment_id, segment_security_profile_binding_map_id, segment_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/segment-security-profile-binding-maps/{segment-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'segment-security-profile-binding-map-id' + '}', segment_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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_security_profile_binding_map)\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 => 'SegmentSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_segment_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#patch_tier1_interface\\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 patch_segment_dhcp_static_binding_0_with_http_info(tier_1_id, segment_id, binding_id, dhcp_static_binding_config, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDHCPDHCPStaticBindingsSegmentsBindingsFixedApi.patch_segment_dhcp_static_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDHCPDHCPStaticBindingsSegmentsBindingsFixedApi.patch_segment_dhcp_static_binding_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 PolicyNetworkingIPManagementDHCPDHCPStaticBindingsSegmentsBindingsFixedApi.patch_segment_dhcp_static_binding_0\"\n end\n # verify the required parameter 'binding_id' is set\n if @api_client.config.client_side_validation && binding_id.nil?\n fail ArgumentError, \"Missing the required parameter 'binding_id' when calling PolicyNetworkingIPManagementDHCPDHCPStaticBindingsSegmentsBindingsFixedApi.patch_segment_dhcp_static_binding_0\"\n end\n # verify the required parameter 'dhcp_static_binding_config' is set\n if @api_client.config.client_side_validation && dhcp_static_binding_config.nil?\n fail ArgumentError, \"Missing the required parameter 'dhcp_static_binding_config' when calling PolicyNetworkingIPManagementDHCPDHCPStaticBindingsSegmentsBindingsFixedApi.patch_segment_dhcp_static_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/dhcp-static-binding-configs/{binding-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'binding-id' + '}', binding_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(dhcp_static_binding_config)\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: PolicyNetworkingIPManagementDHCPDHCPStaticBindingsSegmentsBindingsFixedApi#patch_segment_dhcp_static_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def assignPorts (ixNet, realPort1, realPort2)\r\n chassis1 = realPort1[0]\r\n chassis2 = realPort2[0]\r\n card1 = realPort1[1]\r\n card2 = realPort2[1]\r\n port1 = realPort1[2]\r\n port2 = realPort2[2]\r\n\r\n root = @ixNet.getRoot()\r\n vport1 = @ixNet.add(root, 'vport')\r\n @ixNet.commit()\r\n vport1 = @ixNet.remapIds(vport1)[0]\r\n\r\n vport2 = @ixNet.add(root, 'vport')\r\n @ixNet.commit()\r\n vport2 = @ixNet.remapIds(vport2)[0]\r\n\r\n chassisObj1 = @ixNet.add(root + '/availableHardware', 'chassis')\r\n @ixNet.setAttribute(chassisObj1, '-hostname', chassis1)\r\n @ixNet.commit()\r\n chassisObj1 = @ixNet.remapIds(chassisObj1)[0]\r\n\r\n if (chassis1 != chassis2) then\r\n chassisObj2 = @ixNet.add(root + '/availableHardware', 'chassis')\r\n @ixNet.setAttribute(chassisObj2, '-hostname', chassis2)\r\n @ixNet.commit()\r\n chassisObj2 = @ixNet.remapIds(chassisObj2)[0]\r\n else\r\n chassisObj2 = chassisObj1\r\n end\r\n\r\n cardPortRef1 = chassisObj1 + '/card:'+card1+'/port:'+port1\r\n @ixNet.setMultiAttribute(vport1, '-connectedTo', cardPortRef1,\r\n '-rxMode', 'captureAndMeasure', '-name', 'Ethernet - 001')\r\n @ixNet.commit()\r\n\r\n cardPortRef2 = chassisObj2 + '/card:'+card2+'/port:'+port2\r\n @ixNet.setMultiAttribute(vport2, '-connectedTo', cardPortRef2,\r\n '-rxMode', 'captureAndMeasure', '-name', 'Ethernet - 002')\r\n @ixNet.commit()\r\nend", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#patch_tier1_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update!(**args)\n @ingress_port = args[:ingress_port] if args.key?(:ingress_port)\n @psc_uri = args[:psc_uri] if args.key?(:psc_uri)\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#patch_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_port_security_profile_bindings_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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings, 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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].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 => 'PortSecurityProfileBindingMapListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#list_port_security_profile_bindings\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n concat_phone_numbers params[:guest]\n @tablet_guest = Tablet::Guest.find(params[:id])\n\n respond_to do |format|\n if @tablet_guest.update_attributes(params[:guest])\n format.json { render :json => @tablet_guest }\n else\n format.json { render :json => @tablet_guest.errors, :status => :unprocessable_entity }\n end\n end\n end", "def set_panier\n @panier = Panier.find(params[:id])\n end", "def create_or_update_segment_security_profile_binding_with_http_info(tier_1_id, segment_id, segment_security_profile_binding_map_id, segment_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/segment-security-profile-binding-maps/{segment-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'segment-security-profile-binding-map-id' + '}', segment_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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_security_profile_binding_map)\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 => 'SegmentSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_segment_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end" ]
[ "0.71666825", "0.712756", "0.69874674", "0.69874674", "0.6909951", "0.68357044", "0.68134946", "0.67042327", "0.6366846", "0.6360169", "0.63080263", "0.63080263", "0.62536114", "0.6151043", "0.57748175", "0.5769342", "0.57255197", "0.57017475", "0.5686247", "0.56371486", "0.5602536", "0.5602536", "0.5593131", "0.5593131", "0.55901664", "0.5512093", "0.5469822", "0.54286444", "0.5384999", "0.536997", "0.5356067", "0.5338366", "0.53143716", "0.530731", "0.5301089", "0.52937394", "0.52885926", "0.52731216", "0.52613574", "0.52613574", "0.5251456", "0.52463305", "0.52302444", "0.5183914", "0.51826864", "0.5151624", "0.5137471", "0.51218694", "0.51218694", "0.50700915", "0.50184387", "0.5011931", "0.4999527", "0.49884823", "0.49637157", "0.49566734", "0.49560252", "0.49517563", "0.49414086", "0.49173063", "0.49170822", "0.49131486", "0.48682272", "0.4867376", "0.48563844", "0.4856081", "0.4848992", "0.48447508", "0.48335233", "0.48334506", "0.48053923", "0.4801484", "0.4786931", "0.47726563", "0.47691286", "0.47691286", "0.4747404", "0.47467953", "0.4729085", "0.47188732", "0.4710545", "0.47093967", "0.47093967", "0.46954453", "0.46954006", "0.46897006", "0.4670591", "0.46507832", "0.4649124", "0.46339455", "0.4628267", "0.46161819", "0.46145248", "0.46108893", "0.46095356", "0.4606804", "0.45983118", "0.45953104", "0.45951843", "0.45949233" ]
0.7169248
0
Patch a Tier1 segment port Create a Tier1 segment port if it does not exist based on the IDs, or update existing port information by replacing the port object fields which presents in the request body.
def patch_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {}) patch_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\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 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_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 delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\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(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def create_or_replace_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\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_or_replace_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\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 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 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 patch_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#patch_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#patch_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def update_port(portName, attributes)\n @data['ports'].each do |port|\n next unless port['name'] == portName\n attributes.each { |key, value| port[key.to_s] = value }\n response = @client.rest_put(@data['uri'] + '/ports', 'body' => port)\n @client.response_handler(response)\n end\n end", "def patch_tier1(tier_1_id, tier1, opts = {})\n patch_tier1_with_http_info(tier_1_id, tier1, opts)\n nil\n end", "def update_port(port, fixed_ips) \n data = { 'port' => { 'fixed_ips' => fixed_ips } }\n return put_request(address(\"ports/\"+port), data, @token)\n end", "def list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports\"\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.list_tier1_segment_ports\"\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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_port_security_profile_binding_0(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n patch_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n nil\n end", "def patch_tier1_0(tier_1_id, tier1, opts = {})\n patch_tier1_0_with_http_info(tier_1_id, tier1, opts)\n nil\n end", "def create_or_update_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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 => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_port_security_profile_binding(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n patch_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n nil\n end", "def update\n respond_to do |format|\n if @port.update(port_params)\n format.html { redirect_to @port, notice: \"Port was successfully updated.\" }\n format.json { render :show, status: :ok, location: @port }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @port.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch_infra_segment_port_0(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts)\n nil\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_or_replace_infra_segment_port_0_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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_infra_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_update_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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 => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports_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.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_infra_segment_port_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_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_infra_segment_port_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_port_qo_s_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_qos_profile_binding_map_id, port_qo_s_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding_0\"\n end\n # verify the required parameter 'port_qos_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_qos_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qos_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding_0\"\n end\n # verify the required parameter 'port_qo_s_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_qo_s_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qo_s_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-qos-profile-binding-maps/{port-qos-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-qos-profile-binding-map-id' + '}', port_qos_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_qo_s_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi#patch_port_qo_s_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\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 delete_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#delete_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_port_service\n @port_service = PortService.find(params[:id])\n end", "def patch_port_qo_s_binding_with_http_info(tier_1_id, segment_id, port_id, port_qos_profile_binding_map_id, port_qo_s_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding\"\n end\n # verify the required parameter 'port_qos_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_qos_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qos_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding\"\n end\n # verify the required parameter 'port_qo_s_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_qo_s_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qo_s_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-qos-profile-binding-maps/{port-qos-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-qos-profile-binding-map-id' + '}', port_qos_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_qo_s_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi#patch_port_qo_s_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#delete_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_dev_port\n @dev_port = DevPort.find(params[:id])\n end", "def patch_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def update_device_switch_port(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'serial' => options['serial'],\r\n 'number' => options['number']\r\n )\r\n # Prepare query url.\r\n _path_url = '/devices/{serial}/switchPorts/{number}'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'serial' => options['serial'],\r\n 'number' => options['number']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json',\r\n 'content-type' => 'application/json; charset=utf-8'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.put(\r\n _query_url,\r\n headers: _headers,\r\n parameters: options['update_device_switch_port'].to_json\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end", "def set_devport_fiber_id\n #binding.pry\n #get the devport assigned\n dvprt = Devport.find_by_id(porta) #cannot be nill...user chose already a valid port\n \n #june-25 adjustments:\n dvprt.fiber_out_id = id #(porta)\n dvprt.save\n dvprt = Devport.find_by_id(portb)\n dvprt.fiber_in_id = id #(portb)\n dvprt.save\n \n #this is commented-out by adjustment in June-25. Porta->fiber_out, Portb->fiber_in\n #if dvprt.fiber_in_id == 0\n # dvprt.fiber_in_id = id\n #elsif dvprt.fiber_out_id == 0\n # dvprt.fiber_out_id = id\n #else\n # dvprt.fiber_in_id = id #overwrite it then\n #end\n \n #save that one devport\n dvprt.save\n \n #now do the same for portb...\n #dvprt = Devport.find_by_id(portb) #cannot be nill...use chose already a valid port\n #if dvprt.fiber_in_id == 0\n # dvprt.fiber_in_id = id\n #elsif dvprt.fiber_out_id == 0\n # dvprt.fiber_out_id = id\n #else\n # dvprt.fiber_in_id = id #overwrite it then\n #end\n \n #save that one too...\n #dvprt.save\n\n \n end", "def update\n @porter = Porter.find(params[:id])\n\n respond_to do |format|\n if @porter.update_attributes(params[:porter])\n format.html { redirect_to @porter, notice: 'Porter was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @porter.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if params[:switch_id] && @switch = Switch.find_by_id(params[:switch_id])\n @port = @switch.ports.new(port_params)\n end\n\n if params[:slot_id] && @slot = Slot.find_by_id(params[:slot_id])\n @port = @slot.ports.new(port_params)\n end\n\n respond_to do |format|\n if @port.save\n format.html { redirect_to @port, notice: \"Port was successfully created.\" }\n format.json { render :show, status: :created, location: @port }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @port.errors, status: :unprocessable_entity }\n end\n end\n end", "def list_tier1_segment_ports(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def update_port_qo_s_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_qos_profile_binding_map_id, port_qo_s_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding_0\"\n end\n # verify the required parameter 'port_qos_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_qos_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qos_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding_0\"\n end\n # verify the required parameter 'port_qo_s_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_qo_s_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qo_s_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-qos-profile-binding-maps/{port-qos-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-qos-profile-binding-map-id' + '}', port_qos_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_qo_s_profile_binding_map)\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 => 'PortQoSProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi#update_port_qo_s_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_port_of_call\n @port_of_call = PortOfCall.find(params[:id])\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 dev_port_params\n params.require(:dev_port).permit(:name, :portno, :type, :RackID, :odfid, :fiberid)\n end", "def set_porter\n @porter = Porter.find(params[:id])\n end", "def update\n respond_to do |format|\n if @dev_port.update(dev_port_params)\n format.html { redirect_to @dev_port, notice: 'Dev port was successfully updated.' }\n format.json { render :show, status: :ok, location: @dev_port }\n else\n format.html { render :edit }\n format.json { render json: @dev_port.errors, status: :unprocessable_entity }\n end\n end\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 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 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\n respond_to do |format|\n if @port.update(port_params)\n SetPortRateLimitJob.perform_later(@port)\n format.html { redirect_to @port.portable, notice: \"Port was successfully updated.\" }\n format.json { render :show, status: :ok, location: @port }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @port.errors, status: :unprocessable_entity }\n end\n end\n end", "def port=(new_port)\n return if new_port == port\n reset!\n @desired_port = new_port\n start!\n end", "def update_port_qo_s_binding_with_http_info(tier_1_id, segment_id, port_id, port_qos_profile_binding_map_id, port_qo_s_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding\"\n end\n # verify the required parameter 'port_qos_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_qos_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qos_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding\"\n end\n # verify the required parameter 'port_qo_s_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_qo_s_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qo_s_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-qos-profile-binding-maps/{port-qos-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-qos-profile-binding-map-id' + '}', port_qos_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_qo_s_profile_binding_map)\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 => 'PortQoSProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi#update_port_qo_s_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def get_tier1_segment_port_mac_table_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table, 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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n respond_to do |format|\n if @simple_portin.update(simple_portin_params)\n format.html { redirect_to @simple_portin, notice: 'Simple portin was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @simple_portin.errors, status: :unprocessable_entity }\n end\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 set_simple_portin\n @simple_portin = SimplePortin.find(params[:id])\n end", "def port=(new_port=\"\")\n (raise CloudLB::Exception::MissingArgument, \"Must provide a new port\") if new_port.to_s.empty?\n (raise CloudLB::Exception::Syntax, \"Port must be numeric\") unless new_port.to_s =~ /^\\d+$/\n body = {\"port\" => new_port.to_s}\n update(body)\n end", "def set_port_model\n @port_model = PortModel.find(params[:id])\n end", "def get_tier1_segment_port_mac_table_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_0, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def delete_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def update\n respond_to do |format|\n if @port_service.update(port_service_params)\n format.html { redirect_to @port_service, notice: 'Port service was successfully updated.' }\n format.json { render :show, status: :ok, location: @port_service }\n else\n format.html { render :edit }\n format.json { render json: @port_service.errors, status: :unprocessable_entity }\n end\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 port=(val)\n @j_del.setPort(val)\n self\n end", "def get_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def port_params\n params.require(:port).permit(:port_number, :name, :description, :up_rate, :down_rate, :rate_unit, :subscriber_id)\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def update\n respond_to do |format|\n if @port_of_call.update(port_of_call_params)\n format.html { redirect_to @port_of_call, notice: 'Port of call was successfully updated.' }\n format.json { render :show, status: :ok, location: @port_of_call }\n else\n format.html { render :edit }\n format.json { render json: @port_of_call.errors, status: :unprocessable_entity }\n end\n end\n end", "def port_service_params\n params.require(:port_service).permit(:port_id, :service_id)\n end", "def get_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#get_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_segment_ports_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def delete_port_qo_s_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_qos_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.delete_port_qo_s_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.delete_port_qo_s_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.delete_port_qo_s_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.delete_port_qo_s_binding_0\"\n end\n # verify the required parameter 'port_qos_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_qos_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qos_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.delete_port_qo_s_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-qos-profile-binding-maps/{port-qos-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-qos-profile-binding-map-id' + '}', port_qos_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi#delete_port_qo_s_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_update_segment_security_profile_binding_0_with_http_info(tier_1_id, segment_id, segment_security_profile_binding_map_id, segment_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/segment-security-profile-binding-maps/{segment-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'segment-security-profile-binding-map-id' + '}', segment_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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_security_profile_binding_map)\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 => 'SegmentSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_segment_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#patch_tier1_interface\\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 assignPorts (ixNet, realPort1, realPort2)\r\n chassis1 = realPort1[0]\r\n chassis2 = realPort2[0]\r\n card1 = realPort1[1]\r\n card2 = realPort2[1]\r\n port1 = realPort1[2]\r\n port2 = realPort2[2]\r\n\r\n root = @ixNet.getRoot()\r\n vport1 = @ixNet.add(root, 'vport')\r\n @ixNet.commit()\r\n vport1 = @ixNet.remapIds(vport1)[0]\r\n\r\n vport2 = @ixNet.add(root, 'vport')\r\n @ixNet.commit()\r\n vport2 = @ixNet.remapIds(vport2)[0]\r\n\r\n chassisObj1 = @ixNet.add(root + '/availableHardware', 'chassis')\r\n @ixNet.setAttribute(chassisObj1, '-hostname', chassis1)\r\n @ixNet.commit()\r\n chassisObj1 = @ixNet.remapIds(chassisObj1)[0]\r\n\r\n if (chassis1 != chassis2) then\r\n chassisObj2 = @ixNet.add(root + '/availableHardware', 'chassis')\r\n @ixNet.setAttribute(chassisObj2, '-hostname', chassis2)\r\n @ixNet.commit()\r\n chassisObj2 = @ixNet.remapIds(chassisObj2)[0]\r\n else\r\n chassisObj2 = chassisObj1\r\n end\r\n\r\n cardPortRef1 = chassisObj1 + '/card:'+card1+'/port:'+port1\r\n @ixNet.setMultiAttribute(vport1, '-connectedTo', cardPortRef1,\r\n '-rxMode', 'captureAndMeasure', '-name', 'Ethernet - 001')\r\n @ixNet.commit()\r\n\r\n cardPortRef2 = chassisObj2 + '/card:'+card2+'/port:'+port2\r\n @ixNet.setMultiAttribute(vport2, '-connectedTo', cardPortRef2,\r\n '-rxMode', 'captureAndMeasure', '-name', 'Ethernet - 002')\r\n @ixNet.commit()\r\nend", "def patch_segment_dhcp_static_binding_0_with_http_info(tier_1_id, segment_id, binding_id, dhcp_static_binding_config, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDHCPDHCPStaticBindingsSegmentsBindingsFixedApi.patch_segment_dhcp_static_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDHCPDHCPStaticBindingsSegmentsBindingsFixedApi.patch_segment_dhcp_static_binding_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 PolicyNetworkingIPManagementDHCPDHCPStaticBindingsSegmentsBindingsFixedApi.patch_segment_dhcp_static_binding_0\"\n end\n # verify the required parameter 'binding_id' is set\n if @api_client.config.client_side_validation && binding_id.nil?\n fail ArgumentError, \"Missing the required parameter 'binding_id' when calling PolicyNetworkingIPManagementDHCPDHCPStaticBindingsSegmentsBindingsFixedApi.patch_segment_dhcp_static_binding_0\"\n end\n # verify the required parameter 'dhcp_static_binding_config' is set\n if @api_client.config.client_side_validation && dhcp_static_binding_config.nil?\n fail ArgumentError, \"Missing the required parameter 'dhcp_static_binding_config' when calling PolicyNetworkingIPManagementDHCPDHCPStaticBindingsSegmentsBindingsFixedApi.patch_segment_dhcp_static_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/dhcp-static-binding-configs/{binding-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'binding-id' + '}', binding_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(dhcp_static_binding_config)\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: PolicyNetworkingIPManagementDHCPDHCPStaticBindingsSegmentsBindingsFixedApi#patch_segment_dhcp_static_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update!(**args)\n @ingress_port = args[:ingress_port] if args.key?(:ingress_port)\n @psc_uri = args[:psc_uri] if args.key?(:psc_uri)\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#patch_tier1_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#patch_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_port_security_profile_bindings_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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings, 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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].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 => 'PortSecurityProfileBindingMapListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#list_port_security_profile_bindings\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n concat_phone_numbers params[:guest]\n @tablet_guest = Tablet::Guest.find(params[:id])\n\n respond_to do |format|\n if @tablet_guest.update_attributes(params[:guest])\n format.json { render :json => @tablet_guest }\n else\n format.json { render :json => @tablet_guest.errors, :status => :unprocessable_entity }\n end\n end\n end", "def set_panier\n @panier = Panier.find(params[:id])\n end", "def get_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#get_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end" ]
[ "0.71684194", "0.716586", "0.71267116", "0.69879246", "0.69879246", "0.68352413", "0.68130374", "0.6703795", "0.6365272", "0.6358633", "0.6309356", "0.6309356", "0.6252", "0.61525935", "0.5773224", "0.5767777", "0.57239", "0.57007545", "0.56862766", "0.5636347", "0.5602766", "0.5602766", "0.5594341", "0.5594341", "0.5591975", "0.55109537", "0.54710346", "0.54261255", "0.53855956", "0.53686965", "0.53552234", "0.5339214", "0.5315194", "0.53086793", "0.5299151", "0.5294195", "0.5287853", "0.527053", "0.5261933", "0.5261933", "0.5250323", "0.5244254", "0.5229036", "0.5184572", "0.51817644", "0.5150632", "0.51382565", "0.5123629", "0.5123629", "0.50693655", "0.50193757", "0.5013211", "0.5000139", "0.49863127", "0.49623713", "0.49576035", "0.4954326", "0.4952073", "0.49422574", "0.49176922", "0.49144652", "0.49105534", "0.4869177", "0.4867495", "0.48574957", "0.48551992", "0.4848597", "0.48433146", "0.48336193", "0.48317173", "0.48057938", "0.48039714", "0.47875082", "0.47712186", "0.47687086", "0.47687086", "0.47476247", "0.47464585", "0.47306734", "0.47192547", "0.47106236", "0.4709408", "0.4709408", "0.46958977", "0.4695803", "0.46885514", "0.46686304", "0.464937", "0.4647164", "0.46321574", "0.46277884", "0.46148056", "0.46146578", "0.4609591", "0.46089923", "0.4604981", "0.45964605", "0.45956275", "0.45943487", "0.45938107" ]
0.69105345
5
Patch a Tier1 segment port Create a Tier1 segment port if it does not exist based on the IDs, or update existing port information by replacing the port object fields which presents in the request body.
def patch_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_tier1_segment_port_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 PolicyNetworkingConnectivitySegmentsPortsApi.patch_tier1_segment_port_0" end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.patch_tier1_segment_port_0" end # verify the required parameter 'port_id' is set if @api_client.config.client_side_validation && port_id.nil? fail ArgumentError, "Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.patch_tier1_segment_port_0" end # verify the required parameter 'segment_port' is set if @api_client.config.client_side_validation && segment_port.nil? fail ArgumentError, "Missing the required parameter 'segment_port' when calling PolicyNetworkingConnectivitySegmentsPortsApi.patch_tier1_segment_port_0" end # resource path 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) # 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(segment_port) 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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port_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 patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n patch_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n nil\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 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_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 delete_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.delete_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.delete_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.delete_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.delete_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(: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\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_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.delete_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.delete_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.delete_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.delete_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(: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\\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(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\n end", "def create_or_replace_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\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_or_replace_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts)\n data\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 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 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 patch_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#patch_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.patch_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#patch_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_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.patch_infra_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.patch_infra_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.patch_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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(: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: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def set_port\n @port = Port.find(params[:id])\n end", "def update_port(portName, attributes)\n @data['ports'].each do |port|\n next unless port['name'] == portName\n attributes.each { |key, value| port[key.to_s] = value }\n response = @client.rest_put(@data['uri'] + '/ports', 'body' => port)\n @client.response_handler(response)\n end\n end", "def patch_tier1(tier_1_id, tier1, opts = {})\n patch_tier1_with_http_info(tier_1_id, tier1, opts)\n nil\n end", "def update_port(port, fixed_ips) \n data = { 'port' => { 'fixed_ips' => fixed_ips } }\n return put_request(address(\"ports/\"+port), data, @token)\n end", "def list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports\"\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.list_tier1_segment_ports\"\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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, 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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_port_security_profile_binding_0(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n patch_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n nil\n end", "def patch_tier1_0(tier_1_id, tier1, opts = {})\n patch_tier1_0_with_http_info(tier_1_id, tier1, opts)\n nil\n end", "def create_or_update_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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 => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_port_security_profile_binding(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n patch_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts)\n nil\n end", "def update\n respond_to do |format|\n if @port.update(port_params)\n format.html { redirect_to @port, notice: \"Port was successfully updated.\" }\n format.json { render :show, status: :ok, location: @port }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @port.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch_infra_segment_port_0(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts)\n nil\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_or_replace_infra_segment_port_0_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port_0\"\n end\n # resource path\n local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.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_infra_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_update_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_security_profile_binding_map)\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 => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\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.list_tier1_segment_ports_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.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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 PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_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}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_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 => 'SegmentPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_infra_segment_port_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_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_infra_segment_port_with_http_info(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_infra_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_infra_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_infra_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_infra_segment_port\"\n end\n # resource path\n local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.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_infra_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_port_qo_s_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_qos_profile_binding_map_id, port_qo_s_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding_0\"\n end\n # verify the required parameter 'port_qos_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_qos_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qos_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding_0\"\n end\n # verify the required parameter 'port_qo_s_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_qo_s_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qo_s_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-qos-profile-binding-maps/{port-qos-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-qos-profile-binding-map-id' + '}', port_qos_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_qo_s_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi#patch_port_qo_s_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\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 delete_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#delete_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_port_service\n @port_service = PortService.find(params[:id])\n end", "def patch_port_qo_s_binding_with_http_info(tier_1_id, segment_id, port_id, port_qos_profile_binding_map_id, port_qo_s_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding\"\n end\n # verify the required parameter 'port_qos_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_qos_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qos_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding\"\n end\n # verify the required parameter 'port_qo_s_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_qo_s_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qo_s_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.patch_port_qo_s_binding\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-qos-profile-binding-maps/{port-qos-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-qos-profile-binding-map-id' + '}', port_qos_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_qo_s_profile_binding_map)\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: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi#patch_port_qo_s_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.delete_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#delete_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_dev_port\n @dev_port = DevPort.find(params[:id])\n end", "def patch_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def update_device_switch_port(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'serial' => options['serial'],\r\n 'number' => options['number']\r\n )\r\n # Prepare query url.\r\n _path_url = '/devices/{serial}/switchPorts/{number}'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'serial' => options['serial'],\r\n 'number' => options['number']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json',\r\n 'content-type' => 'application/json; charset=utf-8'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.put(\r\n _query_url,\r\n headers: _headers,\r\n parameters: options['update_device_switch_port'].to_json\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end", "def set_devport_fiber_id\n #binding.pry\n #get the devport assigned\n dvprt = Devport.find_by_id(porta) #cannot be nill...user chose already a valid port\n \n #june-25 adjustments:\n dvprt.fiber_out_id = id #(porta)\n dvprt.save\n dvprt = Devport.find_by_id(portb)\n dvprt.fiber_in_id = id #(portb)\n dvprt.save\n \n #this is commented-out by adjustment in June-25. Porta->fiber_out, Portb->fiber_in\n #if dvprt.fiber_in_id == 0\n # dvprt.fiber_in_id = id\n #elsif dvprt.fiber_out_id == 0\n # dvprt.fiber_out_id = id\n #else\n # dvprt.fiber_in_id = id #overwrite it then\n #end\n \n #save that one devport\n dvprt.save\n \n #now do the same for portb...\n #dvprt = Devport.find_by_id(portb) #cannot be nill...use chose already a valid port\n #if dvprt.fiber_in_id == 0\n # dvprt.fiber_in_id = id\n #elsif dvprt.fiber_out_id == 0\n # dvprt.fiber_out_id = id\n #else\n # dvprt.fiber_in_id = id #overwrite it then\n #end\n \n #save that one too...\n #dvprt.save\n\n \n end", "def update\n @porter = Porter.find(params[:id])\n\n respond_to do |format|\n if @porter.update_attributes(params[:porter])\n format.html { redirect_to @porter, notice: 'Porter was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @porter.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if params[:switch_id] && @switch = Switch.find_by_id(params[:switch_id])\n @port = @switch.ports.new(port_params)\n end\n\n if params[:slot_id] && @slot = Slot.find_by_id(params[:slot_id])\n @port = @slot.ports.new(port_params)\n end\n\n respond_to do |format|\n if @port.save\n format.html { redirect_to @port, notice: \"Port was successfully created.\" }\n format.json { render :show, status: :created, location: @port }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @port.errors, status: :unprocessable_entity }\n end\n end\n end", "def list_tier1_segment_ports(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def update_port_qo_s_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_qos_profile_binding_map_id, port_qo_s_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding_0\"\n end\n # verify the required parameter 'port_qos_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_qos_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qos_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding_0\"\n end\n # verify the required parameter 'port_qo_s_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_qo_s_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qo_s_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-qos-profile-binding-maps/{port-qos-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-qos-profile-binding-map-id' + '}', port_qos_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_qo_s_profile_binding_map)\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 => 'PortQoSProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi#update_port_qo_s_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_port_of_call\n @port_of_call = PortOfCall.find(params[:id])\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 dev_port_params\n params.require(:dev_port).permit(:name, :portno, :type, :RackID, :odfid, :fiberid)\n end", "def set_porter\n @porter = Porter.find(params[:id])\n end", "def update\n respond_to do |format|\n if @dev_port.update(dev_port_params)\n format.html { redirect_to @dev_port, notice: 'Dev port was successfully updated.' }\n format.json { render :show, status: :ok, location: @dev_port }\n else\n format.html { render :edit }\n format.json { render json: @dev_port.errors, status: :unprocessable_entity }\n end\n end\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 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 update\n\n respond_to do |format|\n if @port.update(port_params)\n SetPortRateLimitJob.perform_later(@port)\n format.html { redirect_to @port.portable, notice: \"Port was successfully updated.\" }\n format.json { render :show, status: :ok, location: @port }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @port.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_port_qo_s_binding_with_http_info(tier_1_id, segment_id, port_id, port_qos_profile_binding_map_id, port_qo_s_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding\"\n end\n # verify the required parameter 'port_qos_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_qos_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qos_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding\"\n end\n # verify the required parameter 'port_qo_s_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_qo_s_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qo_s_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.update_port_qo_s_binding\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-qos-profile-binding-maps/{port-qos-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-qos-profile-binding-map-id' + '}', port_qos_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(port_qo_s_profile_binding_map)\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 => 'PortQoSProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi#update_port_qo_s_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def port=(new_port)\n return if new_port == port\n reset!\n @desired_port = new_port\n start!\n end", "def delete_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def get_tier1_segment_port_mac_table_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table\"\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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table, 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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table\\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 update\n respond_to do |format|\n if @simple_portin.update(simple_portin_params)\n format.html { redirect_to @simple_portin, notice: 'Simple portin was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @simple_portin.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_simple_portin\n @simple_portin = SimplePortin.find(params[:id])\n end", "def port=(new_port=\"\")\n (raise CloudLB::Exception::MissingArgument, \"Must provide a new port\") if new_port.to_s.empty?\n (raise CloudLB::Exception::Syntax, \"Port must be numeric\") unless new_port.to_s =~ /^\\d+$/\n body = {\"port\" => new_port.to_s}\n update(body)\n end", "def set_port_model\n @port_model = PortModel.find(params[:id])\n end", "def get_tier1_segment_port_mac_table_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: PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_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 PolicyNetworkingConnectivitySegmentPortsMACTableApi.get_tier1_segment_port_mac_table_0, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/mac-table'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].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 query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].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 => 'SegmentPortMacAddressListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentPortsMACTableApi#get_tier1_segment_port_mac_table_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def delete_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\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 update\n respond_to do |format|\n if @port_service.update(port_service_params)\n format.html { redirect_to @port_service, notice: 'Port service was successfully updated.' }\n format.json { render :show, status: :ok, location: @port_service }\n else\n format.html { render :edit }\n format.json { render json: @port_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def port=(val)\n @j_del.setPort(val)\n self\n end", "def get_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def port_params\n params.require(:port).permit(:port_number, :name, :description, :up_rate, :down_rate, :rate_unit, :subscriber_id)\n end", "def port_service_params\n params.require(:port_service).permit(:port_id, :service_id)\n end", "def update\n respond_to do |format|\n if @port_of_call.update(port_of_call_params)\n format.html { redirect_to @port_of_call, notice: 'Port of call was successfully updated.' }\n format.json { render :show, status: :ok, location: @port_of_call }\n else\n format.html { render :edit }\n format.json { render json: @port_of_call.errors, status: :unprocessable_entity }\n end\n end\n end", "def get_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#get_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_segment_ports_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def delete_port_qo_s_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_qos_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.delete_port_qo_s_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.delete_port_qo_s_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.delete_port_qo_s_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.delete_port_qo_s_binding_0\"\n end\n # verify the required parameter 'port_qos_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_qos_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_qos_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi.delete_port_qo_s_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-qos-profile-binding-maps/{port-qos-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-qos-profile-binding-map-id' + '}', port_qos_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n 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: PolicyNetworkingConnectivitySegmentsSegmentProfilesQOSProfileBindingApi#delete_port_qo_s_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_update_segment_security_profile_binding_0_with_http_info(tier_1_id, segment_id, segment_security_profile_binding_map_id, segment_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/segment-security-profile-binding-maps/{segment-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'segment-security-profile-binding-map-id' + '}', segment_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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_security_profile_binding_map)\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 => 'SegmentSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_segment_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#patch_tier1_interface\\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 patch_segment_dhcp_static_binding_0_with_http_info(tier_1_id, segment_id, binding_id, dhcp_static_binding_config, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDHCPDHCPStaticBindingsSegmentsBindingsFixedApi.patch_segment_dhcp_static_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDHCPDHCPStaticBindingsSegmentsBindingsFixedApi.patch_segment_dhcp_static_binding_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 PolicyNetworkingIPManagementDHCPDHCPStaticBindingsSegmentsBindingsFixedApi.patch_segment_dhcp_static_binding_0\"\n end\n # verify the required parameter 'binding_id' is set\n if @api_client.config.client_side_validation && binding_id.nil?\n fail ArgumentError, \"Missing the required parameter 'binding_id' when calling PolicyNetworkingIPManagementDHCPDHCPStaticBindingsSegmentsBindingsFixedApi.patch_segment_dhcp_static_binding_0\"\n end\n # verify the required parameter 'dhcp_static_binding_config' is set\n if @api_client.config.client_side_validation && dhcp_static_binding_config.nil?\n fail ArgumentError, \"Missing the required parameter 'dhcp_static_binding_config' when calling PolicyNetworkingIPManagementDHCPDHCPStaticBindingsSegmentsBindingsFixedApi.patch_segment_dhcp_static_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/dhcp-static-binding-configs/{binding-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'binding-id' + '}', binding_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(dhcp_static_binding_config)\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: PolicyNetworkingIPManagementDHCPDHCPStaticBindingsSegmentsBindingsFixedApi#patch_segment_dhcp_static_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def assignPorts (ixNet, realPort1, realPort2)\r\n chassis1 = realPort1[0]\r\n chassis2 = realPort2[0]\r\n card1 = realPort1[1]\r\n card2 = realPort2[1]\r\n port1 = realPort1[2]\r\n port2 = realPort2[2]\r\n\r\n root = @ixNet.getRoot()\r\n vport1 = @ixNet.add(root, 'vport')\r\n @ixNet.commit()\r\n vport1 = @ixNet.remapIds(vport1)[0]\r\n\r\n vport2 = @ixNet.add(root, 'vport')\r\n @ixNet.commit()\r\n vport2 = @ixNet.remapIds(vport2)[0]\r\n\r\n chassisObj1 = @ixNet.add(root + '/availableHardware', 'chassis')\r\n @ixNet.setAttribute(chassisObj1, '-hostname', chassis1)\r\n @ixNet.commit()\r\n chassisObj1 = @ixNet.remapIds(chassisObj1)[0]\r\n\r\n if (chassis1 != chassis2) then\r\n chassisObj2 = @ixNet.add(root + '/availableHardware', 'chassis')\r\n @ixNet.setAttribute(chassisObj2, '-hostname', chassis2)\r\n @ixNet.commit()\r\n chassisObj2 = @ixNet.remapIds(chassisObj2)[0]\r\n else\r\n chassisObj2 = chassisObj1\r\n end\r\n\r\n cardPortRef1 = chassisObj1 + '/card:'+card1+'/port:'+port1\r\n @ixNet.setMultiAttribute(vport1, '-connectedTo', cardPortRef1,\r\n '-rxMode', 'captureAndMeasure', '-name', 'Ethernet - 001')\r\n @ixNet.commit()\r\n\r\n cardPortRef2 = chassisObj2 + '/card:'+card2+'/port:'+port2\r\n @ixNet.setMultiAttribute(vport2, '-connectedTo', cardPortRef2,\r\n '-rxMode', 'captureAndMeasure', '-name', 'Ethernet - 002')\r\n @ixNet.commit()\r\nend", "def patch_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.patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#patch_tier1_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update!(**args)\n @ingress_port = args[:ingress_port] if args.key?(:ingress_port)\n @psc_uri = args[:psc_uri] if args.key?(:psc_uri)\n end", "def patch_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.patch_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.patch_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.patch_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.patch_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(: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: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#patch_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_port_security_profile_bindings_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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings, 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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].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 => 'PortSecurityProfileBindingMapListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#list_port_security_profile_bindings\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.get_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#get_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_update_segment_security_profile_binding_with_http_info(tier_1_id, segment_id, segment_security_profile_binding_map_id, segment_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/segment-security-profile-binding-maps/{segment-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'segment-security-profile-binding-map-id' + '}', segment_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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_security_profile_binding_map)\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 => 'SegmentSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_segment_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_port_security_profile_bindings_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: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_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 PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.list_port_security_profile_bindings_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}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps'.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 query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].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 => 'PortSecurityProfileBindingMapListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#list_port_security_profile_bindings_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end" ]
[ "0.71695304", "0.7166947", "0.6988407", "0.6988407", "0.6911057", "0.6836256", "0.6814012", "0.67047155", "0.6367757", "0.63610816", "0.63100046", "0.63100046", "0.62544256", "0.6153126", "0.57759106", "0.57704246", "0.57265", "0.5702354", "0.5685563", "0.56376857", "0.5601718", "0.5601718", "0.5593582", "0.5593582", "0.5590312", "0.5511725", "0.54691404", "0.54306513", "0.5385903", "0.5369783", "0.5356672", "0.53391343", "0.5313479", "0.5307782", "0.529962", "0.5293358", "0.5289216", "0.52750814", "0.5260892", "0.5260892", "0.5250572", "0.52450246", "0.52314645", "0.5184724", "0.5181755", "0.5152829", "0.51372343", "0.5121497", "0.5121497", "0.5067418", "0.501888", "0.5010972", "0.5000438", "0.4992395", "0.49629506", "0.49567807", "0.49548447", "0.49517465", "0.49414212", "0.491591", "0.49155793", "0.49116695", "0.4864721", "0.486379", "0.48555732", "0.48554897", "0.48514348", "0.48459557", "0.48324424", "0.483223", "0.48059744", "0.48006007", "0.47865453", "0.4773956", "0.47716296", "0.47716296", "0.4747558", "0.47463202", "0.47287524", "0.4722169", "0.47124907", "0.47124907", "0.47099268", "0.4696204", "0.46935278", "0.4691193", "0.46743217", "0.46507147", "0.46494806", "0.46342376", "0.46292493", "0.46160963", "0.461533", "0.4611237", "0.46073794", "0.46067286", "0.4600147", "0.45962995", "0.45952868", "0.45942408" ]
0.7127818
2
GET /subscriptions GET /subscriptions.json
def index @subscriptions = current_user.subscriptions.select{|s| s.manga !=nil && s.manga.display_name != nil && s.manga.name!=nil}.sort_by{|s| s.manga.display_name} respond_to do |format| format.html # index.html.erb format.json { render json: @subscriptions } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subscriptions\n url = url_with_api_version(@base_url, 'subscriptions')\n resp = rest_get(url)\n JSON.parse(resp.body)[\"value\"]\n end", "def all_subscriptions\n get(url_(\"subscription\"))\n end", "def list_subscriptions(user)\n get(\"/#{user}/lists/subscriptions.json\")\n end", "def list_my_subscriptions() path = \"/api/v2/utilities/subscriptions\"\n get(path, {}, AvaTax::VERSION) end", "def user_vendor_subscriptions\n get(\"/api/v1/oauth_user_vendor_subscriptions.json\")\n end", "def index\n @subscriptions = current_user.subscriptions.order(:created_at)\n @user = current_user\n\n if not current_user.fitbit.nil?\n begin\n @fitbit_subscriptions = JSON.parse(current_user.fitbit.client.get('/1/user/-/apiSubscriptions.json').body)['apiSubscriptions']\n rescue SocketError\n logger.error \"Can not talk to fitbit\"\n end\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subscriptions }\n end\n end", "def list_subscription\n response = Faraday.get(@subscription_api_url)\n response_json = JSON.parse(response.body)\n fix_response(response_json)\n end", "def subscriptions( params={} )\n subscriptions = get_connections(\"subscriptions\", params)\n return map_connections subscriptions, :to => Facebook::Graph::Subscription\n end", "def index\r\n @subscriptions = current_business_user.subscriptions.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @subscriptions }\r\n end\r\n end", "def index\n @subscriptions = Subscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subscriptions }\n end\n end", "def show\n @subscription = current_user.subscriptions.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def show\n @subscription = current_user.subscriptions.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def get_subscriptions(opts = {})\n data, _status_code, _headers = get_subscriptions_with_http_info(opts)\n return data\n end", "def list_subscriptions(options = {})\n api.graph_call(subscription_path, {}, \"get\", options)\n end", "def get_subscriptions(id:, order: nil)\n if order\n get_json(\"#{endpoint}/subscribers/#{uri_encode(id)}/subscriptions?order=#{uri_encode(order)}\")\n else\n get_json(\"#{endpoint}/subscribers/#{uri_encode(id)}/subscriptions\")\n end\n end", "def get_subscriptions(id:, order: nil)\n if order\n get_json(\"#{endpoint}/subscribers/#{uri_encode(id)}/subscriptions?order=#{uri_encode(order)}\")\n else\n get_json(\"#{endpoint}/subscribers/#{uri_encode(id)}/subscriptions\")\n end\n end", "def index\n @subscriptions = current_user.subscriptions.all\n end", "def index\n @api_subscriptions = Api::Subscription.all\n end", "def get(incoming={})\n opts = HttpClient::Helper.symbolize_keys(incoming)\n query = {\n :guid => HttpClient::Preconditions.assert_class_or_nil('guid', HttpClient::Helper.to_uuid(opts.delete(:guid)), String),\n :organization_key => HttpClient::Preconditions.assert_class_or_nil('organization_key', opts.delete(:organization_key), String),\n :user_guid => HttpClient::Preconditions.assert_class_or_nil('user_guid', HttpClient::Helper.to_uuid(opts.delete(:user_guid)), String),\n :publication => HttpClient::Preconditions.assert_class_or_nil('publication', opts[:publication].nil? ? nil : (opts[:publication].is_a?(Apidoc::Models::Publication) ? opts.delete(:publication) : Apidoc::Models::Publication.apply(opts.delete(:publication))), Apidoc::Models::Publication),\n :limit => HttpClient::Preconditions.assert_class_or_nil('limit', opts.delete(:limit), Integer),\n :offset => HttpClient::Preconditions.assert_class_or_nil('offset', opts.delete(:offset), Integer)\n }.delete_if { |k, v| v.nil? }\n @client.request(\"/subscriptions\").with_query(query).get.map { |hash| Apidoc::Models::Subscription.new(hash) }\n end", "def index\n if params[:client_id].blank?\n @subscriptions = Subscription.all\n else\n @subscriptions = Client.find(params[:client_id]).subscriptions\n end\n end", "def subscriptions\n @subscriptions ||= begin\n resp = @client.access_token.get('/reader/api/0/subscription/list?output=json')\n raise \"unable to retrieve the list of subscription for user \\\"#{user_id}\\\": #{resp.inspect}\" unless resp.code_type == Net::HTTPOK\n JSON.parse(resp.body)['subscriptions'].collect do |hash|\n Google::Reader::Subscription.new(hash.merge({:client => @client}))\n end\n end\n end", "def list_subs\n \t@subs = instagram_client.subscriptions\n end", "def index\n @my_subscriptions = current_user.active_subscriptions\n end", "def index\n @subscriptions = Subscription.all\n end", "def index\n @subscriptions = Subscription.all\n end", "def index\n @subscriptions = Subscription.all\n end", "def subscriptions\n @subscriptions ||= {}\n end", "def subscriptions(page = 1)\n Dropio::Resource.client.subscriptions(self, page)\n end", "def subscriptions\n update_subscriptions(params[:types]) if params[:types]\n @types = build_notification_types\n render :json => @types\n end", "def index\n\n @category_subscriptions = CategorySubscription.all\n\n render json: @category_subscriptions\n\n end", "def show\n @subscription = Subscription.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def show\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def show\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def show\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def show\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def index\n @subscriptions = Subscription.where(:binder_id => params[:binder_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subscriptions }\n end\n end", "def get_all_subscriptions_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SubscriptionsApi.get_all_subscriptions ...\"\n end\n # resource path\n local_var_path = \"/subscriptions\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'uid'] = opts[:'uid'] if !opts[:'uid'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'count'] = opts[:'count'] if !opts[:'count'].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\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['artikcloud_oauth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SubscriptionsEnvelope')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SubscriptionsApi#get_all_subscriptions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\r\n @subscription = Subscription.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @subscription }\r\n end\r\n end", "def user_subscriptions(user_id, options={})\n response = connection.get do |req|\n req.url \"/user/#{user_id}/subscriptions\", simple_params(options)\n end\n response.body\n end", "def subscriptions(user_id)\n response = rest_client.get(signature_url(\"/subscription/?user_id=#{user_id}\"))\n process_response(response)\n end", "def list_subscriptions options = {}\n paged_enum = subscriber.list_subscriptions project: project_path(options),\n page_size: options[:max],\n page_token: options[:token]\n\n paged_enum.response\n end", "def index\n if is_client_app?\n if params[:user_id].present?\n t = Subscription.arel_table\n s = Subscription.statuses\n @subscriptions = Subscription.where(user_id: params[:user_id]).where(t[:status].eq(s[:authorized]).or(t[:status].eq(s[:paused])))\n else\n @subscriptions = Subscription.all\n end\n\n render json: @subscriptions\n else\n response.headers['X-Total-Count'] = @subscriptions.count.to_s\n @subscriptions = @subscriptions.page(params[:page]) if params[:page].present?\n @subscriptions = @subscriptions.per(params[:per]) if params[:per].present?\n\n _render collection: @subscriptions, flag: params[:flag].try(:to_sym)\n end\n end", "def show\n json_response(@user_subscription)\n end", "def index\n @crytosubscriptions = Crytosubscription.all\n end", "def get_subscriptions\n get_subscriptions_from(@nodename)\n end", "def index\n @q = ::Pushar::Core::Subscription.unscoped.search(params[:q])\n @q.sorts = 'created_at desc' if @q.sorts.empty?\n @subscriptions = @q.result(distinct: true).page(params[:page]).per(50)\n end", "def getAllSubscriptions\n if @subscriptionLists.hasKey(\"subscriptions\")\n return @subscriptionLists.getRepositoryObject(\"subscriptions\").getObject\n end\n end", "def get_subscriptions_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SubscriptionApi.get_subscriptions ...\"\n end\n if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 10000000\n fail ArgumentError, 'invalid value for \"opts[:\"page\"]\" when calling SubscriptionApi.get_subscriptions, must be smaller than or equal to 10000000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"page\"]\" when calling SubscriptionApi.get_subscriptions, must be greater than or equal to 1.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100\n fail ArgumentError, 'invalid value for \"opts[:\"size\"]\" when calling SubscriptionApi.get_subscriptions, must be smaller than or equal to 100.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"size\"]\" when calling SubscriptionApi.get_subscriptions, must be greater than or equal to 1.'\n end\n\n # resource path\n local_var_path = \"/v1/subscription\"\n\n # query parameters\n query_params = {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?\n query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['basicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SubscriptionSearch')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SubscriptionApi#get_subscriptions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def subscriptions\n\t\t@subscriptions = current_user.customer.subjects\n\tend", "def index\n @subscriptions = nil #the load_and_authorize_resource cancan method is loading all the subscriptions and we want to start with a clean slate here.\n if params[:company_id]\n @owner = Company.find(params[:company_id])\n @subscriptions = Subscription.where(owner_type: 'Company', owner_id: params[:company_id])\n end\n if params[:person_id]\n @owner = Person.find(params[:person_id])\n @subscriptions ||= Subscription.where(owner_type: 'Person', owner_id: params[:person_id])\n end\n \n @subscriptions ||= Subscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subscriptions }\n end\n end", "def subscriptions\n ::Syncano::QueryBuilder.new(self, ::Syncano::Resources::Subscription)\n end", "def subscription_info(subscription_id = @subscription_id)\n url = url_with_api_version(@base_url, 'subscriptions', subscription_id)\n resp = rest_get(url)\n JSON.parse(resp.body)\n end", "def index\n @subscriptions = @user.subscriptions.order(updated_at: :desc)\n end", "def get_subscription(subscription_id)\n get(url_(\"subscription\", subscription_id))\n end", "def index\n\n if @notification\n json_response(@notification.user_subscriptions)\n end\n if request.path_parameters.has_key?(:user_id)\n json_response(@user.user_subscriptions)\n end\n end", "def index\n @subscriptions = Subscription.all\nend", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def index\n session[:sub_delete_return_to] = request.fullpath\n @subscriptions = Subscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subscriptions }\n end\n end", "def subscription\n ret = nil\n if type == 'S'\n ret = @mc2p.subscription('id' => @json_body['id'])\n ret.retrieve\n end\n ret\n end", "def subscriptions\n @subscriptions ||= get_roster || {}\n end", "def index\n @panel_subscriptions = Panel::Subscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @panel_subscriptions }\n end\n end", "def index\n @subscriptions = @screen.subscriptions.all\n auth!\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @subscriptions }\n end\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @subscription }\n end\n end", "def get_subscription subscription_name, options = {}\n subscriber.get_subscription subscription: subscription_path(subscription_name, options)\n end", "def show\n @list_subscription = ListSubscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list_subscription }\n end\n end", "def new\n @subscription = current_user.subscriptions.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def subscription(repo, options = {})\n get \"#{Repository.path repo}/subscription\", options\n end", "def show_subscriptions\n puts \"\\nYour current subscriptions are:\"\n @user.subscriptions.reload.each do |sub|\n puts sub.name\n end\n end", "def index\n @admin_subscriptions = Subscription.all\n end", "def subscriptions\n iq = connection.iq_stanza({'to'=>jid.bare},\n x('pubsub',{:xmlns => EM::Xmpp::Namespaces::PubSubOwner},\n x('subscriptions',:node => node_id)\n )\n )\n send_iq_stanza_fibered iq\n end", "def index\n @subscriptions = Subscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @subscriptions }\n end\n end", "def index\n @subscriptions = Subscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @subscriptions }\n end\n end", "def index\n\t\tindex_\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.xml { render :xml => @subscriptions }\n\t\tend\n\tend", "def service_subscriptions\n iq = connection.iq_stanza({'to'=>jid.bare},\n x('pubsub',{:xmlns => EM::Xmpp::Namespaces::PubSub},\n x('subscriptions')\n )\n )\n send_iq_stanza_fibered iq\n end", "def subscriptions()\n return MicrosoftGraph::Subscriptions::SubscriptionsRequestBuilder.new(@path_parameters, @request_adapter)\n end", "def subscribe\n Socky.send( {:action => \"subscribe\",\n :channel => params[:channel],\n :client => (params[:client_id] || '')}.to_json)\n render :text => \"ok\"\n end", "def all_subscriptions(&block)\n subscriptions.list(&block)\n end", "def subscription(options = {})\n Subscription.new(options.merge(:url => url)).to_hash\n end", "def index\n @vendor_subscriptions = VendorSubscription.all\n end", "def subscriber_list(statuspage_id)\n request :method => :get,\n :url => @url + 'subscriber/list/' + statuspage_id\n end", "def subscription\n Zapi::Models::Subscription.new\n end", "def subscribed(params = {})\n @api.get(\"#{@api.path}/List/#{@id}/Recipients/Subscribed\", params: params)\n end", "def subscriptions; end", "def subscriptions; end", "def subscriptions; end", "def index\n if @view = params[:view].allow(ALLOWED_VIEW)\n unless @subscriptions = Subscription.try(@view)\n raise_404\n end\n else\n @subscriptions = Subscription.all\n end\n end", "def subscription(id)\n Sensit::Api::Subscription.new id, @http_client\n end", "def subscriptions\n @channels\n end", "def index\n @misuration_subscriptions = current_user.misuration_subscriptions.all\n end", "def index\n @subscriptions = @screen.subscriptions.where(field_id: @field.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @subscriptions }\n end\n end", "def subscriptions\n # subscriber entries are embedded in subscriptions inside of an\n # org. We'll flip this, so that we only return subscriber entries\n # for the account\n orgs = Org.all(:conditions=>{ \"subscriptions.subscribers.account_id\"=> self.id})\n subscribers = []\n orgs.each do |org|\n org.subscriptions.each do |subscription|\n subscribers += subscription.subscribers.select { |subscriber| subscriber.account_id.to_s == self.id.to_s }\n end\n end\n subscribers.flatten!\n subs = []\n subscribers.each do |subscriber|\n subscript = subscriber.subscription\n org = subscript.org\n subs << AccountSubscription.new(org.id.to_s, org.name, subscript.product, subscript.billing_level, subscriber.role)\n end\n subs\n end", "def list_topics_subscriptions topic, options = {}\n publisher.list_topic_subscriptions topic: topic_path(topic, options),\n page_size: options[:max],\n page_token: options[:token]\n end", "def all\n get(\"#{domain}/unsubscribes\")\n end", "def index\n @user_to_channel_subscriptions = UserToChannelSubscription.all\n end", "def get_subscription\n @subscriptions = Subscription.all\n @my_subscription = current_user.user_subscriptions.includes(:subscription).where(\"user_subscriptions.id = ? and user_subscriptions.status = ?\", params[:id], \"active\").first\n\n if @my_subscription.blank?\n\n respond_to do |format|\n format.html{ flash[:error] = \"Sorry, You are not authorized for this subscription.\" }\n format.js{ render js: %{location.reload();} }\n end\n\n redirect_to main_app.profile_users_path and return\n end\n\n end", "def get_all_subscriptions(opts = {})\n data, _status_code, _headers = get_all_subscriptions_with_http_info(opts)\n return data\n end", "def subscribed_subreddits(options = {})\n options = options.clone\n\n category = options[:category] or 'subscriber'\n path = \"subreddits/mine/#{category}.json\"\n options.delete :category\n\n objects_from_response(:get, path, options)\n end", "def subscriber(id_or_email)\n make_json_api_request :get, \"v2/#{account_id}/subscribers/#{CGI.escape id_or_email}\"\n end", "def get(subscription_key)\n args = ZAPIArgs.new\n args.uri = Resource_Endpoints::GET_SUBSCRIPTION.gsub(\"{subscription-key}\", ERB::Util.url_encode(subscription_key))\n\n puts \"========== GET A SUBSCRIPTION ============\"\n\n begin\n @z_client.get(args) do |resp|\n ap resp\n return resp if resp.httpStatusCode.to_i == 200 && resp.success\n end\n rescue ArgumentError => e\n puts e.message\n rescue RuntimeError => e\n puts e.message\n end\n\n nil\n end", "def index\n @category_subscriptions = CategorySubscription.all\n end" ]
[ "0.8178023", "0.8074406", "0.79446816", "0.76912534", "0.7649479", "0.7582659", "0.75117826", "0.74919003", "0.7431205", "0.7413858", "0.7406451", "0.7406451", "0.7404672", "0.738646", "0.73743445", "0.73743445", "0.73651445", "0.7320728", "0.7301819", "0.72662437", "0.7265766", "0.7195162", "0.7184147", "0.7113955", "0.7113955", "0.7113955", "0.71054554", "0.7095867", "0.7078698", "0.7072534", "0.7031681", "0.7025772", "0.7025772", "0.7025772", "0.7025772", "0.7020045", "0.70176184", "0.7016675", "0.6999992", "0.6988425", "0.69846886", "0.6976334", "0.69742465", "0.69500417", "0.6939474", "0.6935429", "0.690636", "0.68932086", "0.68874836", "0.6886437", "0.6856487", "0.6844775", "0.6840027", "0.6822336", "0.6818025", "0.6811951", "0.68116045", "0.6803229", "0.67462087", "0.67418385", "0.6721472", "0.67172396", "0.669867", "0.66753066", "0.667493", "0.66451836", "0.66382444", "0.6633636", "0.66244644", "0.6604636", "0.65986145", "0.65986145", "0.6588578", "0.65870994", "0.65748864", "0.65720755", "0.65663576", "0.65495396", "0.6542188", "0.65269655", "0.65197796", "0.6517936", "0.6505175", "0.6505175", "0.6505175", "0.64954746", "0.6490323", "0.646959", "0.64678687", "0.6466212", "0.6464444", "0.6449097", "0.6438768", "0.6434516", "0.6429372", "0.6405555", "0.6404456", "0.6381319", "0.63799196", "0.6373272" ]
0.6472775
87
GET /subscriptions/1 GET /subscriptions/1.json
def show @subscription = current_user.subscriptions.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @subscription } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subscriptions\n url = url_with_api_version(@base_url, 'subscriptions')\n resp = rest_get(url)\n JSON.parse(resp.body)[\"value\"]\n end", "def list_subscriptions(user)\n get(\"/#{user}/lists/subscriptions.json\")\n end", "def all_subscriptions\n get(url_(\"subscription\"))\n end", "def list_my_subscriptions() path = \"/api/v2/utilities/subscriptions\"\n get(path, {}, AvaTax::VERSION) end", "def index\n @subscriptions = current_user.subscriptions.order(:created_at)\n @user = current_user\n\n if not current_user.fitbit.nil?\n begin\n @fitbit_subscriptions = JSON.parse(current_user.fitbit.client.get('/1/user/-/apiSubscriptions.json').body)['apiSubscriptions']\n rescue SocketError\n logger.error \"Can not talk to fitbit\"\n end\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subscriptions }\n end\n end", "def get_subscriptions(id:, order: nil)\n if order\n get_json(\"#{endpoint}/subscribers/#{uri_encode(id)}/subscriptions?order=#{uri_encode(order)}\")\n else\n get_json(\"#{endpoint}/subscribers/#{uri_encode(id)}/subscriptions\")\n end\n end", "def get_subscriptions(id:, order: nil)\n if order\n get_json(\"#{endpoint}/subscribers/#{uri_encode(id)}/subscriptions?order=#{uri_encode(order)}\")\n else\n get_json(\"#{endpoint}/subscribers/#{uri_encode(id)}/subscriptions\")\n end\n end", "def user_vendor_subscriptions\n get(\"/api/v1/oauth_user_vendor_subscriptions.json\")\n end", "def show\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def show\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def show\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def show\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def show\n @subscription = Subscription.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def show\r\n @subscription = Subscription.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @subscription }\r\n end\r\n end", "def index\n if params[:client_id].blank?\n @subscriptions = Subscription.all\n else\n @subscriptions = Client.find(params[:client_id]).subscriptions\n end\n end", "def index\n @subscriptions = Subscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subscriptions }\n end\n end", "def get(incoming={})\n opts = HttpClient::Helper.symbolize_keys(incoming)\n query = {\n :guid => HttpClient::Preconditions.assert_class_or_nil('guid', HttpClient::Helper.to_uuid(opts.delete(:guid)), String),\n :organization_key => HttpClient::Preconditions.assert_class_or_nil('organization_key', opts.delete(:organization_key), String),\n :user_guid => HttpClient::Preconditions.assert_class_or_nil('user_guid', HttpClient::Helper.to_uuid(opts.delete(:user_guid)), String),\n :publication => HttpClient::Preconditions.assert_class_or_nil('publication', opts[:publication].nil? ? nil : (opts[:publication].is_a?(Apidoc::Models::Publication) ? opts.delete(:publication) : Apidoc::Models::Publication.apply(opts.delete(:publication))), Apidoc::Models::Publication),\n :limit => HttpClient::Preconditions.assert_class_or_nil('limit', opts.delete(:limit), Integer),\n :offset => HttpClient::Preconditions.assert_class_or_nil('offset', opts.delete(:offset), Integer)\n }.delete_if { |k, v| v.nil? }\n @client.request(\"/subscriptions\").with_query(query).get.map { |hash| Apidoc::Models::Subscription.new(hash) }\n end", "def get_subscription(subscription_id)\n get(url_(\"subscription\", subscription_id))\n end", "def index\r\n @subscriptions = current_business_user.subscriptions.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @subscriptions }\r\n end\r\n end", "def index\n @api_subscriptions = Api::Subscription.all\n end", "def subscription\n ret = nil\n if type == 'S'\n ret = @mc2p.subscription('id' => @json_body['id'])\n ret.retrieve\n end\n ret\n end", "def show\n json_response(@user_subscription)\n end", "def index\n @subscriptions = current_user.subscriptions.all\n end", "def list_subscription\n response = Faraday.get(@subscription_api_url)\n response_json = JSON.parse(response.body)\n fix_response(response_json)\n end", "def index\n @my_subscriptions = current_user.active_subscriptions\n end", "def index\n @subscriptions = Subscription.where(:binder_id => params[:binder_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subscriptions }\n end\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end", "def subscriptions( params={} )\n subscriptions = get_connections(\"subscriptions\", params)\n return map_connections subscriptions, :to => Facebook::Graph::Subscription\n end", "def index\n @subscriptions = Subscription.all\n end", "def index\n @subscriptions = Subscription.all\n end", "def index\n @subscriptions = Subscription.all\n end", "def get_subscription subscription_name, options = {}\n subscriber.get_subscription subscription: subscription_path(subscription_name, options)\n end", "def list_subs\n \t@subs = instagram_client.subscriptions\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @subscription }\n end\n end", "def subscription_info(subscription_id = @subscription_id)\n url = url_with_api_version(@base_url, 'subscriptions', subscription_id)\n resp = rest_get(url)\n JSON.parse(resp.body)\n end", "def subscriptions(page = 1)\n Dropio::Resource.client.subscriptions(self, page)\n end", "def show_single_webhook_subscription(id,opts={})\n query_param_keys = [\n \n\n ]\n\n form_param_keys = [\n \n\n ]\n\n # verify existence of params\n raise \"id is required\" if id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :id => id\n\n )\n\n # resource path\n path = path_replace(\"/lti/subscriptions/{id}\",\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_query_params(options, query_param_keys)\n\n response = mixed_request(:get, path, query_params, form_params, headers)\n response\n \n\n end", "def new\n @subscription = current_user.subscriptions.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def show\n @list_subscription = ListSubscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list_subscription }\n end\n end", "def subscriptions\n update_subscriptions(params[:types]) if params[:types]\n @types = build_notification_types\n render :json => @types\n end", "def subscriptions(user_id)\n response = rest_client.get(signature_url(\"/subscription/?user_id=#{user_id}\"))\n process_response(response)\n end", "def index\n @crytosubscriptions = Crytosubscription.all\n end", "def index\n\n @category_subscriptions = CategorySubscription.all\n\n render json: @category_subscriptions\n\n end", "def index\n\n if @notification\n json_response(@notification.user_subscriptions)\n end\n if request.path_parameters.has_key?(:user_id)\n json_response(@user.user_subscriptions)\n end\n end", "def subscription(id)\n Sensit::Api::Subscription.new id, @http_client\n end", "def subscription\n Zapi::Models::Subscription.new\n end", "def subscribe\n Socky.send( {:action => \"subscribe\",\n :channel => params[:channel],\n :client => (params[:client_id] || '')}.to_json)\n render :text => \"ok\"\n end", "def show_subscriptions\n puts \"\\nYour current subscriptions are:\"\n @user.subscriptions.reload.each do |sub|\n puts sub.name\n end\n end", "def index\n session[:sub_delete_return_to] = request.fullpath\n @subscriptions = Subscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subscriptions }\n end\n end", "def list_subscriptions(options = {})\n api.graph_call(subscription_path, {}, \"get\", options)\n end", "def subscriptions\n @subscriptions ||= {}\n end", "def index\n if is_client_app?\n if params[:user_id].present?\n t = Subscription.arel_table\n s = Subscription.statuses\n @subscriptions = Subscription.where(user_id: params[:user_id]).where(t[:status].eq(s[:authorized]).or(t[:status].eq(s[:paused])))\n else\n @subscriptions = Subscription.all\n end\n\n render json: @subscriptions\n else\n response.headers['X-Total-Count'] = @subscriptions.count.to_s\n @subscriptions = @subscriptions.page(params[:page]) if params[:page].present?\n @subscriptions = @subscriptions.per(params[:per]) if params[:per].present?\n\n _render collection: @subscriptions, flag: params[:flag].try(:to_sym)\n end\n end", "def get_subscriptions_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SubscriptionApi.get_subscriptions ...\"\n end\n if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 10000000\n fail ArgumentError, 'invalid value for \"opts[:\"page\"]\" when calling SubscriptionApi.get_subscriptions, must be smaller than or equal to 10000000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"page\"]\" when calling SubscriptionApi.get_subscriptions, must be greater than or equal to 1.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100\n fail ArgumentError, 'invalid value for \"opts[:\"size\"]\" when calling SubscriptionApi.get_subscriptions, must be smaller than or equal to 100.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"size\"]\" when calling SubscriptionApi.get_subscriptions, must be greater than or equal to 1.'\n end\n\n # resource path\n local_var_path = \"/v1/subscription\"\n\n # query parameters\n query_params = {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?\n query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['basicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SubscriptionSearch')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SubscriptionApi#get_subscriptions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n @subscription_request = SubscriptionRequest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription_request }\n end\n end", "def get_all_subscriptions_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SubscriptionsApi.get_all_subscriptions ...\"\n end\n # resource path\n local_var_path = \"/subscriptions\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'uid'] = opts[:'uid'] if !opts[:'uid'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'count'] = opts[:'count'] if !opts[:'count'].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\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['artikcloud_oauth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SubscriptionsEnvelope')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SubscriptionsApi#get_all_subscriptions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @subscriptions = Subscription.all\nend", "def subscriptions\n @subscriptions ||= begin\n resp = @client.access_token.get('/reader/api/0/subscription/list?output=json')\n raise \"unable to retrieve the list of subscription for user \\\"#{user_id}\\\": #{resp.inspect}\" unless resp.code_type == Net::HTTPOK\n JSON.parse(resp.body)['subscriptions'].collect do |hash|\n Google::Reader::Subscription.new(hash.merge({:client => @client}))\n end\n end\n end", "def get(subscription_key)\n args = ZAPIArgs.new\n args.uri = Resource_Endpoints::GET_SUBSCRIPTION.gsub(\"{subscription-key}\", ERB::Util.url_encode(subscription_key))\n\n puts \"========== GET A SUBSCRIPTION ============\"\n\n begin\n @z_client.get(args) do |resp|\n ap resp\n return resp if resp.httpStatusCode.to_i == 200 && resp.success\n end\n rescue ArgumentError => e\n puts e.message\n rescue RuntimeError => e\n puts e.message\n end\n\n nil\n end", "def user_subscriptions(user_id, options={})\n response = connection.get do |req|\n req.url \"/user/#{user_id}/subscriptions\", simple_params(options)\n end\n response.body\n end", "def index\n @subscriptions = @user.subscriptions.order(updated_at: :desc)\n end", "def get_subscription\n @subscriptions = Subscription.all\n @my_subscription = current_user.user_subscriptions.includes(:subscription).where(\"user_subscriptions.id = ? and user_subscriptions.status = ?\", params[:id], \"active\").first\n\n if @my_subscription.blank?\n\n respond_to do |format|\n format.html{ flash[:error] = \"Sorry, You are not authorized for this subscription.\" }\n format.js{ render js: %{location.reload();} }\n end\n\n redirect_to main_app.profile_users_path and return\n end\n\n end", "def retrieve_subscription(subscription_id:,\n include: nil)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::GET,\n '/v2/subscriptions/{subscription_id}',\n 'default')\n .template_param(new_parameter(subscription_id, key: 'subscription_id')\n .should_encode(true))\n .query_param(new_parameter(include, key: 'include'))\n .header_param(new_parameter('application/json', key: 'accept'))\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end", "def get_subscriptions\n get_subscriptions_from(@nodename)\n end", "def subscription(repo, options = {})\n get \"#{Repository.path repo}/subscription\", options\n end", "def get_subscriptions(opts = {})\n data, _status_code, _headers = get_subscriptions_with_http_info(opts)\n return data\n end", "def index\n @panel_subscriptions = Panel::Subscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @panel_subscriptions }\n end\n end", "def index\n @subscriptions = nil #the load_and_authorize_resource cancan method is loading all the subscriptions and we want to start with a clean slate here.\n if params[:company_id]\n @owner = Company.find(params[:company_id])\n @subscriptions = Subscription.where(owner_type: 'Company', owner_id: params[:company_id])\n end\n if params[:person_id]\n @owner = Person.find(params[:person_id])\n @subscriptions ||= Subscription.where(owner_type: 'Person', owner_id: params[:person_id])\n end\n \n @subscriptions ||= Subscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subscriptions }\n end\n end", "def index\n @q = ::Pushar::Core::Subscription.unscoped.search(params[:q])\n @q.sorts = 'created_at desc' if @q.sorts.empty?\n @subscriptions = @q.result(distinct: true).page(params[:page]).per(50)\n end", "def show\n @subscriber = Subscriber.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscriber }\n end\n end", "def show\n @subscriber = Subscriber.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscriber }\n end\n end", "def show\n @subscriber = Subscriber.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscriber }\n end\n end", "def show\n\n @subscriber = Subscriber.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscriber }\n end\n end", "def subscription\n subscriptions.last\n end", "def index\n # TODO pull out api key before pushing to github & pull out binding prys\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 subId = message[:data][0][:id]\n else\n # Port is open in our router\n params = { url: SUBSCRIPTION_URL, events: ['invitee.created', 'invitee.canceled'] }\n newRes = HTTParty.post URL, body: params, headers: HEADERS\n message = JSON.parse newRes.body, symbolize_names: true\n # TODO need error handling\n subId = message[:id]\n end\n end\n end", "def index\n @subscriptions = Subscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @subscriptions }\n end\n end", "def index\n @subscriptions = Subscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @subscriptions }\n end\n end", "def new\r\n @subscription = Subscription.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @subscription }\r\n end\r\n end", "def index\n @subscriptions = @screen.subscriptions.all\n auth!\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @subscriptions }\n end\n end", "def subscriber_list(statuspage_id)\n request :method => :get,\n :url => @url + 'subscriber/list/' + statuspage_id\n end", "def index\n @subscriptions = @screen.subscriptions.where(field_id: @field.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @subscriptions }\n end\n end", "def subscriber(id_or_email)\n make_json_api_request :get, \"v2/#{account_id}/subscribers/#{CGI.escape id_or_email}\"\n end", "def show\n @subscription = Subscription.find(params[:id])\n @product_subscription = ProductSubscription.new\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @subscription }\n end\n end", "def show\n @panel_subscription = Panel::Subscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @panel_subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def subscription(options = {})\n Subscription.new(options.merge(:url => url)).to_hash\n end", "def subscriptions; end", "def subscriptions; end", "def subscriptions; end", "def index\n @admin_subscriptions = Subscription.all\n end", "def show\n @product_subscription = ProductSubscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @product_subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @subscription }\n end\n end", "def show\n render json: @event_subscription\n end", "def index\n\t\tindex_\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.xml { render :xml => @subscriptions }\n\t\tend\n\tend", "def getAllSubscriptions\n if @subscriptionLists.hasKey(\"subscriptions\")\n return @subscriptionLists.getRepositoryObject(\"subscriptions\").getObject\n end\n end", "def fetch_subscription(_params) \n subscription_id = _params['subscription_id']\n if subscription_id.blank? == true \n return false\n end \n begin\n result = ChargeBee::Subscription.retrieve(subscription_id)\n session[:subscription_id] = result.subscription.id\n session[:customer_id] = result.customer.id\n return true\n rescue ChargeBee::APIError => e\n if e.api_error_code == \"resource_not_found\"\n return false\n end\n throw e\n end\n end" ]
[ "0.7863251", "0.75726175", "0.7567996", "0.74486554", "0.734854", "0.73362416", "0.73362416", "0.72566754", "0.7242567", "0.7242567", "0.7242567", "0.7242567", "0.7234481", "0.7231595", "0.7203714", "0.71969527", "0.71899897", "0.7187209", "0.71870315", "0.711318", "0.70950603", "0.7082423", "0.7060377", "0.6973603", "0.69719666", "0.69619215", "0.696152", "0.6906217", "0.6900038", "0.6900038", "0.6900038", "0.6895415", "0.6874827", "0.6862697", "0.6858457", "0.6856422", "0.6851238", "0.6823961", "0.68203557", "0.68178785", "0.6781567", "0.677967", "0.67617476", "0.67599726", "0.67449135", "0.67446285", "0.6733885", "0.67262095", "0.67227983", "0.6694661", "0.6689392", "0.6689059", "0.6683082", "0.6680209", "0.6680048", "0.6671432", "0.6669847", "0.664933", "0.66476315", "0.6645022", "0.6621229", "0.6619605", "0.6609451", "0.66014886", "0.6563858", "0.65636194", "0.656227", "0.65251046", "0.65084636", "0.65084636", "0.65084636", "0.6507569", "0.64974153", "0.64810157", "0.6480742", "0.6480742", "0.6478299", "0.6469003", "0.6458722", "0.645692", "0.645649", "0.64495987", "0.6449502", "0.6448456", "0.6448456", "0.6448456", "0.6448456", "0.6448456", "0.6439214", "0.64347833", "0.64347833", "0.64347833", "0.6429507", "0.64251405", "0.64228565", "0.6418859", "0.640681", "0.64016455", "0.63941866" ]
0.7584557
2
GET /subscriptions/new GET /subscriptions/new.json
def new @subscription = current_user.subscriptions.new respond_to do |format| format.html # new.html.erb format.json { render json: @subscription } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\r\n @subscription = Subscription.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @subscription }\r\n end\r\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @subscription }\n end\n end", "def new\n @subscription_request = SubscriptionRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription_request }\n end\n end", "def new\n @breadcrumb = 'create'\n @subscriber = Subscriber.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscriber }\n end\n end", "def new\n @subscription = Subscription.new(binder_id: params[:binder_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @subscriber = Subscriber.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscriber }\n end\n end", "def new\n @subscriber = Subscriber.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscriber }\n end\n end", "def new\n @subscriber = Subscriber.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscriber }\n end\n end", "def new\n @list_subscription = ListSubscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @list_subscription }\n end\n end", "def new\n @newsletter_subscription = NewsletterSubscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newsletter_subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @subscription }\n end\n end", "def new\n @subscription = Subscription.new\n end", "def new\n if session[:user_id] \n @subscription = Subscription.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @subscription }\n end\n end\n end", "def create\n @subscription = Subscription.new(subscription_params)\n\n if @subscription.save\n render json: @subscription, status: :created, location: @subscription\n else\n render json: @subscription.errors, status: :unprocessable_entity\n end\n end", "def new\n @subscription = Subscription.new\n @subscription.confirmed = true\n get_list_and_segments\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @subscription }\n end\n end", "def create_new_subscription\n @subscription_offers = Subscription.get_subscription_list\n end", "def new\n @subscriber = Subscriber.new\n @subscriber.account = @account\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscriber }\n end\n end", "def create\n @subscription = Subscription.new(subscription_params)\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to root_url, notice: 'Subscription was successfully created.' }\n format.json { render action: 'show', status: :created, location: @subscription }\n else\n format.html { render action: 'new' }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n megam_rest.post_subscriptions(to_hash)\n end", "def create\n @subscription = Subscription.new(subscription_params)\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription, notice: (I18n.t :subscription_created) }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @panel_subscription = Panel::Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @panel_subscription }\n end\n end", "def new\n \n @subscription = Subscription.new(:transaction_id => params[:transaction_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @subscription }\n end\n end", "def create\n s_params = params[:subscription]\n s_params.delete(:id)\n @subscription = Subscription.new(s_params)\n @subscription.save\n respond_with(@subscription)\n end", "def create\n @subscription = Subscription.new(subscription_params)\n @subscription.user = current_user\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription, notice: t('controller.successfully_created', model: t('activerecord.models.subscription')) }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @product_subscription = ProductSubscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @product_subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n @owner = Company.find(params[:company_id]) if params[:company_id]\n @owner = Person.find(params[:person_id]) if params[:person_id]\n\n @subscription.owner = @owner\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @service = Service.find_by_id(params[:service_id]) or redirect_to services_path\n \n @service_subscription = @service.subscriptions.build()\n @service_subscription.user_id = current_user.id\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @service_subscription }\n end\n end", "def new\n @subscription_group = SubscriptionGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription_group }\n end\n end", "def create\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription.transaction, notice: 'Subscription was successfully created.' }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @subscription_type = SubscriptionType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @subscription_type }\n end\n end", "def new\n\t\t@subscription = Subscription.new(user: current_user)\n\t\t@ingroups = Group.all\n\t\t@inprojects = Project.all\n\t\t@fortypesobjects = Typesobject.get_from_observer\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml { render :xml => @subscription }\n\t\tend\n\tend", "def create\n @subscription = Subscription.new(params[:subscription])\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to campaign_subscription_path(@campaign, @subscription), :notice => 'Subscription was successfully created.' }\n format.json { render :json => @subscription, :status => :created, :location => @subscription }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\n @subscription_history = SubscriptionHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @subscription_history }\n end\n end", "def create\n @subscription = @target.create_subscription(subscription_params)\n return_back_or_ajax\n end", "def create\n # params[:id] is the knowmadics id\n\n @api_subscription = Api::Subscription.new(api_subscription_params)\n\n respond_to do |format|\n if @api_subscription.save\n format.html { redirect_to @api_subscription, notice: 'Subscription was successfully created.' }\n format.json { render :show, status: :created, location: @api_subscription }\n else\n format.html { render :new }\n format.json { render json: @api_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @subscription = Subscription.new(params[:subscription])\n\n if params.has_key?(:new_service_id)\n service = Service.find(params[:new_service_id])\n unless service.nil?\n @subscription.service_id = service.id\n @subscription.costs = service.costs\n @subscription.user_id = current_user.id\n end\n end\n\n respond_to do |format|\n if @subscription.save\n flash[:success] = \"Subscription was successfully created.\"\n format.html { redirect_to @subscription }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n unless service.nil?\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n else\n flash[:error] = \"Subscription was not successful.\"\n format.html redirect_to services_path\n end\n end\n end\n end", "def create\n if session[:user_id] \n user = User.find(session[:user_id])\n s = Subscription.new\n s.url = params[:subscription][:url]\n s.title = params[:subscription][:title]\n s.user = user\n @subscription = s\n \n respond_to do |format|\n if @subscription.save\n format.html { redirect_to(@subscription, :notice => 'Subscription was successfully created.') }\n format.xml { render :xml => @subscription, :status => :created, :location => @subscription }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end\n end", "def create\n @subscription = Subscription.new(subscription_params)\n\n respond_to do |format|\n if @subscription.save\n record_activity :create, @subscription\n format.html { redirect_to edit_subscription_path(@subscription),\n notice: 'Subscription was successfully created.' }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @subscription = Subscription.new\n @subscription.screen = @screen\n @subscription.field = @field\n auth!\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @subscription }\n end\n end", "def create\n @panel_subscription = Panel::Subscription.new(params[:panel_subscription])\n\n respond_to do |format|\n if @panel_subscription.save\n format.html { redirect_to(@panel_subscription, :notice => 'Subscription was successfully created.') }\n format.json { render :json => @panel_subscription, :status => :created, :location => @panel_subscription }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @panel_subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @subscription = Subscription.new(params[:subscription])\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to Binder.find(@subscription.binder_id), notice: 'Subscription was successfully created.' }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @panel_subscription_transaction = Panel::SubscriptionTransaction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @panel_subscription_transaction }\n end\n end", "def create\n @subscription = Subscription.create(params[:subscription])\n gb = Gibbon::API.new(\"6f8672a5c2393d1441c54d3be3fb79a1-us1\")\n gb.lists.subscribe({:id => \"c0ca5b3d41\", :email => {:email => params[:subscription][:email]}, :merge_vars => {:FNAME => '', :LNAME => ''}, :double_optin => false})\n end", "def create\n\t\t@subscription = Subscription.new(params[:subscription])\n\t\trespond_to do |format|\n\t\t\tif fonct_new_dup?\n\t\t\t\tobject_orig=Subscription.find(params[:object_orig_id])\n\t\t\tst = @subscription.create_duplicate(object_orig)\n\t\t\telse\n\t\t\tst = @subscription.save\n\t\t\tend\n\t\t\tif st\n\t\t\t\t#format.html { redirect_to(@subscription, :notice => 'Subscription was successfully created.') }\n\t\t\t\tflash[:notice] = 'Subscription was successfully created.'\n\t\t\t\tparams[:id]= @subscription.id\n\t\t\t\tshow_\n\t\t\t\tformat.html { render :action => \"show\" }\n\t\t\t\tformat.xml { render :xml => @subscription, :status => :created, :location => @subscription }\n\t\t\telse\n\t\t\t\t@ingroups = Group.all\n\t\t\t\t@inprojects = Project.all\n\t\t\t\t@fortypesobjects=Typesobject.get_from_observer\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def create_subscriptions\n Subscription.create_subscriptions(self.id, self.hashtag)\n end", "def create\n @subscription_new_main = SubscriptionNewMain.new(subscription_new_main_params)\n\n respond_to do |format|\n if @subscription_new_main.save\n format.html { redirect_to @subscription_new_main, notice: 'Subscription new main was successfully created.' }\n format.json { render :show, status: :created, location: @subscription_new_main }\n else\n format.html { render :new }\n format.json { render json: @subscription_new_main.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @subscription = current_user.subscriptions.new\n manga = Manga.find(params[:manga_id])\n\t\[email protected]_id=manga.id\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to mangas_path, notice: 'Successfully subscribed to '+ manga.display_name.to_s}\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @subscription = Subscription.new(subscription_params)\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to thanks_path, notice: 'Subscription was successfully created.' }\n else\n format.html { redirect_to root_path }\n end\n end\n end", "def new\n @newsletter = Newsletter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newsletter }\n end\n end", "def new\n @subtopic = Subtopic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subtopic }\n end\n end", "def create\n @subscribe = Subscribe.new(subscribe_params)\n\n respond_to do |format|\n if @subscribe.save\n format.html { redirect_to @subscribe, notice: t('controller.successfully_created', model: t('activerecord.models.subscribe')) }\n format.json { render json: @subscribe, status: :created, location: @subscribe }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscribe.errors, status: :unprocessable_entity }\n end\n end\n end", "def create / update_subscriptions\n end", "def create\n @subscription = Subscription.new(params[:subscription])\n\n respond_to do |format|\n\t\n if @subscription.valid? && @subscription.save\n\t SubscriptionMailer.delay.send_welcome(@subscription)\n\t \n format.html { redirect_to \"/subscriptions/done\", notice: 'Twoj adres zostal dodany do listy mailingowej' }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @subscription_type = SubscriptionType.new(subscription_type_params)\n\n respond_to do |format|\n if @subscription_type.save\n format.html { redirect_to @subscription_type, notice: 'Subscription types was successfully created.' }\n format.json { render :show, status: :created, location: @subscription_type }\n else\n format.html { render :new }\n format.json { render json: @subscription_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @launchsubscriber = Launchsubscriber.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @launchsubscriber }\n end\n end", "def new\n @published = Published.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @published }\n end\n end", "def new\n @transcription = Transcription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @transcription }\n end\n end", "def create\r\n @subscription = Subscription.new(subscription_params)\r\n @subscription.business_user_id = current_business_user.id\r\n respond_to do |format|\r\n if @subscription.save\r\n format.html { redirect_to business_user_subscriptions_path, notice: 'Subscription was successfully created.' }\r\n format.json { render json: @subscription, status: :created, location: @subscription }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def create\n @subscriber = Subscriber.new(subscriber_params)\n\n respond_to do |format|\n if @subscriber.save\n format.html { redirect_to root_path, notice: 'Thank You For Subscribing!' }\n format.json { render :show, Subscribe.create(subscriber_params)}\n else\n format.html { redirect_to root_path, notice: 'There was a problem with the subscription' }\n format.json { render :json => @subscriber.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @subscription_request = SubscriptionRequest.new(params[:subscription_request])\n\n respond_to do |format|\n if @subscription_request.save\n format.html { redirect_to @subscription_request, notice: 'Subscription request was successfully created.' }\n format.json { render json: @subscription_request, status: :created, location: @subscription_request }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n@subscription = current_user.subscriptions.build(subscription_params)\n\nrespond_to do |format|\n if @subscription.save\n\n format.html { redirect_to user_profile_url(current_user.id), notice: 'Pet was successfully created.' }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\nend\nend", "def create\n @categories = Category.all\n @subscription = Subscription.new(subscription_params)\n respond_to do |format|\n if @subscription.save\n\t @subscription.update(ordinal: Subscription.count)\n SubscriptionMailer.with(subscription: @subscription, new: \"true\").notification_email.deliver_now\n format.html { render :subscription_judging, notice: '加盟店サブスクショップの審査申請しました' }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @list_subscription = ListSubscription.new(params[:list_subscription])\n\n respond_to do |format|\n if @list_subscription.save\n format.html { redirect_to @list_subscription, notice: 'List subscription was successfully created.' }\n format.json { render json: @list_subscription, status: :created, location: @list_subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @list_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n # trying to implement a new way of updating the table\n # Subscribe.update_sub(@item, @user)\n # creating a new subscribe and saving it into the table\n @subscribe = Subscribe.new(:item_id => @item.id, :user_id => @user.id)\n respond_to do |format|\n if @subscribe.save\n format.html { redirect_to @item, notice: 'Subscribe was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @subscribe.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @subscription = Subscription.new\n\n # Check to see if the logged in user has a subscription already\n @subplan = Subscription.where(user_id: current_user.id).first\n\n if @subplan.present?\n # Subscription plan is active\n redirect_to subscription_url(@subplan)\n\n elsif current_user.account.present?\n # We have an account for signing up a subscription\n\n @subscription.subscribe(current_user.account, params[:plan_id], coupon: params[:coupon_code])\n else\n # No account and no subscription plan - Redirect to update\n # user account with notice to add credit card.\n redirect_to new_user_account_url(current_user.id)\n end\n end", "def create \n @subscription = Subscription.new(params[:subscription])\n \n uri = URI.parse(request.env[\"HTTP_REFERER\"])\n unless %w{ app.atra.obra.org localhost app.americantrackracing.com raceatra.com www.raceatra.com}.include?(uri.host)\n flash[:notice] = \"Cannot send request from '#{uri.host}'\"\n return render(:action => \"new\")\n end\n\n if @subscription.valid?\n email = SubscriptionMailer.create_subscription_request(@subscription)\n SubscriptionMailer.deliver(email)\n redirect_to(:action => \"subscribed\")\n else\n render(:action => \"new\")\n end\n end", "def create\n @subscription = Subscription.new(params[:subscription])\n\n @subscription.owner = Company.find(params[:company_id]) if params[:company_id]\n @subscription.owner = Person.find(params[:person_id]) if params[:person_id]\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription.owner, notice: 'Subscription was successfully created.' }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @publisher = Publisher.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @publisher }\n end\n end", "def create\n \n @subscription = Subscription.new(params[:subscription])\n @subscription.quantity = @subscription.subscription_type.number_of_issues\n @subscription.unit_cost = @subscription.subscription_type.unit_cost\n \n respond_to do |format|\n if @subscription.save\n flash[:notice] = 'Subscription was successfully created.'\n format.html { redirect_to(@subscription) }\n format.xml { render :xml => @subscription, :status => :created, :location => @subscription }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\n @publish = Publish.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @publish }\n end\n end", "def create\n @subscription = Subscription.new(params[:subscription])\n \n @subscription = Subscription.new()\n @subscription.luser_id = current_user.luser.id\n \n @subscription.project_id = params[:project_id]\n \n current = Subscription.find(:first, :conditions => {:luser_id => current_user.luser.id, \n :project_id => params[:project_id] })\n \n respond_to do |format|\n if current != nil\n current.destroy\n format.json { head :no_content }\n elsif @subscription.save\n recieving_user = Luser.find(:first, :conditions => {:name => @subscription.project.created_by })\n Notification.add(@subscription.project, nil,\"project_subscription\", recieving_user, current_user.luser)\n LuserMailer.new_subscriber(current_user.luser, @subscription.project,).deliver\n format.html { redirect_to @subscription, notice: 'Subscription was successfully created.' }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @subscription.transaction = Transaction.find(params[:transaction_id])\n @subscription.year = @subscription.transaction.date.year.to_s\n @subscription.payment = @subscription.transaction.amount\n @subscription.value = @subscription.transaction.amount\n @subscription.paid_on = @subscription.transaction.date\n @subscription.currency = \"EUR\"\n @subscription.member = @subscription.transaction.member\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @site_newsletter = Site::Newsletter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site_newsletter }\n end\n end", "def create\n @subscribe = Subscribe.new(subscribe_params)\n\n respond_to do |format|\n if @subscribe.save\n format.html {redirect_to @subscribe, notice: 'Subscribe was successfully created.'}\n format.json {render json: @subscribe, status: :created}\n else\n format.html {render :new}\n format.json {render json: @subscribe.errors, status: :unprocessable_entity}\n end\n end\n end", "def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @topic }\n end\n end", "def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @topic }\n end\n end", "def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @topic }\n end\n end", "def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @topic }\n end\n end", "def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @topic }\n end\n end", "def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @topic }\n end\n end", "def new\n @title = \"New Subject\"\n @subject = Subject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subject }\n end\n end", "def create\n @admin_subscribe = Admin::Subscribe.new(admin_subscribe_params)\n\n respond_to do |format|\n if @admin_subscribe.save\n format.html { redirect_to root_path, notice: 'Subscribe was successfully created.' }\n format.json { render :show, status: :created, location: @admin_subscribe }\n else\n format.html { render root_path }\n format.json { render json: @admin_subscribe.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @publisher = Publisher.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @publisher }\n end\n end", "def create\n @subscriber = Subscriber.new(params[:subscriber])\n\n respond_to do |format|\n if @subscriber.save\n format.html { redirect_to @subscriber, notice: 'Subscriber was successfully created.' }\n format.json { render json: @subscriber, status: :created, location: @subscriber }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscriber.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @push_notification = PushNotification.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @push_notification }\n end\n end", "def create\n @subscription = Subscription.new(params[:subscription])\n @subscription.created_at = Time.new\n # always use current user\n @subscription.user_id = current_user.id\n @subscription.subscription_id = current_user.id.to_s\n respond_to do |format|\n if not current_user.fitbit.nil?\n if @subscription.save\n path = ['/1/user/-', @subscription.collection_path, 'apiSubscriptions', @subscription.subscription_id + '-' + @subscription.collection_path]\n api = JSON.parse(current_user.fitbit.client.post(path.join('/') + '.json').body)\n flash[:success] = 'Subscription was successfully created.' \n format.html { redirect_to @subscription }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n flash[:error] << @subscription.errors\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n\tend\n else\n flash[:error] = 'You are not connected to Fitbit.'\n format.html { redirect_to @subscription }\n format.json { render json: @subscription, status: :unprocessable_entity }\n end\n end\n end", "def new\n @trial = Trial.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trial }\n end\n end", "def new\n @notify = Notify.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @notify }\n end\n end", "def create\n subscription = @user.purchase_now(@gallery_item, @purchase_option)\n if subscription == true\n render json: { message: \"Subscribed successfully.\" } \n else\n render json: { message: \"Your can try this subscription after #{subscription}!\" }, status: 409 \n end\n end", "def create\n # checking a new method\n # @subscribe = Subscribe.update_sub(@item, @user)\n @subscribe = Subscribe.new(subscribe_params)\n respond_to do |format|\n if @subscribe.save\n format.html { redirect_to @subscribe}#, notice: 'Subscribe was successfully created.' }\n format.json { render :show, status: :created, location: @subscribe }\n else\n format.html { render :new }\n format.json { render json: @subscribe.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @recipient = Recipient.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipient }\n end\n end", "def new\n @recipient = Recipient.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipient }\n end\n end", "def new\n @contribution = Contribution.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contribution }\n end\n end", "def create\n @subscription_user = SubscriptionUser.new(subscription_user_params)\n\n respond_to do |format|\n if @subscription_user.save\n format.html { redirect_to @subscription_user, notice: 'Subscription user was successfully created.' }\n format.json { render :show, status: :created, location: @subscription_user }\n else\n format.html { render :new }\n format.json { render json: @subscription_user.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.7998553", "0.7998553", "0.7998553", "0.7998553", "0.7998553", "0.7978949", "0.79177266", "0.76547056", "0.74179745", "0.73993707", "0.73714405", "0.73714405", "0.73714405", "0.7319926", "0.7289597", "0.72751695", "0.72751695", "0.72686833", "0.722522", "0.72178036", "0.7215863", "0.72018236", "0.7196294", "0.71452576", "0.7120354", "0.7114426", "0.7103337", "0.7085439", "0.7081371", "0.70122814", "0.70033795", "0.69599885", "0.6909387", "0.6888338", "0.68605834", "0.685721", "0.6852021", "0.6802157", "0.67994153", "0.6763977", "0.67570025", "0.6755334", "0.67531854", "0.6739465", "0.6707271", "0.6693603", "0.66889983", "0.66769904", "0.66760063", "0.6579039", "0.65569466", "0.65409845", "0.65374017", "0.65324926", "0.65199184", "0.65182626", "0.65050954", "0.6496249", "0.64440733", "0.6428932", "0.6395595", "0.6387724", "0.63820255", "0.63788724", "0.6370332", "0.63658375", "0.63555473", "0.6337785", "0.6335577", "0.633203", "0.63164353", "0.63156337", "0.63070804", "0.62927574", "0.6281602", "0.6280335", "0.6277349", "0.62766373", "0.62718856", "0.6271549", "0.6265823", "0.62638646", "0.62638646", "0.62638646", "0.62638646", "0.62638646", "0.62626654", "0.6237912", "0.62329686", "0.622865", "0.6228133", "0.6228032", "0.62273556", "0.62250525", "0.62230855", "0.62104684", "0.6193359", "0.6193359", "0.6172323", "0.6170494" ]
0.82933676
0
POST /subscriptions POST /subscriptions.json
def create @subscription = current_user.subscriptions.new manga = Manga.find(params[:manga_id]) @subscription.manga_id=manga.id respond_to do |format| if @subscription.save format.html { redirect_to mangas_path, notice: 'Successfully subscribed to '+ manga.display_name.to_s} format.json { render json: @subscription, status: :created, location: @subscription } else format.html { render action: "new" } format.json { render json: @subscription.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n megam_rest.post_subscriptions(to_hash)\n end", "def post body=nil, headers={}\n @connection.post \"subscriptions.json\", body, headers\n end", "def create\n @subscription = Subscription.new(subscription_params)\n\n if @subscription.save\n render json: @subscription, status: :created, location: @subscription\n else\n render json: @subscription.errors, status: :unprocessable_entity\n end\n end", "def create\n s_params = params[:subscription]\n s_params.delete(:id)\n @subscription = Subscription.new(s_params)\n @subscription.save\n respond_with(@subscription)\n end", "def create / update_subscriptions\n end", "def post(subscription_form)\n HttpClient::Preconditions.assert_class('subscription_form', subscription_form, Apidoc::Models::SubscriptionForm)\n @client.request(\"/subscriptions\").with_json(subscription_form.to_json).post { |hash| Apidoc::Models::Subscription.new(hash) }\n end", "def create\n @subscription = Subscription.new(subscription_params)\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription, notice: (I18n.t :subscription_created) }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @subscription = @target.create_subscription(subscription_params)\n return_back_or_ajax\n end", "def create\n @subscription = Subscription.new(subscription_params)\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to root_url, notice: 'Subscription was successfully created.' }\n format.json { render action: 'show', status: :created, location: @subscription }\n else\n format.html { render action: 'new' }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_subscriptions\n Subscription.create_subscriptions(self.id, self.hashtag)\n end", "def create\n @subscription = Subscription.new(subscription_params)\n @subscription.user = current_user\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription, notice: t('controller.successfully_created', model: t('activerecord.models.subscription')) }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @subscription = Subscription.create(params[:subscription])\n gb = Gibbon::API.new(\"6f8672a5c2393d1441c54d3be3fb79a1-us1\")\n gb.lists.subscribe({:id => \"c0ca5b3d41\", :email => {:email => params[:subscription][:email]}, :merge_vars => {:FNAME => '', :LNAME => ''}, :double_optin => false})\n end", "def create\n @subscription = Subscription.new(subscription_params)\n\n respond_to do |format|\n if @subscription.save\n record_activity :create, @subscription\n format.html { redirect_to edit_subscription_path(@subscription),\n notice: 'Subscription was successfully created.' }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @subscription = Subscription.new(params[:subscription])\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to campaign_subscription_path(@campaign, @subscription), :notice => 'Subscription was successfully created.' }\n format.json { render :json => @subscription, :status => :created, :location => @subscription }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n # params[:id] is the knowmadics id\n\n @api_subscription = Api::Subscription.new(api_subscription_params)\n\n respond_to do |format|\n if @api_subscription.save\n format.html { redirect_to @api_subscription, notice: 'Subscription was successfully created.' }\n format.json { render :show, status: :created, location: @api_subscription }\n else\n format.html { render :new }\n format.json { render json: @api_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_new_subscription\n @subscription_offers = Subscription.get_subscription_list\n end", "def create\n @subscription = Subscription.new(params[:subscription])\n\n respond_to do |format|\n\t\n if @subscription.valid? && @subscription.save\n\t SubscriptionMailer.delay.send_welcome(@subscription)\n\t \n format.html { redirect_to \"/subscriptions/done\", notice: 'Twoj adres zostal dodany do listy mailingowej' }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @subscription = Subscription.new(subscription_params)\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to thanks_path, notice: 'Subscription was successfully created.' }\n else\n format.html { redirect_to root_path }\n end\n end\n end", "def create\n @subscription = Subscription.new(params[:subscription])\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to Binder.find(@subscription.binder_id), notice: 'Subscription was successfully created.' }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @categories = Category.all\n @subscription = Subscription.new(subscription_params)\n respond_to do |format|\n if @subscription.save\n\t @subscription.update(ordinal: Subscription.count)\n SubscriptionMailer.with(subscription: @subscription, new: \"true\").notification_email.deliver_now\n format.html { render :subscription_judging, notice: '加盟店サブスクショップの審査申請しました' }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n@subscription = current_user.subscriptions.build(subscription_params)\n\nrespond_to do |format|\n if @subscription.save\n\n format.html { redirect_to user_profile_url(current_user.id), notice: 'Pet was successfully created.' }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\nend\nend", "def subscriptions\n update_subscriptions(params[:types]) if params[:types]\n @types = build_notification_types\n render :json => @types\n end", "def create_subscription\n session[:merchant_subscription_id] = 'User' + sprintf('%03d', rand(1000)) + 'Subscription' + sprintf('%04d', rand(10000))\n\n # prepare payload\n data = {\n :Amount => params[:product] == '1' ? 1.99 : 3.99,\n :Category => 1,\n :Channel => 'MOBILE_WEB',\n :Description => 'Word game 1',\n :MerchantTransactionId => session[:merchant_subscription_id],\n :MerchantProductId => 'wordGame1',\n :MerchantPaymentRedirectUrl => settings.subscription_redirect_url,\n :MerchantSubscriptionIdList => 'sampleSubscription1',\n :IsPurchaseOnNoActiveSubscription => 'false',\n :SubscriptionRecurringNumber => '99999',\n :SubscriptionRecurringPeriod => 'MONTHLY',\n :SubscriptionRecurringPeriodAmount => 1\n }\n\n response = RestClient.post settings.notary_app_sign_url, :payload => data.to_json\n from_json = JSON.parse response\n\n redirect settings.FQDN + \"/Commerce/Payment/Rest/2/Subscriptions?clientid=#{settings.api_key}&SignedPaymentDetail=#{from_json['signed_payload']}&Signature=#{from_json['signature']}\"\nend", "def create\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription.transaction, notice: 'Subscription was successfully created.' }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @subscription = Subscription.new(params[:subscription])\n @subscription.created_at = Time.new\n # always use current user\n @subscription.user_id = current_user.id\n @subscription.subscription_id = current_user.id.to_s\n respond_to do |format|\n if not current_user.fitbit.nil?\n if @subscription.save\n path = ['/1/user/-', @subscription.collection_path, 'apiSubscriptions', @subscription.subscription_id + '-' + @subscription.collection_path]\n api = JSON.parse(current_user.fitbit.client.post(path.join('/') + '.json').body)\n flash[:success] = 'Subscription was successfully created.' \n format.html { redirect_to @subscription }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n flash[:error] << @subscription.errors\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n\tend\n else\n flash[:error] = 'You are not connected to Fitbit.'\n format.html { redirect_to @subscription }\n format.json { render json: @subscription, status: :unprocessable_entity }\n end\n end\n end", "def create\n@subscription = current_user.subscriptions.build(subscription_params)\n\nrespond_to do |format|\n if @subscription.save\n\n format.html { redirect_to users_profile_url(current_user.id), notice: 'Your pet was successfully created.' }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n\nend\n\n# PATCH/PUT /subscriptions/1\n# PATCH/PUT /subscriptions/1.json\ndef update\nrespond_to do |format|\n if @subscription.update(subscription_params)\n format.html { redirect_to users_profile_url(current_user.id), notice: 'Your pet was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscription }\n else\n format.html { render :edit }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\nend\nend\n\n# DELETE /subscriptions/1\n# DELETE /subscriptions/1.json\ndef destroy\[email protected]\nrespond_to do |format|\n format.html { redirect_to :back, notice: 'Your pet was successfully destroyed.' }\n format.json { head :no_content }\nend\n\nprivate\n# Use callbacks to share common setup or constraints between actions.\ndef set_subscription\n @subscription = Subscription.find(params[:id])\nend\n\n# Never trust parameters from the scary internet, only allow the white list through.\ndef subscription_params\n params.require(:subscription).permit(:title, :company, :url, :start_time, :end_time, :phone_number, :time, :pet_name, :breed, :animal, :notes, :pet_image, :option_1, :option_2, :gender)\nend\n\ndef correct_user\n @subscriptions = current_user.subscriptions.find_by(id: params[:id])\n redirect_to users_profile_url, notice: \"Not authorized to edit this pet\" if @subscription.nil?\nend\n\nend\nend", "def create\n @subscription = Subscription.new(params[:subscription])\n\n if params.has_key?(:new_service_id)\n service = Service.find(params[:new_service_id])\n unless service.nil?\n @subscription.service_id = service.id\n @subscription.costs = service.costs\n @subscription.user_id = current_user.id\n end\n end\n\n respond_to do |format|\n if @subscription.save\n flash[:success] = \"Subscription was successfully created.\"\n format.html { redirect_to @subscription }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n unless service.nil?\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n else\n flash[:error] = \"Subscription was not successful.\"\n format.html redirect_to services_path\n end\n end\n end\n end", "def new\n @subscription = current_user.subscriptions.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def create\n\t\t@subscription = Subscription.new(params[:subscription])\n\t\trespond_to do |format|\n\t\t\tif fonct_new_dup?\n\t\t\t\tobject_orig=Subscription.find(params[:object_orig_id])\n\t\t\tst = @subscription.create_duplicate(object_orig)\n\t\t\telse\n\t\t\tst = @subscription.save\n\t\t\tend\n\t\t\tif st\n\t\t\t\t#format.html { redirect_to(@subscription, :notice => 'Subscription was successfully created.') }\n\t\t\t\tflash[:notice] = 'Subscription was successfully created.'\n\t\t\t\tparams[:id]= @subscription.id\n\t\t\t\tshow_\n\t\t\t\tformat.html { render :action => \"show\" }\n\t\t\t\tformat.xml { render :xml => @subscription, :status => :created, :location => @subscription }\n\t\t\telse\n\t\t\t\t@ingroups = Group.all\n\t\t\t\t@inprojects = Project.all\n\t\t\t\t@fortypesobjects=Typesobject.get_from_observer\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def create\n if session[:user_id] \n user = User.find(session[:user_id])\n s = Subscription.new\n s.url = params[:subscription][:url]\n s.title = params[:subscription][:title]\n s.user = user\n @subscription = s\n \n respond_to do |format|\n if @subscription.save\n format.html { redirect_to(@subscription, :notice => 'Subscription was successfully created.') }\n format.xml { render :xml => @subscription, :status => :created, :location => @subscription }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end\n end", "def create\r\n @subscription = Subscription.new(subscription_params)\r\n @subscription.business_user_id = current_business_user.id\r\n respond_to do |format|\r\n if @subscription.save\r\n format.html { redirect_to business_user_subscriptions_path, notice: 'Subscription was successfully created.' }\r\n format.json { render json: @subscription, status: :created, location: @subscription }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def create\n @admin_subscribe = Admin::Subscribe.new(admin_subscribe_params)\n\n respond_to do |format|\n if @admin_subscribe.save\n format.html { redirect_to root_path, notice: 'Subscribe was successfully created.' }\n format.json { render :show, status: :created, location: @admin_subscribe }\n else\n format.html { render root_path }\n format.json { render json: @admin_subscribe.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_subscription(body:)\n # Prepare query url.\n _query_builder = config.get_base_uri\n _query_builder << '/v2/subscriptions'\n _query_url = APIHelper.clean_url _query_builder\n\n # Prepare headers.\n _headers = {\n 'accept' => 'application/json',\n 'content-type' => 'application/json; charset=utf-8'\n }\n\n # Prepare and execute HttpRequest.\n _request = config.http_client.post(\n _query_url,\n headers: _headers,\n parameters: body.to_json\n )\n OAuth2.apply(config, _request)\n _response = execute_request(_request)\n\n # Return appropriate response type.\n decoded = APIHelper.json_deserialize(_response.raw_body)\n _errors = APIHelper.map_response(decoded, ['errors'])\n ApiResponse.new(\n _response, data: decoded, errors: _errors\n )\n end", "def subscribe!\n Subscription.transaction do\n subscription = create_stripe_subscription!\n store.subscriptions.create!(\n customer: user,\n stripe_plan_id: stripe_plan_id,\n stripe_id: subscription.id,\n first_date: Date.today,\n status: :active\n )\n end\n end", "def create\n @panel_subscription = Panel::Subscription.new(params[:panel_subscription])\n\n respond_to do |format|\n if @panel_subscription.save\n format.html { redirect_to(@panel_subscription, :notice => 'Subscription was successfully created.') }\n format.json { render :json => @panel_subscription, :status => :created, :location => @panel_subscription }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @panel_subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create(params)\n params[:tag] ||= '*'\n post(\"#{domain}/unsubscribes\", params)\n end", "def create\n @subscription = Subscription.new(params[:subscription])\n\n @subscription.owner = Company.find(params[:company_id]) if params[:company_id]\n @subscription.owner = Person.find(params[:person_id]) if params[:person_id]\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription.owner, notice: 'Subscription was successfully created.' }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n \n @subscription = Subscription.new(params[:subscription])\n @subscription.quantity = @subscription.subscription_type.number_of_issues\n @subscription.unit_cost = @subscription.subscription_type.unit_cost\n \n respond_to do |format|\n if @subscription.save\n flash[:notice] = 'Subscription was successfully created.'\n format.html { redirect_to(@subscription) }\n format.xml { render :xml => @subscription, :status => :created, :location => @subscription }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n args = ZAPIArgs.new\n args.uri = Resource_Endpoints::POST_SUBSCRIPTION\n\n args.req_body = ZAPIArgs.new\n args.req_body.accountKey = SAMPLE_ACCOUNT_KEY\n args.req_body.contractEffectiveDate = '2013-02-1'\n args.req_body.termType = 'TERMED'\n args.req_body.initialTerm = '12'\n args.req_body.autoRenew = true\n args.req_body.renewalTerm = \"3\"\n args.req_body.notes = 'Test POST subscription from z-ruby-sdk'\n args.req_body.subscribeToRatePlans = []\n args.req_body.subscribeToRatePlans[0] = ZAPIArgs.new\n args.req_body.subscribeToRatePlans[0].productRatePlanId = 'ff8080811ca15d19011cdda9b0ad3b51'\n args.req_body.subscribeToRatePlans[0].chargeOverrides = []\n args.req_body.subscribeToRatePlans[0].chargeOverrides[0] = ZAPIArgs.new\n args.req_body.subscribeToRatePlans[0].chargeOverrides[0].productRatePlanChargeId =\n 'ff8080811ca15d19011cddad8c953b53'\n args.req_body.subscribeToRatePlans[0].chargeOverrides[0].quantity = 10\n args.req_body.invoiceTargetDate = '2013-12-31'\n args.req_body.invoiceCollect = false\n\n puts \"========== CREATE A SUBSCRIPTION ============\"\n\n begin\n @z_client.post(args) do |resp|\n ap resp\n return resp.subscriptionNumber if resp.httpStatusCode.to_i == 200 && resp.success\n end\n rescue ArgumentError => e\n puts e.message\n rescue RuntimeError => e\n puts e.message\n end\n\n nil\n end", "def create_webhook_subscription(body:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::POST,\n '/v2/webhooks/subscriptions',\n 'default')\n .header_param(new_parameter('application/json', key: 'Content-Type'))\n .body_param(new_parameter(body))\n .header_param(new_parameter('application/json', key: 'accept'))\n .body_serializer(proc do |param| param.to_json unless param.nil? end)\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end", "def create\n @subscribe = Subscribe.new(subscribe_params)\n\n respond_to do |format|\n if @subscribe.save\n format.html { redirect_to @subscribe, notice: t('controller.successfully_created', model: t('activerecord.models.subscribe')) }\n format.json { render json: @subscribe, status: :created, location: @subscribe }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscribe.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_subscription(options)\n stripe_service.create_subscription(options)\n end", "def create\n @subscribe = Subscribe.new(subscribe_params)\n\n respond_to do |format|\n if @subscribe.save\n format.html {redirect_to @subscribe, notice: 'Subscribe was successfully created.'}\n format.json {render json: @subscribe, status: :created}\n else\n format.html {render :new}\n format.json {render json: @subscribe.errors, status: :unprocessable_entity}\n end\n end\n end", "def create\n @subscriber = Subscriber.new(subscriber_params)\n\n respond_to do |format|\n if @subscriber.save\n format.html { redirect_to root_path, notice: 'Thank You For Subscribing!' }\n format.json { render :show, Subscribe.create(subscriber_params)}\n else\n format.html { redirect_to root_path, notice: 'There was a problem with the subscription' }\n format.json { render :json => @subscriber.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @subscription = Subscription.new(subscription_params)\n @subscription.activity :params => {:composite_key => \"#{@subscription.game_id},#{@subscription.player_id}\"}\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription.game, notice: 'Subscription was successfully created.' }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def subscription_params\n params.require(:subscription).permit(:subscribed_id)\n end", "def subscribe\n Socky.send( {:action => \"subscribe\",\n :channel => params[:channel],\n :client => (params[:client_id] || '')}.to_json)\n render :text => \"ok\"\n end", "def create_webhook_subscription(submission___context_id__,subscription___context_type__,subscription___event_types__,subscription___format__,subscription___transport_metadata__,subscription___transport_type__,opts={})\n query_param_keys = [\n \n\n ]\n\n form_param_keys = [\n :submission___context_id__,\n :subscription___context_type__,\n :subscription___event_types__,\n :subscription___format__,\n :subscription___transport_metadata__,\n :subscription___transport_type__,\n \n\n ]\n\n # verify existence of params\n raise \"submission___context_id__ is required\" if submission___context_id__.nil?\n raise \"subscription___context_type__ is required\" if subscription___context_type__.nil?\n raise \"subscription___event_types__ is required\" if subscription___event_types__.nil?\n raise \"subscription___format__ is required\" if subscription___format__.nil?\n raise \"subscription___transport_metadata__ is required\" if subscription___transport_metadata__.nil?\n raise \"subscription___transport_type__ is required\" if subscription___transport_type__.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :submission___context_id__ => submission___context_id__,\n :subscription___context_type__ => subscription___context_type__,\n :subscription___event_types__ => subscription___event_types__,\n :subscription___format__ => subscription___format__,\n :subscription___transport_metadata__ => subscription___transport_metadata__,\n :subscription___transport_type__ => subscription___transport_type__\n\n )\n\n # resource path\n path = path_replace(\"/lti/subscriptions\",\n )\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_query_params(options, query_param_keys)\n\n response = mixed_request(:post, path, query_params, form_params, headers)\n response\n \n\n end", "def create \n @subscription = Subscription.new(params[:subscription])\n \n uri = URI.parse(request.env[\"HTTP_REFERER\"])\n unless %w{ app.atra.obra.org localhost app.americantrackracing.com raceatra.com www.raceatra.com}.include?(uri.host)\n flash[:notice] = \"Cannot send request from '#{uri.host}'\"\n return render(:action => \"new\")\n end\n\n if @subscription.valid?\n email = SubscriptionMailer.create_subscription_request(@subscription)\n SubscriptionMailer.deliver(email)\n redirect_to(:action => \"subscribed\")\n else\n render(:action => \"new\")\n end\n end", "def create\n @service = Service.find(params[:service_id])\n \n @service_subscription = current_user.subscribe(@service, params[:service_subscription])\n \n if @service_subscription && @service_subscription.errors.empty?\n redirect_to service_subscriptions_path, :success => \"You have subscribed to the service!\"\n else\n render :action => :new\n end\n \n end", "def create\n # checking a new method\n # @subscribe = Subscribe.update_sub(@item, @user)\n @subscribe = Subscribe.new(subscribe_params)\n respond_to do |format|\n if @subscribe.save\n format.html { redirect_to @subscribe}#, notice: 'Subscribe was successfully created.' }\n format.json { render :show, status: :created, location: @subscribe }\n else\n format.html { render :new }\n format.json { render json: @subscribe.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @subscription_user = SubscriptionUser.new(subscription_user_params)\n\n respond_to do |format|\n if @subscription_user.save\n format.html { redirect_to @subscription_user, notice: 'Subscription user was successfully created.' }\n format.json { render :show, status: :created, location: @subscription_user }\n else\n format.html { render :new }\n format.json { render json: @subscription_user.errors, status: :unprocessable_entity }\n end\n end\n end", "def subscription_params\n params.require(:subscriptions).permit(:venue_name, :user_id)\n end", "def subscribe!(params)\n raise Errors::AlreadySubscribedError if subscribed?\n raise Errors::StripeCustomerExistsError if stripe_customer_id\n\n customer = ::Stripe::Customer.create(\n source: params[:stripe_token],\n plan: params[:subscription_plan_id] || SlackRubyBotServer::Stripe.config.subscription_plan_id,\n email: params[:stripe_email],\n metadata: {\n id: id,\n team_id: team_id,\n name: name,\n domain: domain\n }\n )\n\n update_attributes!(\n subscribed: true,\n subscribed_at: Time.now.utc,\n stripe_customer_id: customer['id'],\n subscription_expired_at: nil,\n subscription_past_due_at: nil,\n subscription_past_due_informed_at: nil\n )\n\n customer\n end", "def create\n @subscription = Subscription.new(params[:subscription])\n @subscription.screen = @screen\n @subscription.field = @field\n auth!\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to(manage_screen_field_subscriptions_path(@screen, @field), :notice => t(:subscription_created)) }\n format.xml { render :xml => @subscription, :status => :created, :location => @subscription }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @subscription = current_user.subscriptions.create(subscription_params)\n redirect_to @playlist\n end", "def create\n @subscription_request = SubscriptionRequest.new(params[:subscription_request])\n\n respond_to do |format|\n if @subscription_request.save\n format.html { redirect_to @subscription_request, notice: 'Subscription request was successfully created.' }\n format.json { render json: @subscription_request, status: :created, location: @subscription_request }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category_subscription = CategorySubscription.new(category_subscription_params)\n\n respond_to do |format|\n if @category_subscription.save\n format.html { redirect_to @category_subscription, notice: 'Category subscription was successfully created.' }\n format.json { render :show, status: :created, location: @category_subscription }\n else\n format.html { render :new }\n format.json { render json: @category_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @subscription = Subscription.create(params[:subscription])\n groups = params[:subscription][:group_name].split(\",\").collect(&:strip)\n email = params[:subscription][:email]\n begin\n gb = Gibbon::API.new(\"f24fdd53217fab0b0698fdaba15c0c6f-us7\")\n subscribe = gb.lists.subscribe({\n :id => \"caa152eac4\",\n :email => {:email => email},\n :merge_vars => {\n :FNAME => \"\",\n :LNAME => \"\",\n :groupings => {\n 0 => {\n :id => 4457,\n :groups => groups\n }\n }\n },\n :update_existing => true,\n :double_optin => false\n })\n #logger.debug subscribe\n rescue Gibbon::MailChimpError\n \n end\n redirect_to \"/contact\"\n end", "def create\n @subscription_type = SubscriptionType.new(subscription_type_params)\n\n respond_to do |format|\n if @subscription_type.save\n format.html { redirect_to @subscription_type, notice: 'Subscription types was successfully created.' }\n format.json { render :show, status: :created, location: @subscription_type }\n else\n format.html { render :new }\n format.json { render json: @subscription_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def subscribe\n @subscription.subscribe(with_email_subscription: params[:with_email_subscription].to_s.to_boolean(ActivityNotification.config.subscribe_to_email_as_default),\n with_optional_targets: params[:with_optional_targets].to_s.to_boolean(ActivityNotification.config.subscribe_to_optional_targets_as_default))\n return_back_or_ajax\n end", "def new\r\n @subscription = Subscription.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @subscription }\r\n end\r\n end", "def subscribe\n \nend", "def create\n @list_subscription = ListSubscription.new(params[:list_subscription])\n\n respond_to do |format|\n if @list_subscription.save\n format.html { redirect_to @list_subscription, notice: 'List subscription was successfully created.' }\n format.json { render json: @list_subscription, status: :created, location: @list_subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @list_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @subscription = Subscription.new(subscription_params)\n\n @subscription.sub_create(current_user,subscription_params[:stripe_plan_id],subscription_params[:coupon_code])\n\n # Create a subscription with the following information:\n #\n # 1) Customer Account\n # 2) Subscription Type (GOLD, Silver, etc.)\n # 3) Discount Coupom (if applicable)\n\n if @subscription.save\n redirect_to @subscription, notice: 'Subscription was successfully created.'\n else\n @verrors = @subscription.errors.full_messages\n render 'new'\n end\n end", "def subscribe\n @podcast = Podcast.where(:id => params[:id]).first\n unless Subscription.where(:user_id => current_user.id, :podcast_id => params[:id]).size > 0\n @subscription = Subscription.new(:user_id => current_user.id, :podcast_id => params[:id])\n if @subscription.save\n puts \"Subscription successfully created!\"\n redirect_to @podcast, :notice => \"successfully subscribed!\"\n # render :layout => false\n else\n puts \"Subscription failed to be created!\"\n render :layout => false\n end\n end\n end", "def webhook_subscribe\n # verify the string parameters\n if params['hub.mode'] == 'subscribe' &&\n params['hub.topic'] == @feed.url &&\n params['hub.challenge'].present?\n\n @feed.status = 'subscription_requested' # 17 mins\n if params['hub.lease_seconds'].present? && params['hub.lease_seconds'].to_i > 0\n @feed.expiration_date = DateTime.now + Rational(params['hub.lease_seconds'].to_i, 86_400)\n unless @feed.save\n # log error\n logger.error \"FEED SAVE TO DB ERROR:#{@feed.inspect}\"\n end\n end\n\n render status: 200, plain: params['hub.challenge']\n else\n render status: 422, plain: 'Invalid parameters'\n end\n end", "def create\n @admin_subscription = Subscription.new(admin_subscription_params)\n\n respond_to do |format|\n if @admin_subscription.save\n format.html { redirect_to [:admin, @admin_subscription], notice: 'L\\'abonnement a bien été créé !' }\n format.json { render :show, status: :created, location: @admin_subscription }\n else\n format.html { render :new }\n format.json { render json: @admin_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_subscription(sender)\n PsegRecurring::Subscription.new(@credentials).send_subscription(sender)\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def subscription_params\n params.require(:subscription).permit(:user_id, :subscribable_id, :subscribable_type, :notification_preference)\n end", "def subscribe!\n url = \"#{GRAPH_URL}/me/subscribed_apps?access_token=#{ENV['MESSENGER_BOT_ACCESS_TOKEN']}\"\n data = RestClient.post(url, nil)\n if data\n json = JSON.parse(data)\n json['success']\n else\n false\n end\n end", "def create(params)\n params.merge!(\n :order_no => (Time.now.to_f * 10000).to_i.to_s, # Produce a unique order_no - it's not used anywhere, but ePay needs this\n :amount => 0\n )\n \n post = Api.default_post_for_params(params).merge({\n :subscription => 1,\n :subscriptionname => params[:description]\n })\n \n query = Api.authorize(post)\n \n if query['accept']\n # Return the new subscriber\n subscription = new(query[\"subscriptionid\"].to_i).reload\n \n # Set (obfuscated) card number:\n subscription.card_no = query[\"tcardno\"]\n \n subscription\n else\n new(nil, 'error' => query[\"error\"])\n end\n end", "def add_subscription(entity)\r\n subscriptions << entity\r\n end", "def create\n @subscriber = Subscriber.new(params[:subscriber])\n\n @subscriber.account = @account\n\n respond_to do |format|\n if @subscriber.save\n format.html { redirect_to account_subscriber_path(@account, @subscriber), notice: 'Subscriber was successfully created.' }\n format.json { render json: @subscriber, status: :created, location: @subscriber }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscriber.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n subscription = @user.purchase_now(@gallery_item, @purchase_option)\n if subscription == true\n render json: { message: \"Subscribed successfully.\" } \n else\n render json: { message: \"Your can try this subscription after #{subscription}!\" }, status: 409 \n end\n end", "def subscriptions\n url = url_with_api_version(@base_url, 'subscriptions')\n resp = rest_get(url)\n JSON.parse(resp.body)[\"value\"]\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @subscription }\n end\n end", "def create\n @user_to_channel_subscription = UserToChannelSubscription.new(user_to_channel_subscription_params)\n\n respond_to do |format|\n if @user_to_channel_subscription.save\n format.html { redirect_to @user_to_channel_subscription, notice: 'User to channel subscription was successfully created.' }\n format.json { render :show, status: :created, location: @user_to_channel_subscription }\n else\n format.html { render :new }\n format.json { render json: @user_to_channel_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def subscribe_author\n self.subscriptions.create user_id: self.user.id\n end", "def subscribe(options, &block)\n subscriptions.create(options, &block)\n end", "def search_subscriptions(body:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::POST,\n '/v2/subscriptions/search',\n 'default')\n .header_param(new_parameter('application/json', key: 'Content-Type'))\n .body_param(new_parameter(body))\n .header_param(new_parameter('application/json', key: 'accept'))\n .body_serializer(proc do |param| param.to_json unless param.nil? end)\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end", "def create\n @subscriber = Subscriber.new(params[:subscriber])\n\n respond_to do |format|\n if @subscriber.save\n format.html { redirect_to @subscriber, notice: 'Subscriber was successfully created.' }\n format.json { render json: @subscriber, status: :created, location: @subscriber }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscriber.errors, status: :unprocessable_entity }\n end\n end\n end", "def subscriptions( params={} )\n subscriptions = get_connections(\"subscriptions\", params)\n return map_connections subscriptions, :to => Facebook::Graph::Subscription\n end", "def create\n @vendor_subscription = VendorSubscription.new(vendor_subscription_params)\n\n respond_to do |format|\n if @vendor_subscription.save\n format.html { redirect_to @vendor_subscription, notice: 'Vendor subscription was successfully created.' }\n format.json { render :show, status: :created, location: @vendor_subscription }\n else\n format.html { render :new }\n format.json { render json: @vendor_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_subscription(subscription_info, opts = {})\n data, _status_code, _headers = create_subscription_with_http_info(subscription_info, opts)\n return data\n end", "def create\n @subscriber = Subscriber.new(subscriber_params)\n\n respond_to do |format|\n if @subscriber.save\n format.html { redirect_to @subscriber, notice: 'Subscriber was successfully created.' }\n format.json { render :show, status: :created, location: @subscriber }\n else\n format.html { render :new }\n format.json { render json: @subscriber.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_subscription_with_http_info(subscription_info, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SubscriptionsApi.create_subscription ...\"\n end\n # verify the required parameter 'subscription_info' is set\n fail ArgumentError, \"Missing the required parameter 'subscription_info' when calling SubscriptionsApi.create_subscription\" if subscription_info.nil?\n # resource path\n local_var_path = \"/subscriptions\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(subscription_info)\n auth_names = ['artikcloud_oauth']\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 => 'SubscriptionEnvelope')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SubscriptionsApi#create_subscription\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def subscribe\n \n @conversation.subscriptions << @user unless @conversation.subscriptions.exists?(@user.id)\n @notice = \"You will now receive email notifications about new replies in this conversation.\"\n \n respond_to do |format|\n format.html {\n redirect_to(@conversation, notice: @notice) and return\n return \n }\n format.js\n end\n\n end", "def stripe_customer_subscription_created(event, req)\n stripe_customer_subscription_updated(event, req)\n end", "def test_webhook_subscription(subscription_id:,\n body:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::POST,\n '/v2/webhooks/subscriptions/{subscription_id}/test',\n 'default')\n .template_param(new_parameter(subscription_id, key: 'subscription_id')\n .should_encode(true))\n .header_param(new_parameter('application/json', key: 'Content-Type'))\n .body_param(new_parameter(body))\n .header_param(new_parameter('application/json', key: 'accept'))\n .body_serializer(proc do |param| param.to_json unless param.nil? end)\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end", "def subscription_params\n params.require(:subscription).permit(:start_at, :finish_at, :visits, :is_active, :note, :record_client_id)\n end", "def create\n @subscription = Subscription.new(subscription_params)\n @subscription.screen = @screen\n @subscription.field = @field\n auth!\n\n # Verify the screen can read the feed\n ability = Ability.new(@screen)\n @subscription.feed = nil if ability.cannot?(:read, @subscription.feed)\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to(screen_field_subscriptions_path(@screen, @field), notice: t(:subscription_created)) }\n format.xml { render xml: @subscription, status: :created, location: @subscription }\n format.js\n else\n format.html { render action: \"new\" }\n format.xml { render xml: @subscription.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end", "def subscribe!(topic)\n subscriptions.create!( :topic_id => topic.id )\n end", "def create\n @subscriber = Subscriber.create(subscriber_params)\n\n respond_to do |format|\n if @subscriber.save\n format.html { redirect_to @subscriber, notice: 'Subscriber was successfully created.' }\n format.json { render :show, status: :created, location: @subscriber }\n else\n format.html { render :new }\n format.json { render json: @subscriber.errors, status: :unprocessable_entity }\n end\n end\n end", "def subscription(id)\n Sensit::Api::Subscription.new id, @http_client\n end" ]
[ "0.7878452", "0.78267294", "0.7648211", "0.7545708", "0.7432098", "0.7428383", "0.7351888", "0.7329232", "0.7227739", "0.7155769", "0.7136345", "0.7112945", "0.71125585", "0.7020447", "0.7004615", "0.69523484", "0.6893254", "0.68890435", "0.6831791", "0.68234247", "0.6818618", "0.6788453", "0.6743029", "0.67429686", "0.6736796", "0.6734205", "0.6728402", "0.6714901", "0.6683617", "0.66786546", "0.6633249", "0.6610338", "0.6607992", "0.6595876", "0.65733576", "0.65546334", "0.6548585", "0.65440995", "0.65407825", "0.65320486", "0.6522251", "0.65168", "0.6514733", "0.6497595", "0.6493469", "0.64934", "0.6492814", "0.64899063", "0.6478781", "0.6459458", "0.6455545", "0.64538455", "0.64511603", "0.64489704", "0.6441755", "0.6434936", "0.64332104", "0.6417693", "0.64161015", "0.6415352", "0.6408511", "0.6406812", "0.6398319", "0.6393463", "0.6386697", "0.6382597", "0.63739717", "0.63624096", "0.6359229", "0.63574886", "0.63574886", "0.63574886", "0.63574886", "0.63574886", "0.63325286", "0.63198864", "0.63152474", "0.6310998", "0.63032955", "0.6300329", "0.6299157", "0.6293288", "0.62881744", "0.6279829", "0.6279786", "0.62771523", "0.6266761", "0.62623465", "0.62480956", "0.624047", "0.62375706", "0.623616", "0.6231572", "0.62202585", "0.62125164", "0.62111884", "0.6210347", "0.62068725", "0.62025917", "0.61862427" ]
0.66208965
31
PUT /subscriptions/1 PUT /subscriptions/1.json
def update @subscription = current_user.subscriptions.find(params[:id]) respond_to do |format| if @subscription.update_attributes(params[:subscription]) format.html { redirect_to @subscription, notice: 'Subscription was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @subscription.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @subscription = Subscription.get(params[:id])\n @subscription.update(params[:subscription])\n respond_with(@subscription.reload)\n end", "def update\n @subscription = Subscription.find(params[:id])\n\n if @subscription.update(subscription_params)\n head :no_content\n else\n render json: @subscription.errors, status: :unprocessable_entity\n end\n end", "def create / update_subscriptions\n end", "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to @subscription.owner, notice: 'Subscription was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n \n # TODO: Modify subscription (refund remainder of current, prorate new)\n \n respond_to do |format|\n if @subscription.update(subscription_params)\n format.html { redirect_to subscriptions_url, success: 'Subscription was successfully updated.' }\n format.json { head :no_content }\n format.js { redirect_to subscriptions_url, :format => :html, success: 'Subscription was successfully updated.' }\n else\n format.html { render action: 'edit' }\n format.js { render action: 'edit' }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n flash[:success] = \"Subscription was successfully updated.\"\n format.html { redirect_to @subscription }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to @subscription, notice: 'Subscription was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to @subscription, notice: 'Subscription was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to @subscription, notice: 'Subscription was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_webhook_subscription(id,opts={})\n query_param_keys = [\n \n\n ]\n\n form_param_keys = [\n \n\n ]\n\n # verify existence of params\n raise \"id is required\" if id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :id => id\n\n )\n\n # resource path\n path = path_replace(\"/lti/subscriptions/{id}\",\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_query_params(options, query_param_keys)\n\n response = mixed_request(:put, path, query_params, form_params, headers)\n response\n \n\n end", "def update\n respond_to do |format|\n if @subscription.update(subscription_params)\n format.html { redirect_to @subscription, notice: (I18n.t :subscription_updated) }\n format.json { render :show, status: :ok, location: @subscription }\n else\n format.html { render :edit }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to @subscription.layer, notice: 'Subscription updated OK' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @api_subscription.update(api_subscription_params)\n format.html { redirect_to @api_subscription, notice: 'Subscription was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_subscription }\n else\n format.html { render :edit }\n format.json { render json: @api_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\r\n @subscription = Subscription.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @subscription.update_attributes(subscription_params)\r\n format.html { redirect_to business_user_subscriptions_path, notice: 'Subscription was successfully updated.' }\r\n format.json { head :ok }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def create\n s_params = params[:subscription]\n s_params.delete(:id)\n @subscription = Subscription.new(s_params)\n @subscription.save\n respond_with(@subscription)\n end", "def update\n respond_to do |format|\n if @subscription.update(subscription_params)\n format.html { redirect_to @subscription, notice: 'Subscription was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscription }\n else\n format.html { render :edit }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @subscription.update(subscription_params)\n format.html { redirect_to @subscription, notice: 'Subscription was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscription }\n else\n format.html { render :edit }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @subscription = Subscription.by_user_channel_ids(current_user.id, params[:channel_id])\n\n respond_to do |format|\n if @subscription and @subscription.update_attributes(params[:subscription])\n @channel = Channel.find(params[:channel_id])\n format.html { redirect_to @subscription, notice: I18n.t('subscription_updated') }\n format.json { render json: { name: @channel.subscription_name(current_user) }, status: :ok}\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def update_subscription(subscription_id:,\n body:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::PUT,\n '/v2/subscriptions/{subscription_id}',\n 'default')\n .template_param(new_parameter(subscription_id, key: 'subscription_id')\n .should_encode(true))\n .header_param(new_parameter('application/json', key: 'Content-Type'))\n .body_param(new_parameter(body))\n .header_param(new_parameter('application/json', key: 'accept'))\n .body_serializer(proc do |param| param.to_json unless param.nil? end)\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end", "def update\n @subscription = Subscription.find(params[:id])\n \n respond_to do |format|\n \n \n if @subscription.update_attributes(params[:subscription])\n flash[:notice] = 'Subscription was successfully updated.'\n format.html { redirect_to(@subscription) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to campaign_subscriptions_path(@campaign), :notice => 'Subscription was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n@subscription = current_user.subscriptions.build(subscription_params)\n\nrespond_to do |format|\n if @subscription.save\n\n format.html { redirect_to users_profile_url(current_user.id), notice: 'Your pet was successfully created.' }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n\nend\n\n# PATCH/PUT /subscriptions/1\n# PATCH/PUT /subscriptions/1.json\ndef update\nrespond_to do |format|\n if @subscription.update(subscription_params)\n format.html { redirect_to users_profile_url(current_user.id), notice: 'Your pet was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscription }\n else\n format.html { render :edit }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\nend\nend\n\n# DELETE /subscriptions/1\n# DELETE /subscriptions/1.json\ndef destroy\[email protected]\nrespond_to do |format|\n format.html { redirect_to :back, notice: 'Your pet was successfully destroyed.' }\n format.json { head :no_content }\nend\n\nprivate\n# Use callbacks to share common setup or constraints between actions.\ndef set_subscription\n @subscription = Subscription.find(params[:id])\nend\n\n# Never trust parameters from the scary internet, only allow the white list through.\ndef subscription_params\n params.require(:subscription).permit(:title, :company, :url, :start_time, :end_time, :phone_number, :time, :pet_name, :breed, :animal, :notes, :pet_image, :option_1, :option_2, :gender)\nend\n\ndef correct_user\n @subscriptions = current_user.subscriptions.find_by(id: params[:id])\n redirect_to users_profile_url, notice: \"Not authorized to edit this pet\" if @subscription.nil?\nend\n\nend\nend", "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to(subscriptions_url, :notice => 'Subscription was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @subscription.update_with_author(subscription_params, current_user)\n record_activity :update, @subscription\n format.html { redirect_to @subscription, notice: 'Subscription was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscription }\n else\n format.html { render :edit }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n flash[:notice] = 'Subscription was successfully updated.'\n format.html { redirect_to(@subscription) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to @subscription.transaction, notice: 'Subscription was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\t\t@subscription = Subscription.find(params[:id])\n\t\trespond_to do |format|\n\t\t\tif @subscription.update_attributes(params[:subscription])\n\t\t\t\tflash[:notice] = 'Subscription was successfully updated.'\n\t\t\t\tshow_\n\t\t\t\tformat.html { render :action => \"show\" }\n\t\t\t\tformat.xml { head :ok }\n\t\t\telse\n\t\t\t\t@ingroups = Group.all\n\t\t\t\t@inprojects = Project.all\n\t\t\t\t@fortypesobjects=Typesobject.get_from_observer\n\t\t\t\tformat.html { render :action => \"edit\" }\n\t\t\t\tformat.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def edit_subscription(subscription_id, payload)\n put(url_(\"subscription\", subscription_id), payload)\n end", "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to(@subscription, :notice => 'Subscription was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n if session[:user_id] \n @subscription = Subscription.find(params[:id])\n \n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to(@subscription, :notice => 'Subscription was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\nend", "def set_subscription\n @subscription = Subscription.find(params[:id])\nend", "def update\n @subscription.assign_attributes(subscription_params)\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription, notice: t('controller.successfully_updated', model: t('activerecord.models.subscription')) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @subscription = args[:subscription] if args.key?(:subscription)\n end", "def update!(**args)\n @subscription = args[:subscription] if args.key?(:subscription)\n end", "def update!(**args)\n @subscription = args[:subscription] if args.key?(:subscription)\n end", "def update\n @subscription = Subscription.find(params[:id])\n auth!\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to(manage_screen_field_subscriptions_path(@screen, @field), :notice => t(:subscription_updated)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update_subscriptions(email, attrs = {})\n attrs['email'] = email\n Iterable.request(conf, '/users/updateSubscriptions').post(attrs)\n end", "def set_subscription\n @subscription = Subscription.find(params[:id])\n end", "def update_subscription(subscription_id:,\n body:)\n # Prepare query url.\n _query_builder = config.get_base_uri\n _query_builder << '/v2/subscriptions/{subscription_id}'\n _query_builder = APIHelper.append_url_with_template_parameters(\n _query_builder,\n 'subscription_id' => { 'value' => subscription_id, 'encode' => true }\n )\n _query_url = APIHelper.clean_url _query_builder\n\n # Prepare headers.\n _headers = {\n 'accept' => 'application/json',\n 'content-type' => 'application/json; charset=utf-8'\n }\n\n # Prepare and execute HttpRequest.\n _request = config.http_client.put(\n _query_url,\n headers: _headers,\n parameters: body.to_json\n )\n OAuth2.apply(config, _request)\n _response = execute_request(_request)\n\n # Return appropriate response type.\n decoded = APIHelper.json_deserialize(_response.raw_body)\n _errors = APIHelper.map_response(decoded, ['errors'])\n ApiResponse.new(\n _response, data: decoded, errors: _errors\n )\n end", "def create\n @subscription = Subscription.new(subscription_params)\n\n if @subscription.save\n render json: @subscription, status: :created, location: @subscription\n else\n render json: @subscription.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @subscribe.update(subscribe_params)\n format.html { redirect_to @subscribe, notice: 'Subscribe was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscribe }\n else\n format.html { render :edit }\n format.json { render json: @subscribe.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @subscribe.update(subscribe_params)\n format.html { redirect_to @subscribe, notice: 'Subscribe was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscribe }\n else\n format.html { render :edit }\n format.json { render json: @subscribe.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_api_subscription\n @api_subscription = Api::Subscription.find(params[:id])\n end", "def update_webhook_subscription(subscription_id:,\n body:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::PUT,\n '/v2/webhooks/subscriptions/{subscription_id}',\n 'default')\n .template_param(new_parameter(subscription_id, key: 'subscription_id')\n .should_encode(true))\n .header_param(new_parameter('application/json', key: 'Content-Type'))\n .body_param(new_parameter(body))\n .header_param(new_parameter('application/json', key: 'accept'))\n .body_serializer(proc do |param| param.to_json unless param.nil? end)\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end", "def subscribe_to_updates\n if @subscription = @requestor.find_or_create_subscriptions(@target.id)\n @subscription.update_attributes(blocked: false) if @subscription.blocked?\n render json: { success: true }\n else\n render json: {message: @subscription.errors&.full_messages || 'Unable to subscriber updates, please try again'}, status: 202\n end\n end", "def stripe_customer_subscription_updated(event, req)\n subscription = event['data']['object']\n subs = Lynr::Model::Subscription.new({\n canceled_at: subscription['canceled_at'],\n plan: subscription['plan']['id'],\n status: subscription['status'],\n })\n dealership = dealer_dao.get_by_customer_id(subscription['customer']).set('subscription' => subs)\n dealer_dao.save(dealership)\n end", "def create\n # params[:id] is the knowmadics id\n\n @api_subscription = Api::Subscription.new(api_subscription_params)\n\n respond_to do |format|\n if @api_subscription.save\n format.html { redirect_to @api_subscription, notice: 'Subscription was successfully created.' }\n format.json { render :show, status: :created, location: @api_subscription }\n else\n format.html { render :new }\n format.json { render json: @api_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def post body=nil, headers={}\n @connection.post \"subscriptions.json\", body, headers\n end", "def update\n @subscription_request = SubscriptionRequest.find(params[:id])\n\n respond_to do |format|\n if @subscription_request.update_attributes(params[:subscription_request])\n format.html { redirect_to @subscription_request, notice: 'Subscription request was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @subscribe.update(subscribe_params)\n format.html { redirect_to @subscribe, notice: t('controller.successfully_updated', model: t('activerecord.models.subscribe')) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscribe.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @panel_subscription = Panel::Subscription.find(params[:id])\n respond_to do |format|\n if @panel_subscription.update_attributes(params[:panel_subscription])\n format.html { redirect_to(@panel_subscription, :notice => 'Subscription was successfully updated.') }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @panel_subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @newsletter_subscription = NewsletterSubscription.find(params[:id])\n\n respond_to do |format|\n if @newsletter_subscription.update_attributes(params[:newsletter_subscription])\n format.html { redirect_to newsletter_subscriptions_path, notice: 'Subscription was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @newsletter_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def subscription_update\n data = request.body.read\n @verified = verify_webhook(data, request)\n if @verified\n ReserveInventory.delay(:retry => false).update_reserve_inventory\n head :ok\n else\n head :error\n end\n end", "def create\n @subscription = Subscription.new(subscription_params)\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription, notice: (I18n.t :subscription_created) }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @subscription.activity :params => {:composite_key => \"#{@subscription.game_id},#{@subscription.player_id}\"}\n respond_to do |format|\n if @subscription.update(subscription_params) \n format.html { redirect_to @subscription.game, notice: 'Subscription was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscription }\n else\n format.html { render :edit }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_subscriptions_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: StreamsApi.update_subscriptions ...'\n end\n # resource path\n local_var_path = '/users/me/subscriptions'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'delete'] = @api_client.build_collection_param(opts[:'delete'], :multi) if !opts[:'delete'].nil?\n query_params[:'add'] = @api_client.build_collection_param(opts[:'add'], :multi) if !opts[:'add'].nil?\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\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'JsonSuccessBase'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || []\n\n new_options = opts.merge(\n :operation => :\"StreamsApi.update_subscriptions\",\n :header_params => 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(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: StreamsApi#update_subscriptions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def change_subscription\n @user = User.find(params[:id])\n @user.notify = [email protected]\n @user.save\n respond_with(@user) do\n redirect_to \"/users/successful_unsubscribe\"\n end\n end", "def set_subscription\n @subscription = ::Pushar::Core::Subscription.unscoped.find(params[:id])\n end", "def update\n respond_to do |format|\n if @vendor_subscription.update(vendor_subscription_params)\n format.html { redirect_to @vendor_subscription, notice: 'Vendor subscription was successfully updated.' }\n format.json { render :show, status: :ok, location: @vendor_subscription }\n else\n format.html { render :edit }\n format.json { render json: @vendor_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\nrespond_to do |format|\n if @subscription.update(subscription_params)\n format.html { redirect_to users_profile_url(current_user.id), notice: 'Your pet was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscription }\n else\n format.html { render :edit }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\nend\nend", "def create\n @subscription = Subscription.new(params[:subscription])\n\n @subscription.owner = Company.find(params[:company_id]) if params[:company_id]\n @subscription.owner = Person.find(params[:person_id]) if params[:person_id]\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription.owner, notice: 'Subscription was successfully created.' }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @subscribe.update(subscribe_params)\n format.html {redirect_to @subscribe, notice: 'Subscribe was successfully updated.'}\n format.json {render json: @subscribe, status: :ok}\n else\n format.html {render :edit}\n format.json {render json: @subscribe.errors, status: :unprocessable_entity}\n end\n end\n end", "def update\n\n @subscription.subscribe(current_user.account, subscription_params[:stripe_plan_id], coupon: subscription_params[:coupon_code])\n\n if @subscription.save\n redirect_to @subscription, notice: 'Subscription was successfully updated.'\n else\n @verrors = @subscription.errors.full_messages\n render 'edit'\n end\n end", "def create\n @subscription = Subscription.new(subscription_params)\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to root_url, notice: 'Subscription was successfully created.' }\n format.json { render action: 'show', status: :created, location: @subscription }\n else\n format.html { render action: 'new' }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @subscription_type = SubscriptionType.find(params[:id])\n\n respond_to do |format|\n if @subscription_type.update_attributes(params[:subscription_type])\n flash[:notice] = 'SubscriptionType was successfully updated.'\n format.html { redirect_to(@subscription_type) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subscription_type.errors, :status => :unprocessable_entity }\n end\n end\n end", "def post(subscription_form)\n HttpClient::Preconditions.assert_class('subscription_form', subscription_form, Apidoc::Models::SubscriptionForm)\n @client.request(\"/subscriptions\").with_json(subscription_form.to_json).post { |hash| Apidoc::Models::Subscription.new(hash) }\n end", "def create\n megam_rest.post_subscriptions(to_hash)\n end", "def destroy\n subscription = current_user.subscriptions.find(params[:id])\n subscription.destroy!\n\n render json: { status: 'success'}\n end", "def create\n @subscription = Subscription.new(subscription_params)\n @subscription.user = current_user\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription, notice: t('controller.successfully_created', model: t('activerecord.models.subscription')) }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def bulk_update_subscriptions(subscriptions = [])\n attrs = { updateSubscriptionsRequests: subscriptions }\n Iterable.request(conf, '/users/bulkUpdateSubscriptions').post(attrs)\n end", "def update\n @list_subscription = ListSubscription.find(params[:id])\n\n respond_to do |format|\n if @list_subscription.update_attributes(params[:list_subscription])\n format.html { redirect_to @list_subscription, notice: 'List subscription was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @list_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def subscribe_author\n self.subscriptions.create user_id: self.user.id\n end", "def update\n respond_to do |format|\n if @subscription_type.update(subscription_type_params)\n format.html { redirect_to @subscription_type, notice: 'Subscription types was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscription_type }\n else\n format.html { render :edit }\n format.json { render json: @subscription_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def subscribe\n Socky.send( {:action => \"subscribe\",\n :channel => params[:channel],\n :client => (params[:client_id] || '')}.to_json)\n render :text => \"ok\"\n end", "def update\n @subscriber = Subscriber.find(params[:id])\n\n respond_to do |format|\n if @subscriber.update_attributes(params[:subscriber])\n format.html { redirect_to @subscriber, notice: 'Subscriber was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscriber.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @subscriber = Subscriber.find(params[:id])\n\n respond_to do |format|\n if @subscriber.update_attributes(params[:subscriber])\n format.html { redirect_to @subscriber, notice: 'Subscriber was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscriber.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @user_to_channel_subscription.update(user_to_channel_subscription_params)\n format.html { redirect_to @user_to_channel_subscription, notice: 'User to channel subscription was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_to_channel_subscription }\n else\n format.html { render :edit }\n format.json { render json: @user_to_channel_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def subscription(id)\n Sensit::Api::Subscription.new id, @http_client\n end", "def subscription_params\n params.require(:subscription).permit(:subscribed_id)\n end", "def update\n @subscriber = Subscriber.find(params[:id])\n\n respond_to do |format|\n if @subscriber.update_attributes(params[:subscriber])\n format.html { redirect_to @subscriber, notice: 'Subscriber was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscriber.errors, status: :unprocessable_entity }\n end\n end\n end", "def subscribe!\n Subscription.transaction do\n subscription = create_stripe_subscription!\n store.subscriptions.create!(\n customer: user,\n stripe_plan_id: stripe_plan_id,\n stripe_id: subscription.id,\n first_date: Date.today,\n status: :active\n )\n end\n end", "def update\n bundle_subscriptions = create_bundle_subs\n if BundleSubscription.import(bundle_subscriptions)\n @bundle.bundle_subscriptions.where.not(id: bundle_subscriptions).destroy_all\n redirect_to @bundle, notice: 'Bundle was successfully updated.'\n else\n edit\n flash[:alert] = 'Something went wrong while updating your bundle. Please try again.'\n render :edit and return\n end\n end" ]
[ "0.73311466", "0.7281468", "0.72590774", "0.70495903", "0.6968479", "0.69529593", "0.69452065", "0.69452065", "0.69452065", "0.68587536", "0.68458587", "0.68379724", "0.68211967", "0.68088424", "0.6798248", "0.6798027", "0.6798027", "0.674952", "0.67362535", "0.67362535", "0.67362535", "0.6729802", "0.6717158", "0.6698945", "0.6694063", "0.66922677", "0.66851705", "0.6676972", "0.6661495", "0.6659467", "0.6656466", "0.66541916", "0.6628648", "0.6626374", "0.6626374", "0.6626374", "0.6626374", "0.6626374", "0.6626374", "0.6626374", "0.6626374", "0.6626374", "0.6626374", "0.6626374", "0.6626374", "0.6626374", "0.6626374", "0.66194636", "0.66194636", "0.6590679", "0.65775645", "0.6576604", "0.6576604", "0.6553846", "0.6487056", "0.6418879", "0.64182216", "0.64074063", "0.63692766", "0.63692766", "0.636587", "0.6339838", "0.6298141", "0.62835574", "0.62794167", "0.6273514", "0.62679833", "0.62524134", "0.62404895", "0.6215941", "0.62122893", "0.62031347", "0.6195451", "0.6181032", "0.6180559", "0.6174736", "0.61601806", "0.61377877", "0.6132682", "0.61283827", "0.6122805", "0.61198205", "0.6116745", "0.6100807", "0.60961866", "0.60953665", "0.6094253", "0.6080976", "0.6078388", "0.6075936", "0.607365", "0.60708064", "0.6064344", "0.6064344", "0.6047099", "0.6038468", "0.60278445", "0.6024221", "0.602343", "0.60128516" ]
0.7120728
3
DELETE /subscriptions/1 DELETE /subscriptions/1.json
def destroy @subscription = current_user.subscriptions.find(params[:id]) manga = Manga.find(@subscription.manga_id) @subscription.destroy respond_to do |format| format.html { redirect_to mangas_url, notice: 'Successfully unsubscribed to '+ manga.display_name.to_s} format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete options={}, headers={}\n @connection.delete \"subscriptions.json\", options, headers\n end", "def destroy\n subscription = current_user.subscriptions.find(params[:id])\n subscription.destroy!\n\n render json: { status: 'success'}\n end", "def delete_subscriptions\n end", "def destroy\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to subscriptions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to subscriptions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to subscriptions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to subscriptions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to subscriptions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to subscriptions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription = current_user.subscriptions.find(params[:id])\n #TODO move to model Subscription\n if not current_user.fitbit.nil?\n path = ['/1/user/-', @subscription.collection_path, 'apiSubscriptions', @subscription.subscription_id + '-' + @subscription.collection_path]\n current_user.fitbit.client.delete(path.join('/') + '.json')\n flash[:success] = 'Subscription successfully removed from Fitbit.'\n else\n flash[:error] = 'Can not remove subscription from Fitbit, because you are not connected.'\n end\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to subscriptions_url }\n format.json { head :ok }\n end\n end", "def destroy\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to subscriptions_url, notice: (I18n.t :subscription_deleted) }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription.destroy\n\n head :no_content\n end", "def destroy\n @api_subscription.destroy\n respond_to do |format|\n format.html { redirect_to api_subscriptions_url, notice: 'Subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to root_url}\n format.json { head :no_content }\n end\n end", "def destroy\r\n @subscription = Subscription.find(params[:id])\r\n @subscription.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to business_user_subscriptions_path }\r\n format.json { head :ok }\r\n end\r\n end", "def destroy\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to subscriptions_url, notice: 'Subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to subscriptions_url, notice: 'Subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to subscriptions_url, notice: 'Subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to subscriptions_url, notice: 'Subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to subscriptions_url, notice: 'Subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to campaign_subscriptions_path(@campaign) }\n format.json { head :no_content }\n end\n end", "def delete_webhook_subscription(id,opts={})\n query_param_keys = [\n \n\n ]\n\n form_param_keys = [\n \n\n ]\n\n # verify existence of params\n raise \"id is required\" if id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :id => id\n\n )\n\n # resource path\n path = path_replace(\"/lti/subscriptions/{id}\",\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_query_params(options, query_param_keys)\n\n response = mixed_request(:delete, path, query_params, form_params, headers)\n response\n \n\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to(subscriptions_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to(subscriptions_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to(subscriptions_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @subscription_request = SubscriptionRequest.find(params[:id])\n @subscription_request.destroy\n\n respond_to do |format|\n format.html { redirect_to subscription_requests_url }\n format.json { head :ok }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n auth!\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to(manage_screen_field_subscriptions_url(@screen, @field)) }\n format.xml { head :ok }\n end\n end", "def destroy\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @crytosubscription.destroy\n respond_to do |format|\n format.html { redirect_to crytosubscriptions_url, notice: 'Crytosubscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to @subscription.transaction }\n format.json { head :no_content }\n end\n end", "def remove_subscription\n buyer = @current_user\n customer_id = buyer.stripe_customer_id\n customer = Stripe::Customer.retrieve(customer_id)\n subscription.delete\n render json: { message: 'Unsubscribed succesfully' }, status: 200\n end", "def destroy\n @subscribe.destroy\n\n respond_to do |format|\n format.html { redirect_to subscribes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n if session[:user_id] \n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n \n respond_to do |format|\n format.html { redirect_to(subscriptions_url) }\n format.xml { head :ok }\n end\n end\n end", "def delete_subscription(id)\n delete(\"/subscriptions/#{id}\")\n end", "def destroy \n Instagram.delete_subscription({:id => params[:id]})\n local_subscription = Subscription.find_by_original_id params[:id]\n local_subscription.destroy if local_subscription\n redirect_to :admin_subscriptions\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @owner = @subscription.owner\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to polymorphic_url([@owner, :subscriptions]) }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscribe.destroy\n respond_to do |format|\n format.html { redirect_to subscribes_url, notice: 'Subscribe was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscribe.destroy\n respond_to do |format|\n format.html { redirect_to subscribes_url, notice: 'Subscribe was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscribe.destroy\n respond_to do |format|\n format.html { redirect_to subscribes_url, notice: 'Subscribe was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @admin_subscription.destroy\n respond_to do |format|\n format.html { redirect_to admin_subscriptions_url, notice: 'L\\'abonnement a bien été créé supprimé.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to artist_subscription_path }\n format.json { head :ok }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to request.env[\"HTTP_REFERER\"] }\n format.xml { head :ok }\n end\n end", "def destroy\n @panel_subscription = Panel::Subscription.find(params[:id])\n @panel_subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to(panel_subscriptions_url) }\n format.json { head :ok }\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\n @newsletter_subscription = NewsletterSubscription.find(params[:id])\n @newsletter_subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to newsletter_subscriptions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n auth!\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to(screen_field_subscription_path(@screen, @field)) }\n format.xml { head :ok }\n format.js { head :ok }\n end\n end", "def destroy\n @service_subscription = ServiceSubscription.find(params[:id])\n @service_subscription.destroy\n \n redirect_to service_subscriptions_path\n\n # respond_to do |format|\n # format.html { redirect_to(service_subscriptions_url) }\n # format.xml { head :ok }\n # end\n end", "def destroy\n return error_message(['Access denied'], 403) unless current_user?(@user)\n\n course = fetch_cache(Course, params[:id])\n @user.subscriptions_to_courses.destroy(course)\n render json: {status: 'Ok'}\n end", "def destroy!\n Dropio::Resource.client.delete_subscription(self)\n nil\n end", "def destroy\n @subscriber = Subscriber.find(params[:id])\n @subscriber.destroy\n\n respond_to do |format|\n format.html { redirect_to account_subscribers_url(@account) }\n format.json { head :no_content }\n end\n end", "def destroy\n @list_subscription = ListSubscription.find(params[:id])\n @list_subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to list_subscriptions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscriber = Subscriber.find(params[:id])\n @subscriber.destroy\n\n respond_to do |format|\n format.html { redirect_to subscribers_url }\n format.json { head :ok }\n end\n end", "def delete_webhook_subscription(subscription_id:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::DELETE,\n '/v2/webhooks/subscriptions/{subscription_id}',\n 'default')\n .template_param(new_parameter(subscription_id, key: 'subscription_id')\n .should_encode(true))\n .header_param(new_parameter('application/json', key: 'accept'))\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end", "def destroy\n\n @subscriber = Subscriber.find(params[:id])\n @subscriber.destroy\n\n respond_to do |format|\n format.html { redirect_to subscribers_url }\n format.json { head :ok }\n end\n end", "def destroy\n @subscriber = Subscriber.find(params[:id])\n @subscriber.destroy\n\n respond_to do |format|\n format.html { redirect_to subscribers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @email_newsletter_subscription.destroy\n respond_to do |format|\n format.html { redirect_to email_newsletter_subscriptions_url, notice: 'Email newsletter subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription_user.destroy\n respond_to do |format|\n format.html { redirect_to subscription_users_url, notice: 'Subscription user was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscriptions = []\n\n # query parameter with the ids of all the necessarily deleted subscriptions\n subscription_id_string = params[:subscription][:subscriptions]\n\n # converts the query parameter string into an array. Query parameter gets sent like this \"[1,2,3]\"\n all_ids = subscription_id_string[subscription_id_string.index(\"[\") + 1, subscription_id_string.index(\"]\") - 1].split(\",\")\n\n # for each id in the array of ids, find the Subscription with that id, add it to the array of deleted subscriptions\n # for the view, and then destroy the subscription\n all_ids.each do |id|\n this_subscription = Subscription.find(id)\n @subscriptions << this_subscription\n\n # decrement subscription count of corresponding dept/club/team\n if this_subscription.category == \"department\"\n dept = Department.find(this_subscription.subscribed_to)\n dept.subscriber_count -= 1\n dept.save\n elsif this_subscription.category == \"club\"\n club = Club.find(this_subscription.subscribed_to)\n club.subscriber_count -= 1\n club.save\n else\n team = AthleticTeam.find(this_subscription.subscribed_to)\n team.subscriber_count -= 1\n team.save\n end\n\n this_subscription.destroy\n end\n end", "def destroy\n @subscription_type = SubscriptionType.find(params[:id])\n @subscription_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(subscription_types_url) }\n format.xml { head :ok }\n end\n end", "def clear_subs\n instagram_client.subscriptions.each do |sub|\n instagram_client.delete_subscription(id: sub.id)\n end\n\n redirect_to list_subs_path\n end", "def destroy\n @vendor_subscription.destroy\n respond_to do |format|\n format.html { redirect_to vendor_subscriptions_url, notice: 'Vendor subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscribe.destroy\n respond_to do |format|\n format.html {redirect_to subscribes_url, notice: 'Subscribe was successfully destroyed.'}\n format.json {render json: @subscribe, status: :ok}\n end\n end", "def destroy\n @event_subscription.destroy\n head :no_content\n end", "def destroy\n @unsubscription.destroy\n respond_to do |format|\n flash[:success] = \"Le traitement a bien été supprimé!\"\n format.html { redirect_to unsubscriptions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html {\n if request.referrer == subscription_url(@subscription)\n redirect_to session[:sub_delete_return_to]\n else\n redirect_to :back\n end\n }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscriber.destroy\n respond_to do |format|\n format.html { redirect_to subscribers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription.destroy\n return_back_or_ajax\n end", "def delete_subscription(entity)\r\n subscriptions.delete(entity)\r\n end", "def destroy\n @subscription_type.destroy\n respond_to do |format|\n format.html { redirect_to subscription_types_path, notice: 'Subscription types was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription_history = SubscriptionHistory.find(params[:id])\n @subscription_history.destroy\n\n respond_to do |format|\n format.html { redirect_to(subscription_histories_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n\t @subscription = Subscription.find(params[:id])\n\t @subscription.remove if @subscription\n\n\t redirect_to plans_path\t \t\n\tend", "def destroy\n @premium_subscription.destroy\n respond_to do |format|\n format.html { redirect_to premium_subscriptions_url, notice: 'Premium subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n\n @subscription.status = 'canceled'\n\n redirect_to subscriptions_path, notice: \"Your #{@subscription.category.name} subscription has been canceled.\"\n @subscription.save\n end", "def delete_subscription subscription\n subscriber.delete_subscription subscription: subscription_path(subscription)\n end", "def delete\n result = Hash.new\n begin # try\n result = SubscribesHlp.delete(params[:id])\n rescue # catch\n result['status'] = false\n result['error'] = \"#{$!}\"\n ensure # finally\n render json: result\n end\n end", "def delete_webhook_subscription(id)\n\t\tputs \"Attempting to delete subscription for webhook: #{id}.\"\n\n\t\tif @api_tier == 'premium'\n\t\t\t@uri_path = \"#{@uri_path}/all/#{id}/subscriptions/all.json\"\n\t else\n\t\t\t@uri_path = \"#{@uri_path}/webhooks/#{id}/subscriptions.json\"\n\t\tend\n\n\t\tresponse = @twitter_api.make_delete_request(@uri_path)\n\n\t\tif response == '204'\n\t\t\tputs \"Webhook subscription for #{id} was successfully deleted.\"\n\t\telse\n\t\t\tputs response\n\t\tend\n\t\t\n\t\tresponse\n\tend", "def destroy\n @user_to_channel_subscription.destroy\n respond_to do |format|\n format.html { redirect_to user_to_channel_subscriptions_url, notice: 'User to channel subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscriber = Subscriber.find(params[:id])\n @subscriber.destroy\n\n respond_to do |format|\n format.html { redirect_to subscribers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @panel_subscription_transaction = Panel::SubscriptionTransaction.find(params[:id])\n @panel_subscription_transaction.destroy\n\n respond_to do |format|\n format.html { redirect_to(panel_subscription_transactions_url) }\n format.json { head :ok }\n end\n end", "def destroy\n @subscription_list.destroy\n respond_to do |format|\n format.html { redirect_to subscription_lists_url, notice: 'La Lista de Entrega se borró exitosamente.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @misuration_subscription.destroy\n respond_to do |format|\n format.html { redirect_to misuration_subscriptions_url, notice: 'Iscrizione al sensore eliminata correttamente' }\n format.json { head :no_content }\n end\n end", "def delete(mirror=@mirror)\n result = client.execute(\n :api_method => mirror.subscriptions.delete,\n :parameters => { 'id' => collection })\n if result.error?\n puts \"An error occurred: #{result.data['error']['message']}\"\n end\n end", "def deletesubscriber\n\n\tparams[\"phone\"] = params[\"phone\"].gsub(\"\\s\",\"\").gsub(/^0044/, \"\").gsub(/^\\+44/, \"\")\n\tif params[\"phone\"].length == 10\n\t\tparams[\"phone\"] = '0' + params[\"phone\"]\n\tend\n\n\tif (Subscriber.exists?(:phone => params[:phone]))\n\t\tsubscriber = Subscriber.where(:phone => params[:phone]).first\n\t\tsubscriber.destroy\n\n\t\trespond_to do |format|\n\t\t format.html # deletesubscriber.html.erb\n\t\tend\n\telse\n\t\tredirect_to :action => \"unsubscribe\", phone: params[:phone]\n end\n end", "def destroy\n @subscriber.destroy\n respond_to do |format|\n format.html { redirect_to subscribers_url, notice: 'Subscriber was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def unsubscribe_subscriber(id)\n delete_json(\"#{endpoint}/subscribers/#{uri_encode(id)}\")\n end", "def unsubscribe_subscriber(id)\n delete_json(\"#{endpoint}/subscribers/#{uri_encode(id)}\")\n end", "def destroy\n # First cancel the Stripe subscription\n\n @subscription.cancel_subscription(current_user.account)\n # Then destroy the subscription record\n @subscription.delete\n\n redirect_to subscriptions_url\n end", "def unsubscribe\n email = Base64.decode64(params[:token])\n Subscription.where(email: email).destroy_all\n end", "def cancel\n success = current_subscriber.cancel_subscription\n render json: { success: success }\n end", "def deleteSubscription(subscr)\n subscriptions = Hash.new\n if @subscriptionLists.hasKey(\"subscriptions\")\n subscriptions = @subscriptionLists.getRepositoryObject(\"subscriptions\").getObject\n end\n #subscriptions[subscr] = Array.new\n #@subscriptionLists.commitObject(\"subscriptions\", subscriptions, false)\n subscriptions.delete(subscr)\n @subscriptionLists.commitObject(\"subscriptions\", subscriptions, false)\n end", "def destroy\n @subscription_group = SubscriptionGroup.find(params[:id])\n @subscription_group.destroy\n\n respond_to do |format|\n format.html { redirect_to subscription_groups_url }\n format.json { head :no_content }\n end\n end", "def destroy\n\n targets = Subscription.where(ordinal: (@subscription.ordinal + 1)..Float::INFINITY)\n\n targets.each do |target|\n target.update(ordinal: target.ordinal - 1)\n end\n\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to owner_subscriptions_url(owner_id: @owner.id), notice: 'サブスクショップを削除しました' }\n format.json { head :no_content }\n end\n end", "def destroy\n transaction do\n clean\n connection.delete \"DELETE FROM user_subscriptions WHERE subscription_id = #{id}\"\n connection.delete \"DELETE FROM subscriptions WHERE id = #{id}\"\n end\n end", "def destroy\n @category_subscription.destroy\n respond_to do |format|\n format.html { redirect_to category_subscriptions_url, notice: 'Category subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\[email protected]\nrespond_to do |format|\n format.html { redirect_to :back, notice: 'Pet was successfully destroyed.' }\n format.json { head :no_content }\nend\nend", "def destroy\n @category_subscription.destroy\n respond_to do |format|\n format.html { redirect_to admin_category_subscriptions_url, notice: 'Подписка на категорию была успешно удалена.' }\n format.json { head :no_content }\n end\n end", "def destroy\n event = Subscription.find(params[:id]).event\n current_user.unsubscribe(event)\n redirect_to event\n end", "def destroy\n @product_subscription = ProductSubscription.find(params[:id])\n @product_subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to campaign_subscription_path(@product_subscription.subscription.campaign, @product_subscription.subscription) , :notice => 'Product subscription was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def unsubscribe(uuid)\n post_json(\"#{endpoint}/unsubscribe/#{uri_encode(uuid)}\")\n end", "def unsubscribe(uuid)\n post_json(\"#{endpoint}/unsubscribe/#{uri_encode(uuid)}\")\n end" ]
[ "0.8083839", "0.7971518", "0.7749676", "0.77227986", "0.76973474", "0.76788694", "0.76788694", "0.76788694", "0.76788694", "0.766344", "0.75745755", "0.75494754", "0.75242066", "0.7512467", "0.74898785", "0.74766344", "0.74766344", "0.74766344", "0.74766344", "0.74766344", "0.7430863", "0.7402852", "0.7389791", "0.7389791", "0.7389791", "0.73481774", "0.7345754", "0.7341421", "0.7334125", "0.7315209", "0.72989845", "0.72939456", "0.72885406", "0.72582734", "0.71930397", "0.7180277", "0.7174165", "0.7174165", "0.7174165", "0.7169685", "0.71584594", "0.71415883", "0.7106714", "0.7106371", "0.7053827", "0.70474845", "0.70270944", "0.7017797", "0.70120806", "0.7010806", "0.7009525", "0.7000163", "0.6999704", "0.6994056", "0.6978384", "0.6928824", "0.69250244", "0.690034", "0.6893621", "0.68918157", "0.68900865", "0.6882974", "0.6880508", "0.68732697", "0.6855283", "0.68506974", "0.68364197", "0.6834784", "0.6825377", "0.6824307", "0.6813649", "0.6813254", "0.68043864", "0.67935514", "0.67930984", "0.67714334", "0.6769921", "0.6768724", "0.6756108", "0.6747615", "0.67351985", "0.6734292", "0.6723186", "0.6701433", "0.6693665", "0.6693665", "0.66927797", "0.66847116", "0.66740596", "0.66574746", "0.66559565", "0.66548216", "0.6653988", "0.66247725", "0.66168004", "0.65775114", "0.65743136", "0.6557313", "0.65516657", "0.65516657" ]
0.7328218
29
END CONFIG Print Message
def pp(message) puts "[#{NAME}] #{message}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logoutConfig(conf)\n\tif conf[:saveDirs].empty?\n\tputs \"no Directories specified in #{Kconfig}\"\n\texit 1\nend\nputs 'backing up Directories:'\nconf[:saveDirs].each { |e|\tputs e}\n\nunless conf[:exFiles].empty?\nputs \"\\nexcluding all Files like:\"\n\tconf[:exFiles].each { |e| puts e}\nend\nunless conf[:exDirs].empty?\nputs \"\\nexcluding all Directories like:\"\n\tconf[:exDirs].each { |e| puts e}\nend\nif conf[:server]\n\tprint \"\\nupload to server: \"+conf[:server]+\":\"+conf[:port].to_s\n\tputs '/'+conf[:ftpDir] if conf[:ftpDir]\n puts \"\"\nend\nif conf[:generations]\n\tputs \"\\keeping max #{conf[:generations]} generations \"\nend\n\nend", "def output_config\n puts <<-END\ngraph_category App\ngraph_title SOLR query times\ngraph_vlabel count\nqtime.label qtime\nEND\n exit 0\nend", "def config\n puts <<-END\ngraph_title puppet clients usage\ngraph_vlabel clients\nknown_clients.label Known Clients\navg_compile.label Average configuration compile\nlast5m_count.label Clients in the last 5 minutes\nlast24h_unique_count.label unique clients in the last 24 hours\ngraph_category puppet\nEND\n exit 0\nend", "def output_config\n puts 'Using config file: ' + $CONFIG_FILE \n @conf.each { |key, value| puts key + \" = \" + value }\n end", "def print_config\n self.config_to_hash.each { |k, v| puts \"#{k}: #{v}\" }\n end", "def help_exit\r\n puts <<HELP\r\nUsage: etl.rb CONFIG_FILE\r\nHELP\r\n # exit 1\r\nend", "def config\r\n\t\t\t\"<p>No additional configuration is available</p>\"\r\n\t\tend", "def appt_conf\n puts \"Thank you, your appointment was created!\"\n puts \" \"\n puts \"***************************************************** \"\n puts \" \"\n end", "def config_text\n send_command(:getinfo, 'config-text')\n reply = \"\"\n read_reply # skip \"250+config-text=\"\n while line = read_reply\n break unless line != \".\"\n reply.concat(line + \"\\n\")\n end\n read_reply # skip \"250 OK\"\n return reply\n end", "def log_configuration\n return if @silent\n if !@do_training && !@do_testing\n Nimbus.message \"*\" * 50\n Nimbus.message \"* Nimbus could not find any input file: \"\n Nimbus.message \"* No training file (default: training.data)\"\n Nimbus.message \"* No testing file (default: testing.data)\"\n Nimbus.message \"* Not defined in config file (default: config.yml)\"\n Nimbus.message \"* Nothing to do.\"\n Nimbus.message \"*\" * 50\n Nimbus.stop \"Error: No input data. Nimbus finished.\"\n end\n\n Nimbus.message \"*\" * 50\n Nimbus.message \"* Nimbus version #{::Nimbus::VERSION}\"\n Nimbus.message \"* configured with the following parameters: \"\n Nimbus.message \"* Forest size: #{@forest_size} trees\"\n Nimbus.message \"* Total SNP count: #{@tree_SNP_total_count}\"\n Nimbus.message \"* SNPs sample size (mtry): #{@tree_SNP_sample_size}\"\n Nimbus.message \"* Minimun node size in tree: #{@tree_node_min_size}\"\n\n if @classes\n Nimbus.message \"* Mode: CLASSIFICATION\"\n Nimbus.message \"* Classes: [#{@classes*', '}]\"\n else\n Nimbus.message \"* Mode: REGRESSION\"\n end\n Nimbus.message \"*\" * 50\n\n if @do_training\n Nimbus.message \"* Training data:\"\n Nimbus.message \"* Training file: #{@training_file}\"\n Nimbus.message \"*\" * 50\n end\n\n if @do_testing\n Nimbus.message \"* Data to be tested:\"\n Nimbus.message \"* Testing file: #{@testing_file}\"\n if @forest_file\n Nimbus.message \"* using the structure of the random forest stored in:\"\n Nimbus.message \"* Random forest file: #{@forest_file}\"\n end\n Nimbus.message \"*\" * 50\n end\n end", "def conclusion\n separator\n puts \"#{@app_name} successfully deployed! URL: http://#{app_name}\"\n puts \"\\n\\n\"\n end", "def debug_message_end(msg)\n debug_message(msg, 0, \"<<<\")\n end", "def action_remove\n notifying_block do\n delete_config\n end\n end", "def conf_message(idescription, message)\n print_line\n puts \"#{idescription} #{message}\"\n print_line\n end", "def display_config\n # Format types and the additional options that apply to each type\n format_opts = {\n \"block\" => [\n \"entry-break\",\n \"element-break\",\n \"exit-break\",\n \"subindent\",\n \"normalize\",\n \"wrap-length\"\n ],\n \"inline\" => [ ],\n \"verbatim\" => [ ]\n }\n @elt_opts.keys.sort.each do |elt_name|\n puts elt_name\n opts = @elt_opts[elt_name]\n format = opts[\"format\"]\n # Write out format type, then options that apply to the format type\n puts \" format = #{format}\"\n format_opts[format].each do |opt_name|\n puts \" #{opt_name} = #{opts[opt_name]}\"\n end\n puts\n end\n end", "def print\n GoHiring::Config[\"messages\"][\"hello\"] % settings\n end", "def end_of_section\n\t$report_file.puts(\"-------END OF SECTION-------\")\n\t$report_file.puts\nend", "def configure_organization\n configure_information\n configure_colors\n configure_logo\n configure_email\n configure_phone\n configure_faq\n configure_form\n configure_admin\n output_config_for_locale(\"en\")\n output_config_for_locale(\"es\")\n success_box(\"Your app is now configured!\")\nend", "def generate_section_end(format, main_section)\n case format\n when 'php'\n \" ],\\n\"\n else\n ''\n end\n end", "def do_exit(msg='')\n @out.puts \"#{INVALID_OPTS} #{msg}\"\n exit\n end", "def print_configuration\n puts \"--------------------------------------\"\n puts \" Server configuration \"\n puts \"--------------------------------------\"\n pp @config\n\n puts \"--------------------------------------\"\n puts \" Registered Instance Types \"\n puts \"--------------------------------------\"\n pp @instance_types \n end", "def save_config\n\t\t# Build out the console config group\n\t\tgroup = {}\n\n\t\tif (active_module)\n\t\t\tgroup['ActiveModule'] = active_module.fullname\n\t\tend\n\n\t\t# Save it\n\t\tbegin\n\t\t\tMsf::Config.save(ConfigGroup => group)\n\t\trescue ::Exception\n\t\t\tprint_error(\"Failed to save console config: #{$!}\")\n\t\tend\n\tend", "def endpwent\n ::Etc.endpwent\n end", "def finalize_configuration\n\n #Put the FPGA into startup mode...\n self.instruction = :jstart\n\n #And then allow the FPGA to run normally.\n run_test(FPGAStartup)\n\n end", "def configuring what\n puts \"Configuring: #{what}...\"\n end", "def finish\n @config.save_history(Readline::HISTORY.to_a)\n end", "def output\n @tool.config_file :local_dir, \"#{@service_name}.conf\" do |configfile|\n configfile << @tool.git_header('palletjack2unbound')\n @service_config['service.unbound.server'].each do |config|\n config.each do |key, value|\n configfile << \"#{key}: #{value}\\n\"\n end\n end\n end\n end", "def dew_config\n start = Time.now\n @connected_apis.each { |api_name|\n puts \"\\n\\#\\#\\#\\# #{api_name} Config Begin \\#\\#\\#\\#\"\n api = instance_variable_get(\"@\" + api_name)\n api.dew_config @config\n puts \"\\n\\#\\#\\#\\# #{api_name} Config End \\#\\#\\#\\#\"\n }\n puts \"Took %.2f seconds to resolve and configure.\" % (Time.now - start)\n end", "def output\n @tool.config_file :conf_dir, \"#{@zone}.conf\" do |stubfile|\n stubfile << @tool.git_header('palletjack2unbound')\n stubfile << \"\nstub-zone:\n name: #{@zone}\\n\"\n\n @stub_addrs.each do |addr|\n stubfile << \" stub-addr: #{addr}\\n\"\n end\n\n if @transparent\n stubfile << \"\\nserver:\\n local-zone: \\\"#{@zone}\\\" transparent\\n\"\n end\n end\n end", "def dump_config\n send_command \"--dump-config\"\n end", "def confirm_config(keypair:, zones:, security_groups:, instance_type:,\n image_id:, iam_instance_profile:, prompt:, use_vpc: use_vpc,\n vpc_subnets: nil, has_elb: has_elb, config:, termination_policies:,\n **unused_values)\n\n puts ' Preparing to configure the following autoscaling group:'\n puts \" Launch Config: #{Tapjoy::AutoscalingBootstrap.config_name}\"\n puts \" Auto Scaler: #{Tapjoy::AutoscalingBootstrap.scaler_name}\"\n puts \" ELB: #{elb_list(config)}\" if has_elb\n puts \" Key Pair: #{keypair}\"\n puts \" Zones: #{zones.join(',')}\"\n puts \" Groups: #{security_groups.sort.join(',')}\"\n puts \" Instance Type: #{instance_type}\"\n puts \" Image ID: #{image_id}\"\n puts \" IAM Role: #{iam_instance_profile}\"\n puts \" VPC Subnets: #{vpc_subnets}\" if use_vpc\n puts \" Termination Policies: #{termination_policies.sort.join(',')}\"\n\n puts \"\\n\\nNOTE! Continuing may have adverse effects if you end up \" \\\n \"deleting an IN-USE PRODUCTION scaling group. Don't be dumb.\"\n return true unless prompt\n agree('Is this information correct? [y/n]')\n end", "def footer\n puts\n puts \"Need an expert to analyze your application?\"\n puts \"Mail to #{link('[email protected]')} or visit us at #{link('http://railsdoctors.com')}.\"\n line(:green)\n puts \"Thanks for using #{colorize('request-log-analyzer', :white, :bold)}!\"\n end", "def end_section\n end", "def after_configure(&block)\n @after_configure_blocks ||= []\n @after_configure_blocks << block\n end", "def printUsageMessage()\n\n print \"Check the last NAMD log file in a directory to make sure the run either completed\\n\"\n print \"successfully or died after all necessary restart files were written. Then restart\\n\"\n print \"the run or print an error message.\\n\"\n print \" autoNamdRun.rb <configFile>\\n\"\n print \" <configFile> - file listing all NAMD jobs to check\\n\"\n\n return\nend", "def end\n\t\t\t# Give an extra line below the output for the shell to prompt on.\n\t\t\tadd_bar(nil)\n\n\t\t\tNcurses.endwin\n\t\tend", "def config\n status = `#{PASSENGER_STATUS}`\n \n puts <<-CONFIG\ngraph_category #{GRAPH_CATEGORY}\ngraph_title Passenger queue\ngraph_vlabel count\ngraph_args --base 1000 -l 0\ngraph_info The amount of requests waiting on global queue\n \nrequests.label requests\nCONFIG\n exit 0\nend", "def after_configuration\n # do nothing by default\n end", "def generate_config\n\n # Tell the user what's going on\n puts \"> Generating the config file\".green\n\n config = <<CONF_END\n\n# Configuration for the ServerUtility\n# Created by Christopher Hindefjord - [email protected] - http://[email protected] - 2014\n# Licensed under the MIT License (see LICENSE file)\n\nDEFAULT_ID = #{$DEFAULT_ID}\nBASE_PATH = '#{$BASE_PATH}'\nBASE_PATH_MAIL = BASE_PATH + 'maildir/'\nBASE_PATH_HOME = BASE_PATH + 'home/'\nUSER_PATH = '%domain/mails/%user'\nMAILBOX_RIGHTS = 0770 # \"ug=wrx\"\nDB_DATABASE_NAME = '#{$DB_NAME}'\nDB_ACCOUNTS_TABLE = '#{$DB_ACC_TABLE}'\nDB_DOMAINS_TABLE = '#{$DB_DOM_TABLE}'\nDB_ALIAS_TABLE = '#{$DB_VIRT_TABLE}'\nDB_USER = '#{$DB_USER}'\nDB_PASSWORD = '#{$DB_PASSWORD}'\n\nCONF_END\n\n # If this is a simulation\n if $simulate\n puts \"We're not writing to a file, so here's the config file in text:\".green\n # Just output the config file\n print config.yellow\n # Not a simulation\n else\n # Open a \"file stream\" and write to it\n File.open(CONFIG_FILE, 'w') { |f| f.write config }\n\n # Tell the user\n puts \"> Wrote the config to '#{CONFIG_FILE}'.\".green\n end\n\nend", "def handle_configuration_error(e)\n puts \"There is a configuration error with the current mongoid.yml.\"\n puts e.message\n end", "def logout\n send_command( KonoEppLogout.new, 1500 )\n end", "def config_updated(config)\n puts green(\"Config updated at: #{config}\")\n end", "def setup_complete\n puts green(\"Setup complete\")\n end", "def shut_down\n puts\n end", "def on_stop\n puts\n puts '** Thank you for using SequenceServer :).'\n puts ' Please cite: '\n puts ' Priyam A, Woodcroft BJ, Rai V, Munagala A, Moghul I, Ter F,'\n puts ' Gibbins MA, Moon H, Leonard G, Rumpf W & Wurm Y. 2015.'\n puts ' Sequenceserver: a modern graphical user interface for'\n puts ' custom BLAST databases. biorxiv doi: 10.1101/033142.'\n end", "def do_print_configuration\n frame('Configuration') do\n fade_code = CLI::UI::Color.new(90, '').code\n puts stylize(\"{{?}} #{fade_code}Values starting with {{*}} #{fade_code}were lazy loaded.#{CLI::UI::Color::RESET.code}\")\n print \"\\n\"\n\n configuration.instance_variables.each do |attribute|\n value = configuration.instance_variable_get(attribute)\n\n name = attribute.to_s.sub(/^@/, '')\n\n if value.respond_to? :call\n if @arguments.resolve_callable_attributes?\n value = begin\n configuration.send(name)\n rescue => e\n \"UNABLE TO LOAD: #{e.message}\"\n end\n end\n\n was_callable = true\n else\n was_callable = false\n end\n\n suffix = was_callable ? '{{*}}' : ' '\n\n puts stylize(\"{{yellow:#{name}}}\")\n puts stylize(\"\\t #{suffix} {{blue:#{value.inspect}}}\")\n print \"\\n\"\n end\n end\n end", "def error\n\tyield\n\tif @changedConfigDir or @changedConfigFile\n\t\tif @opts[:stealth]\n\t\t\tstealth\n\t\telse\n\t\t\tLog.warn \"Permanent changes to the servers configuration have been made, these will have to be undone to stay hidden\"\n\t\tend\n\tend\n\texit 1\nend", "def output\n puts \"Config files exist for the following sites:\"\n @local[CONFIG_DIR].contents.each do |file|\n puts \"\\t\"+file.name.split('.')[0..-3].to_s+\"\\t\"+file.last_modified.to_s\n end\n\n # And output our help file, too!\n RDoc::usage('synopsis')\n end", "def close(_notification)\n # when the profile has no controls or examples it will not have been printed.\n # then we want to ensure we print all the profiles\n print_last_control_with_examples unless last_control_is_anonymous?\n output.puts ''\n print_anonymous_examples_associated_with_last_profile\n print_profiles_without_examples\n print_profile_summary\n print_tests_summary\n end", "def end\n end", "def end_tag\n \"#TESTLAB-END-#{self.bridge.to_s.upcase}\"\n end", "def config\n # unless ENV.key?('TAXI_ENV')\n # raise StandardError, 'Tried to print environment without $TAXI_ENV set. ' \\\n # 'Abort printing production credentials.'\n # end\n\n Config.instance.print\n end", "def write_result_msg(result)\n msg = if result then\n I18n.t 'config.recreated'\n else\n I18n.t 'config.updated'\n end\n @env.ui.info msg\n end", "def die (text)\n if $convert\n $configure << %{\n\nif [[ \"$LAST\" == \"no\" ]]; then\n echo -e \"#{text}\"\n do_exit\nfi\n\n }\n else\n fail(text)\n end\nend", "def display_exiting!(text)\n # create goodbye message\n # display welformatted conclusion message\n system \"clear\"\n msg = colorize(\" #{text.upcase} \", $font_colors[:cyan])\n puts \"\\n#{msg.center(77)}\\n\\n\"\n end", "def print_end_round\n print_separator_strong\n print_msg('round_complete')\n print_separator_strong\n end", "def end\n end", "def flush\n File.open(config_file, 'w') do |f|\n f.puts JSON.pretty_generate(@conf)\n end\n end", "def flush\n File.open(config_file, 'w') do |f|\n f.puts JSON.pretty_generate(@conf)\n end\n end", "def after_configuration(&block)\n @after_configuration << block\n end", "def build_config_tgz\n\t\tcurAp = @apListBox.value;\n\t\[email protected]\n\t\tret = curAp.build_config_tgz( \"/tftpboot\" ).split( \"\\n\" );\n\t\[email protected]( \" Building config.tgz for #{curAp.mac} in /tftpboot\" )\n\t\t\n\n\t\tret.each { |line|\n\t\t\[email protected]( \"-> #{line}\", {});\n\t\t}\n\t\trefreshUI;\n\t\t\n\tend", "def remove_config(name)\n\t\tend", "def call_after_configuration(config)\n @after_configuration.each { |block| block.call(config) }\n end", "def configure\n render_text ''\n end", "def config_showAndsave\n\t SD::CI.show\n\t if (SD::CI.output)\n\t fname = SD::CI.output('junk.ini')\n\t SD::CI.save(fname)\n\t end \t \n\tend", "def finish\n @config.save_history(@history.to_a)\n puts\n exit\n end", "def shutdown\r\n\t\t\tsay \"#{name}: Exiting...\"\r\n\t\t\t@shutdown = true\r\n\t end", "def insert_exit_point\n @output_continue = true\n end", "def dump\n return unless @config_file\n File.open(@config_file,'w') do |fl|\n @todo_container.each do |category,todo_array|\n fl << \"* #{category}\\n\"\n todo_array.each do |todo_item|\n fl << \"#{priority_star(todo_item.priority)} #{todo_item.flag ? 'TODO' : 'DONE'} #{todo_item.text}\\n\"\n end\n end\n end\n end", "def run_completed(node)\n super\n Chef::Log.warn(\"<< END >>\")\n end", "def config\n \n # TODO: Re-enable:\n # # Display the value for a specific machine.\n # $ rudy -e prod -r db config param-name\n \n if @@config.nil? || @@config.empty?\n return if @@global.quiet\n raise Rudy::NoConfig\n end\n\n outform = @@global.format == :json ? :to_json : :to_yaml\n \n types = @option.marshal_dump.keys & @@config.keys # Intersections only\n types = @@config.keys if @option.all\n types = [:machines] if types.empty?\n \n if @option.project\n rf = File.join(RUDY_HOME, 'Rudyfile')\n raise \"Cannot find: #{rf}\" unless File.exists?(rf)\n li File.read(rf)\n \n elsif @option.script\n conf = fetch_script_config\n li conf.to_hash.send(outform) if conf\n \n else\n #li \"# ACCOUNTS: [not displayed]\" if types.delete(:accounts)\n types.each do |conftype|\n li \"# #{conftype.to_s.upcase}\"\n next unless @@config[conftype] # Nothing to output\n if conftype == :accounts\n skey = @@config[conftype][:aws][:secretkey]\n @@config[conftype][:aws][:secretkey] = hide_secret_key(skey)\n end\n \n li @@config[conftype].to_hash.send(outform)\n end\n end\n \n end", "def config_body_for(config)\n res = <<-EOH.gsub(/^ +/, '')\n # This file is managed by Chef.\n # Any changes to it will be overwritten.\n EOH\n res << Hash[config.sort].map { |k, v| config_for(k, v) }.compact\n .join(\"\\n\")\n end", "def after_configure(&block)\n mod = self\n config.class.set_callback(:configure, :after,\n proc { mod.instance_eval(&block) })\n end", "def end_time\n ConfigVariable.new(name: 'END_TIME', pattern: TIME_PATTERN, human_pattern: \"HH:MM\").value\n end", "def show_account_configuration\n bla = Account.new @base\n puts \"done #{bla}\"\n end", "def quit\n puts \"\"\n puts \"\"\n puts Rainbow(\"*\").blue * 70\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"Thank you for using UPTIME!\"\n puts \"\"\n puts \"Have a fantastic day!\"\n puts \"\"\n puts \"\"\n exit\n end", "def ends\n form_print(ends_at)\n end", "def ends\n form_print(ends_at)\n end", "def to_config\n require_relative '../../puppet/util/docs'\n # Scrub any funky indentation; comment out description.\n str = Puppet::Util::Docs.scrub(@desc).gsub(/^/, \"# \") + \"\\n\"\n\n # Add in a statement about the default.\n str << \"# The default value is '#{default(true)}'.\\n\" if default(true)\n\n # If the value has not been overridden, then print it out commented\n # and unconverted, so it's clear that that's the default and how it\n # works.\n value = @settings.value(self.name)\n\n if value != @default\n line = \"#{@name} = #{value}\"\n else\n line = \"# #{@name} = #{@default}\"\n end\n\n str << (line + \"\\n\")\n\n # Indent\n str.gsub(/^/, \" \")\n end", "def done\n @out.puts \"\\n#{@terminal_message}\"\n end", "def print_reset\n puts \"Reseted!\"\n end", "def show_return_option\n puts \"\\n000 - Return to main Screen\"\n print \":>\"\n end", "def empty_config\n nil\n end", "def goodbye\n puts \"Thank you for using the Covid 19 CLI Tracker. Please Wash Your Hands.\"\n end", "def end_hook(hook, status, output); end", "def rest_of_lxc_config_file\n if File.exists?( File.join( options[:root], 'etc/init/container-detect.conf') )\n ttydir = \"lxc\"\n else\n ttydir = \"\"\n end\n\n render( \"templates/lxc_config_footer.erb\", {:ttydir => ttydir} )\n end", "def teardown()\n # See 6. Disabling the gadget\n # ~ equiv to: echo \"\" > UDC\n System.write(File.join(path_prefix, \"UDC\"), \"\\n\")\n sleep(0.1)\n\n # See 7. Cleaning up\n System.delete(*Dir.glob(File.join(path_prefix, \"configs/*/*\")))\n System.delete(*Dir.glob(File.join(path_prefix, \"configs/*/strings/*\")))\n System.delete(*Dir.glob(File.join(path_prefix, \"configs/*\")))\n System.delete(*Dir.glob(File.join(path_prefix, \"functions/*\")))\n System.delete(*Dir.glob(File.join(path_prefix, \"strings/*\")))\n System.delete(path_prefix)\n end", "def main_end ; end", "def generate_end(format)\n case format\n when 'php'\n '];'\n else\n ''\n end\n end", "def conf\n LOG_STAT()\n id = id_gen()\n LOG_CALL(id, true, __method__)\n defer { LOG_CALL(id, false, 'conf') }\n return CONF.privatise.out\n end", "def exit_simulation!(line='')\n @packet.send_packet\n if line != ''\n print!(:error, line) #add errormessages\n else\n print!(:log, 'Ausführung beendet!') #add endmessage\n end\n @packet.add_operation('exit')\n connection_store[:is_simulation_done] = true\nend", "def after_global_configure(&block)\n @after_global_configure_blocks ||= []\n @after_global_configure_blocks << block\n end", "def complete\n unless options[:quiet]\n puts \"*\" * 75\n puts \" \"\n puts \">> Questionnaire has been installed successfully.\"\n puts \">> You're all ready to go!\"\n puts \" \"\n puts \">> Enjoy!\"\n end\n end", "def setup_fail(message)\n puts '-'*50\n message.each { |line| puts line }\n puts '-'*50\n exit\n end", "def quit(reason = \"You told me to\")\n @t.puts \"QUIT :#{reason}\"\n exit\n end", "def conf_info(config)\n bc = config.bgColor\n tc = config.textColor\n txt = config.name\n if config.active?\n txt += _INTL(' [ACTIVE]\\n')\n else\n txt += '\\n'\n end\n txt += _INTL('\\tBackground color {1}, {2}, {3}\\n',bc.red,bc.green,bc.blue)\n txt += _INTL('\\tText color {1}, {2}, {3}\\n',tc.red,tc.green,tc.blue)\n txt += _INTL('\\tFont name {1}\\n',config.fontName)\n txt += _INTL('\\tPrompt \\'{1}\\'',config.prompt)\n return txt\n end", "def debug_msg(msg=\"\")\n if(@config.debug)\n puts(\"Debug: #{msg}\")\n @file.puts(\"Debug: #{msg}\")\n end\n end", "def signal\n puts \"Reloading my config files, starting again\"\n end", "def k_end!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 24 )\n\n\n\n type = K_END\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 349:4: 'end'\n match( \"end\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 24 )\n\n\n end", "def clear_if_config_changed(config); end", "def usage_end\n '}'\n end" ]
[ "0.633585", "0.631836", "0.59957033", "0.58420956", "0.5725633", "0.57101995", "0.5704497", "0.56041825", "0.55995107", "0.5522435", "0.5471395", "0.5446423", "0.5441272", "0.5427403", "0.5410598", "0.539425", "0.5305412", "0.52961475", "0.5268462", "0.5265129", "0.52420586", "0.5239953", "0.52368677", "0.52278423", "0.52247053", "0.5211494", "0.5195495", "0.51831985", "0.51794463", "0.51785016", "0.51590985", "0.51465064", "0.51461774", "0.5144831", "0.5138058", "0.5133335", "0.5124569", "0.50991356", "0.5093923", "0.50874305", "0.50867045", "0.507727", "0.5072201", "0.5072068", "0.507066", "0.50681704", "0.5066574", "0.50356865", "0.50296134", "0.50287706", "0.5025341", "0.50128764", "0.5007247", "0.49981707", "0.49877772", "0.49793363", "0.49728203", "0.49658966", "0.49658966", "0.4963112", "0.49623534", "0.49607262", "0.49560112", "0.49529377", "0.49512953", "0.49499002", "0.4946755", "0.4942177", "0.49341196", "0.49232718", "0.491885", "0.49119386", "0.49113327", "0.49088922", "0.49061143", "0.48969707", "0.48965162", "0.48965162", "0.4887379", "0.48777813", "0.48756945", "0.48706585", "0.4869268", "0.48688284", "0.48637038", "0.48593506", "0.4859305", "0.4858873", "0.48518294", "0.48488528", "0.48484337", "0.4846802", "0.48424047", "0.48406103", "0.48391348", "0.48365864", "0.48347387", "0.4834041", "0.48138356", "0.48040316", "0.4797183" ]
0.0
-1
Get all messages and mark them as read. args: imap object and imap folder name
def markMail(imap, folder) pp "MARKED #{folder}.." message_ids = imap.uid_search("ALL") imap.uid_store(message_ids, "+FLAGS", [:Seen]) imap.expunge end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_messages_via_imap\n\timap = Net::IMAP.new(server,port,usessl)\n\timap.login(mailid,password)\n\timap.select(folder)\n\tsince = included.blank? ? \"1-Jan-2000\" : included.yesterday.to_date.strftime(\"%e-%b-%Y\")\n\timap.uid_search([\"SINCE\",since]).each do |msg_id|\n\t\tnext unless mailmessages.find_by_uid(msg_id).nil?\n\t\tbody = imap.uid_fetch(msg_id,['RFC822']).first.attr['RFC822']\n\n\t\tMailfolderMailhandler::receive(body,self,msg_id)\n\t\timap.store(msg_id, \"+FLAG\", [:Deleted]) if delete_message?\n\tend\n\timap.expunge if delete_message?\n\timap.logout\n end", "def fetch_unread_items(folder)\n item_view = ItemView.new(10) # FIXME: some huge number like 5000, but the JS app is too slow for that\n item_view.property_set = EMAIL_SUMMARY_PROPERTY_SET\n folder.find_items(SearchFilter::IsEqualTo.new(EmailMessageSchema::IsRead, false), item_view).items.to_a\n end", "def read user_id\n messages.unread(user_id).each do |m|\n m.read = true\n m.save\n end\n end", "def set_to_read\n\t\t#We find all the messages in the current conversation\n\t\t@conversation_messages = PersonalMessage.where(conversation_id: @conversation).all\n\t\t@conversation_messages.each do |message|\n\t\t\t# We mark as read the messages recieved by the current user \n\t\t\tif message.user_id != current_user.id\n\t\t\t\tmessage.update(read: true) unless message.read != false\n\t\t\tend\n\t\tend\n\tend", "def imap_readmail\n q = Queue.new\n imap.search([imap_search_for]).each do |message_id|\n msg = imap.fetch(message_id, 'RFC822')[0].attr['RFC822']\n mail = Mail.new(msg)\n case_id = get_case_id(mail)\n e = Email.create(case_id: case_id, date: mail.date, is_sent: false, raw: MailCompressor.compress_mail(msg), to: @email_account.user_name, from: mail.from[0].to_s, subject: mail.subject, body: mail.text_part.body.to_s)\n q.push(e)\n imap.store(message_id, '+FLAGS', [:Seen])\n end\n return q\n end", "def get_messages\n @connection.select('INBOX')\n @connection.search(['ALL']).each do |message_id|\n msg = @connection.fetch(message_id,'RFC822')[0].attr['RFC822']\n begin\n process_message(msg)\n rescue\n handle_bogus_message(msg)\n end\n # Mark message as deleted \n @connection.store(message_id, \"+FLAGS\", [:Deleted])\n end\n end", "def read_messages\n @useConversations = Message.where(\"user_id = (?)\", current_user.id).pluck(:conversation_id)\n if @useConversations.count > 0\n @useConversations = @useConversations.uniq # Unique\n @useConversations = @useConversations.map(&:inspect).join(', ')\n #@updatemsg = Message.where(\"user_id != (?) and conversation_id IN (?)\", current_user.id, @useConversations).update_all(:mark_as_read => true)\n @updatemsg = Message.where(\"user_id != #{current_user.id} and conversation_id in (#{@useConversations})\").update_all(:mark_as_read => true)\n session[:mark_messages] = 0 # Mark as read messages\n end\n end", "def mark_all_messages_as_read(options={})\n RecipientsFor::ReaderInfo.where(\n reciveable_type: options[:reciveable].class.name,\n reciveable_id: options[:reciveable].id,\n ).update_all(read: true)\n end", "def watchMail(imap, folder)\n \n # Loop for checking message increase in the folder\n begin\n \n imap.select(folder)\n \n # Get the current folder size\n fsize = imap.status(folder, [\"MESSAGES\"])\n csize = fsize[\"MESSAGES\"]\n \n loop do\n fsize = imap.status(folder, [\"MESSAGES\"])\n if fsize[\"MESSAGES\"] > csize\n message_ids = imap.uid_search(\"ALL\")\n uid = message_ids.last\n email = imap.uid_fetch(uid, \"ENVELOPE\")[0].attr[\"ENVELOPE\"]\n pp \"[#{email.from[0].name}] #{email.subject}\"\n csize = fsize[\"MESSAGES\"]\n else\n sleep(10)\n end\n end\n rescue => e\n exit(1)\n end\nend", "def mark_read_messages(conversation)\n time = Time.current\n conversation = Conversation.find(conversation) if conversation.is_a?(Integer)\n conversation_members.where(conversation_id: conversation).update_all(last_seen: time)\n Rails.cache.delete(conversation.get_unread_cache_key_for(id))\n Rails.cache.delete(\"user-unread_messages_count-#{id}\")\n PubSub::Publisher.new.publish_for(conversation.user_participants.where.not(id: id), 'read_messages', {id: conversation.id, seen_at: time.to_i, user_id: id}, {foreground: true})\n end", "def sync_new(mailbox)\n # Skip any mailbox with attributes in ignore_attr\n return if ! (mailbox.attr & @@ignore_attr).empty?\n return if !@running\n\n name = Net::IMAP.decode_utf7(mailbox.name)\n cache = @mailboxes[name] || Mailbox.new(name)\n\n puts \"Examining mailbox #{name}\"\n\n begin\n @imap.examine(mailbox.name)\n rescue => e\n puts \"Failed to examine mailbox: #{e}\"\n return\n end\n\n uidvalidity = @imap.responses[\"UIDVALIDITY\"][-1]\n uidnext = @imap.responses[\"UIDNEXT\"][-1]\n\n if cache.uidvalidity != uidvalidity\n puts \"UIDVALIDITY differ, rescaning all mailbox\"\n ids = @imap.search([\"NOT\", \"DELETED\"])\n else\n if (cache.uidmax + 1 == uidnext)\n puts \"No new messages\"\n return\n end\n puts \"UIDVALIDITY match, get new messages only\"\n ids = ((cache.uidmax + 1) .. uidnext).to_a\n end\n\n puts \"; got #{ids.size} messages\"\n\n while(!(block = ids.shift(@@buf_size)).empty?)\n\n break if ! @running\n puts \"; requesting messages #{block.first}..#{block.last} from server\"\n\n msgs = @imap.fetch((block.first..block.last), [\"UID\", \"X-GM-MSGID\", \"X-GM-THRID\", \"X-GM-LABELS\", \"FLAGS\", \"RFC822\"])\n\n if ! msgs\n puts msgs\n next\n end\n\n msgs.each { |msg|\n break if ! @running\n\n body = msg.attr[\"RFC822\"]\n body.force_encoding(\"binary\") if body.respond_to?(:force_encoding) \n body.gsub(\"\\r\\n\", \"\\n\")\n\n labels = msg.attr[\"X-GM-LABELS\"].push(name).collect { |label| Net::IMAP.decode_utf7(label.to_s) }\n\n state = msg.attr[\"FLAGS\"].collect { |flag| flag.to_s.downcase.to_sym }\n puts state\n\n begin\n response = RestClient.post \"http://localhost:8042/message.json\", \n { :body => body, :labels => labels, :state => state, :mailbox => name },\n { :content_type => :json, :accept => :json}\n rescue RestClient::ResourceNotFound => e\n puts \"Warning: resource not found\"\n next\n rescue => e\n puts \"Failed to communicate with heliotrope : #{e.class}\"\n @running = false\n break\n end\n\n puts response \n response = JSON.parse(response)\n\n if response[\"response\"] == \"ok\"\n if response[\"status\"] == \"seen\"\n cache.num_seen += 1\n else\n cache.num_indexed += 1\n end\n else\n cache.num_bad += 1\n puts \"Error for message: \" + response[\"error_message\"]\n end\n\n cache.uidmax = [cache.uidmax || 0, msg.attr[\"UID\"]].max\n }\n end\n\n puts \"Store mailbox #{name} cache\"\n cache.uidnext = uidnext\n cache.uidvalidity = uidvalidity\n @mailboxes[name] = cache\n save_mailboxes\n end", "def mark_as_read\n\t\tunread_messages = current_user.received_messages.where(read: false).order('id desc').limit(10)\n\t\tunread_messages.each do |m|\n\t\t\tm.update_attribute(:read, true)\n\t\t\tm.save\n\t\tend\n\t\tredirect_to request.referer\n\tend", "def mark_all_read\r\n @channel.mark_messages_read_for current_user\r\n respond_to do |format|\r\n format.html { redirect_to channel_messages_url(@channel), notice: 'Nachrichten als gelesen markiert.' }\r\n format.json { head :no_content }\r\n end\r\n end", "def inbox\n @messages = current_user.received_messages\n end", "def inbox\n folders.find_by_name(\"Inbox\")\n end", "def inbox\n folders.find_by_name(\"Inbox\")\n end", "def mark_as_read(options = {})\n default_options = {}\n add_mailbox_condition!(default_options, @type)\n return update_mail(\"mail_items.read = true\", default_options, options)\n end", "def mark_as_read\n payload = { \"chat\" => [id] }.to_json\n path = \"/#{api_prefix}/user/#{client.user.id}/rooms/#{room_id}/unreadItems\"\n\n client.post path, payload\n\n true\n end", "def messages(*args)\n if new_record?\n raise Errors::FolderNotFound.new(@id, \"Folder does only exist locally\")\n else\n if !@conn_id.nil? && [email protected]? && selectable?\n self.class.message_class.all(@conn_id, @location.path, *args)\n else\n []\n end\n end\n end", "def unread_messages\n data = client.get \"#{api_prefix}/user/#{client.user.id}/rooms/#{id}/unreadItems\"\n\n Message::Collection.new self, data\n end", "def set_user_read_all(user_id, did_read)\n self.messages.each {|m| m.set_user_read(user_id, did_read)}\n end", "def read_emails(folder,keyword,atrans,acftrans)\r\n view = framework.threads.spawn(\"ButtonClicker\", false) {\r\n click_button(atrans,acftrans)\r\n }\r\n command = \"Get-Emails \\\"#{keyword}\\\" \\\"#{folder}\\\"\"\r\n execute_outlook_script(command)\r\n end", "def get_messages\n @connection.search(@filter).each do |message|\n body = @connection.fetch(message, \"RFC822\")[0].attr[\"RFC822\"]\n begin\n @processor.process(body)\n rescue StandardError => error\n Mailman.logger.error \"Error encountered processing message: #{message.inspect}\\n #{error.class.to_s}: #{error.message}\\n #{error.backtrace.join(\"\\n\")}\"\n next\n end\n @connection.store(message, \"+FLAGS\", @done_flags)\n end\n # Clears messages that have the Deleted flag set\n @connection.expunge\n end", "def read_messages!(user)\n if has_unread_messages?(user)\n user.reset_unread_chats_count\n self.chat_participations.where(user_id: user.id).first.try(:read_messages!)\n end\n end", "def mark_as_read\n @client.post('/api/mod/conversations/read', conversationIds: [get_attribute(:id)])\n end", "def unread_messages user_id\n messages.unread(user_id)\n end", "def inbox\n @messages = current_user.received_messages\n respond_with @messages\n end", "def fetch_messages(folder, archive_folder, batch_limit, href_regex, reporter=nil, &proc)\n messages = []\n \n if folder == archive_folder # don't descend into archive folder\n log.info \"skipping folder '#{folder}' because it's the archive folder\"\n return messages\n end\n \n # first, retrieve messages in the current folder, and return if we hit the limit\n message_hrefs = folder.message_hrefs href_regex\n log.info \"Total number of messages in folder '#{folder}' is: #{message_hrefs.size}\"\n \n message_hrefs.each do |message|\n begin\n message.raw # trigger the fetch of the raw data\n messages << message\n yield message if proc\n return messages if messages.size >= batch_limit\n rescue Exception => e\n log.warn \"There was a problem retrieving message from Exchange: \" + e.message + \"\\n\" + e.backtrace.join(\"\\n\")\n reporter.call(e) if reporter\n end\n end\n \n begin\n # then descend into the current folder's subfolders\n folder.folders.each do |sub_folder|\n return messages if messages.size >= batch_limit\n messages += fetch_messages(sub_folder, archive_folder, batch_limit-messages.size, href_regex, &proc)\n end\n rescue Exception => e\n log.warn \"There was a problem listing subfolders with Exchange: \" + e.message + \"\\n\" + e.backtrace.join(\"\\n\")\n reporter.call(e) if reporter\n return messages\n end\n \n messages\n end", "def mark_as_read(obj)\n case obj\n when Mailboxer::Receipt\n obj.mark_as_read if obj.receiver == self\n when Mailboxer::Message, Mailboxer::Notification\n obj.mark_as_read(self)\n when Mailboxer::Conversation\n obj.mark_as_read(self)\n when Array\n obj.map{ |sub_obj| mark_as_read(sub_obj) }\n end\n end", "def unread\n all(UNREAD)\n end", "def mark_read id\n logged_in?\n post('/api/read_message', body: {id: id, uh: @modhash, api_type: 'json'})\n end", "def each_unread read\n @rmutex.read_sync do\n @readable.each do |m|\n unless read.include? m.id\n yield m\n end\n end\n end\n end", "def get_messages\n @connection.uid_search(@filter).each do |message|\n puts \"PROCESSING MESSAGE #{message}\"\n [email protected]_fetch(message,\"RFC822\")[0].attr[\"RFC822\"]\n @processor.process(body, @options)\n @connection.uid_copy(message, 'Processed')\n\n @connection.uid_store(message,\"+FLAGS\",[:Deleted])\n end\n @connection.expunge\n #@connection.delete_all\n end", "def notification_groups_mark_all_as_read(opts = {})\n data, _status_code, _headers = notification_groups_mark_all_as_read_with_http_info(opts)\n data\n end", "def mail_unread\n initialize_mocks if @fake\n\n service = Google::Apis::Core::BaseService.new('https://mail.google.com/', 'mail/feed/atom/')\n service.authorization = user_authorization\n service.http(:get, 'https://mail.google.com/mail/feed/atom/')\n end", "def read_all_messages\n post(\"/api/read_all_messages\")\n end", "def imap_select_inbox\n imap.select('INBOX')\n end", "def read_notifications\n # Update post notification\n post_notification = @message.sender\n .notifications_unread\n .where(\"origin_type = ? AND origin_id = ?\", 'Post', @post.id)\n .first\n post_notification.update_attributes(read: true) unless post_notification.nil?\n\n # Update post's messages notifications\n @post.messages.each do |message|\n message_notification = @message.sender\n .notifications_unread\n .where(\"origin_type = ? AND origin_id = ?\", 'Message', message.id)\n .first\n message_notification.update_attributes(read: true) unless message_notification.nil?\n end\n end", "def run(message, flags)\n log message\n\n message_count = 0\n mailboxes = find_mailboxes\n\n mailboxes.each do |mailbox|\n @mailbox = mailbox\n @imap.select @mailbox\n log \"Selected #{@mailbox}\"\n\n messages = find_messages\n\n next if messages.empty?\n\n message_count += messages.length\n\n unless @noop then\n mark messages, flags\n else\n log \"Noop - not marking\"\n end\n\n yield messages if block_given?\n end\n\n log \"Done. Found #{message_count} messages in #{mailboxes.length} mailboxes\"\n end", "def find_folders(options={}, &block)\n options[:mailbox] ||= ''\n options[:count] ||= :all\n\n options = validate_options(options)\n mailbox = options[:mailbox] || ''\n mailbox = Net::IMAP.encode_utf7(mailbox)\n mailbox = mailbox.empty? ? '*' : \"#{mailbox}/*\"\n include = options[:include] ||= '*'\n exclude = options[:exclude] ||= nil\n include_flags = options[:include_flags] ||= nil\n exclude_flags = options[:exclude_flags] ||= [:Noselect, :All, :Drafts, :Important, :Junk, :Flagged, :Trash]\n\n start do |imap|\n info \"find_folders block\"\n info \"imap.lsub/list #{mailbox}\"\n boxes = options[:subscribed] ? imap.lsub('', mailbox) : imap.list('', mailbox)\n boxes.replace(options[:what].to_sym == :last ? boxes.last(options[:count]) : boxes.first(options[:count])) if options[:count].is_a?(Integer)\n\n if block_given?\n boxes.each do |box|\n name = Net::IMAP.decode_utf7(box.name)\n flags = box.attr ? box.attr.map{|e| e.to_s.downcase.to_sym} : nil\n next if match_folder(name, exclude) || match_folder_flags(flags, exclude_flags)\n next unless match_folder(name, include) || match_folder_flags(flags, include_flags)\n info \"imap.status #{box.name} #{[\"MESSAGES\", \"UNSEEN\", \"UIDVALIDITY\", \"UIDNEXT\"]}\"\n status = imap.status(box.name, [\"MESSAGES\", \"UNSEEN\", \"UIDVALIDITY\", \"UIDNEXT\"])\n yield Folder.new(name, delim: box.delim, flags: flags, messages: status['MESSAGES'], unseen: status['UNSEEN'], validity: status['UIDVALIDITY'], next: status['UIDNEXT'])\n end unless boxes.nil?\n else\n folders = []\n boxes.each do |box|\n name = Net::IMAP.decode_utf7(box.name)\n flags = box.attr ? box.attr.map{|e| e.to_s.downcase.to_sym} : nil\n next if match_folder(name, exclude) || match_folder_flags(flags, exclude_flags)\n next unless match_folder(name, include) || match_folder_flags(flags, include_flags)\n info \"imap.status #{box.name} #{[\"MESSAGES\", \"UNSEEN\", \"UIDVALIDITY\", \"UIDNEXT\"]}\"\n status = imap.status(box.name, [\"MESSAGES\", \"UNSEEN\", \"UIDVALIDITY\", \"UIDNEXT\"])\n folders << Folder.new(name, delim: box.delim, flags: flags, messages: status['MESSAGES'], unseen: status['UNSEEN'], validity: status['UIDVALIDITY'], next: status['UIDNEXT'])\n end unless boxes.nil?\n folders.size == 1 && options[:count] == 1 ? folders.first : folders\n end\n end\n end", "def inbox\n @direct_messages = current_user.received_messages.where(_type: 'DirectMessage')\n respond_with @direct_messages\n end", "def mark_notification_as_read!\n notification = User.find(@userid).notifications\n @received_msg.each do |notify|\n notification.update(notify['id'], :checked => true);\n end\n end", "def index\n @messages = @conversation.messages\n @message = Message.new(user_id:current_user.id)\n @conversation.messages_for(current_user).unread.update_all(read: true)\n end", "def show\n @message = find_recipient_message\n redirect_to messages_inbox_index_path and return unless @message\n @message.mark_as_read\n end", "def folder_feeds(folder, include_read: false)\n FolderManager.folder_feeds folder, self, include_read: include_read\n end", "def getEmails\n begin\n puts 'attempting to connect to ' + @username + '@gmail.com'\n Gmail.new(@username, @password) do |gmail|\n puts 'connection established'\n #use peek to make emails not be automatically marked as read\n gmail.peek = (@peek === 'true' ? true : false)\n\n if @label == \"none\"\n inbox = gmail.inbox\n boxname = 'inbox'\n else\n inbox = gmail.mailbox(@label)\n boxname = @label + ' box'\n end\n number_unread = inbox.count(:unread)\n if number_unread < 1\n abort(\"There are no new messages in the \" + boxname)\n end\n p \"there are \" + number_unread.to_s + \" unread emails in the \" + boxname\n inbox.emails(:unread).each do |email|\n puts parser(email)\n end\n end\n\n rescue Net::IMAP::NoResponseError\n puts 'connection failed, check your config file for incorrect credentials'\n puts 'perhaps you opted to use a label that doesn\\'t exist, try \"none\" instead'\n end\nend", "def show\n @message = current_user.messages.find(params[:id])\n @message.mark_as_unread\n end", "def mark_all_as_read\n @notifications = Notification.unread.for_user(current_api_v1_user)\n @notifications.update_all(read_at: Time.now) unless @notifications.blank?\n @notifications = Notification.where(recipient_id: current_api_v1_user.id)\n \n render json: @notifications\n end", "def unread_messages\n current_user.messages_in.where(read: false).count\n end", "def index\n @conversations = \n if params[:read].present? && params[:read] == \"true\"\n current_user.mailbox.inbox(:read => true)\n elsif params[:read].present? && params[:read] == \"false\"\n current_user.mailbox.inbox(:unread => true)\n else \n current_user.mailbox.inbox\n end.page(params[:page])\n \n respond_with(@conversations)\n end", "def read_for!(user)\n received_message.read! if received_message\n replies.map { |r|\n r.received_message if r.recipient == user\n }.compact.each(&:read!)\n end", "def mark_unread!\n update_is_read_status false\n end", "def find_messages\n mailbox = @boxes.find { |box| @mailbox =~ /#{box}/ } # TODO: needs more work\n raise unless mailbox\n age = @cleanse[mailbox]\n before_date = (Time.now - 86400 * age).imapdate\n\n search [\n 'NOT', 'NEW',\n 'NOT', 'FLAGGED',\n 'BEFORE', before_date\n ], 'read, unflagged messages'\n end", "def inbox\n cur_emp = get_logged_employee\n @messages = Message.where(\"sent_to = ?\", cur_emp).where(:is_deleted => nil )\n render \"resumes/message_show\"\n end", "def mailbox_convert_messages(mailbox_path, from_imap = false)\n api(\"MailboxConvertMessages\", mailbox_path, from_imap)\n end", "def get_messages where = \"inbox\", opts = {}\n query = {\n mark: false\n }\n query.merge! opts\n get(\"/message/#{where}.json\", query: query)\n end", "def mark_as_unread(obj)\n case obj\n when Mailboxer::Receipt\n obj.mark_as_unread if obj.receiver == self\n when Mailboxer::Message, Mailboxer::Notification\n obj.mark_as_unread(self)\n when Mailboxer::Conversation\n obj.mark_as_unread(self)\n when Array\n obj.map{ |sub_obj| mark_as_unread(sub_obj) }\n end\n end", "def unread\n home\n #@dirmesg = TDirmessage.select(\"m_users.user_name,t_dirmessages.dir_message,t_dirmessages.created_at\")\n #.joins(\"join m_users on m_users.user_id=t_dirmessages.sender_user_id\")\n #.where(\"dirworkspace_id=? and ((receiver_user_id=? and sender_user_id=?)||(t_dirmessages.receiver_user_id=? and t_dirmessages.sender_user_id=?))\", session[:workspace_id], session[:user_id], params[:clickuserid], params[:clickuserid], session[:user_id]).order(\"t_dirmessages.created_at ASC\")\n @clickchannel = MChannel.find_by(\"channel_id=?\", session[:clickchannel_id])\n\n @m_clickchuser = MUser.joins(\"join m_channels on m_channels.user_id=m_users.user_id\")\n .where(\"m_channels.channel_name=? and m_channels.workspace_id=?\", session[:clickchannel_name], session[:workspace_id])\n\n @dirmsg = TDirmessage.select(\"m_users.user_name,t_dirmessages.dir_message,t_dirmessages.created_at\")\n .joins(\"join m_users on m_users.user_id=t_dirmessages.sender_user_id\")\n .where(\"dirworkspace_id=? and receiver_user_id=? and is_read=true\", session[:workspace_id], session[:user_id])\n @chmesg = TChannelMessage.select(\"m_channels.channel_name ,m_users.user_name ,t_channel_messages.chmessage,t_channel_messages.created_at\")\n .joins(\"join m_users on t_channel_messages.chsender_id=m_users.user_id join t_chunread_messages on t_chunread_messages.chmsg_id=t_channel_messages.chmsg_id join m_channels on m_channels.channel_id=t_channel_messages.channel_id\")\n .where(\"t_chunread_messages.is_read =true and t_chunread_messages.chuser_id=? and m_channels.user_id=? and m_channels.workspace_id=? \", session[:user_id], session[:user_id], session[:workspace_id])\n end", "def mark_notifications_read\n return if params[:notification_id].blank? or !user_signed_in?\n n = Notification.find(params[:notification_id])\n current_subject.mark_as_read n\n end", "def retrieve_tweet_ids\n imap = Net::IMAP.new('imap.gmail.com', 993, true, nil, false)\n imap.login(@account['credentials']['email_address'], @account['credentials']['email_password'])\n imap.select('INBOX')\n imap.search([\"NOT\",\"SEEN\"]).each do |message_id|\n msg = imap.fetch(message_id, 'RFC822')[0].attr['RFC822']\n # imap.store(message_id, '+FLAGS', [:Seen])\nputs msg\n end \n imap.logout()\n imap.disconnect()\n end", "def mark_as_read\n @notifications = Notification.where(recipient: current_user).unread\n @notifications.update_all(read_at: Time.zone.now)\n render json: {success: true}\n end", "def mark_as_unread\n @client.post('/api/mod/conversations/unread', conversationIds: [get_attribute(:id)])\n end", "def inbox\r\n @messages = current_user.inbox_messages\r\n session[:mail_box] = \"inbox\"\r\n render :action => \"messages\"\r\n end", "def index\n @page_title = \"Messages\"\n @message_threads = MessageThread.related_to(current_user)\n @message_thread = @message_threads.first\n if @message_thread\n @message_thread.mark_read!(current_user)\n end\n end", "def messagebox\n\t\t# retrieve all messages and unread messages of current user\n @user = current_user\n @messages = Message.paginate_by_receiver_id @user.id, :page => params[:page], :order => 'created_at DESC', :per_page => 10\n @unread_messages = Message.find(:all, :conditions => {:receiver_id => current_user.id, :unread => true})\n end", "def mark_all_as_read(opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n \n ]\n\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n {}\n \n )\n\n # resource path\n path = path_replace(\"/v1/conversations/mark_all_as_read\",\n )\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:post, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:post, path, query_params, form_params, headers)\n page_params_store(:post, path)\n response\n \n end", "def read_message(message_id)\n message =\n if self.is_client?\n self.messages.find(message_id)\n elsif self.is_employee?\n self.client.messages.find(message_id)\n end\n if self.is_client?\n message.update_columns(is_read: true)\n else\n u_ids = message.message_status.user_ids.push(self.id)\n logger.info u_ids\n message.message_status.update_columns(user_ids: u_ids)\n end\n end", "def show\n @message = Message.find(params[:id])\n\n @inbox = current_user.inbox_message.where('status = 0').count\n Message.read_message(@message,current_user.id)\n end", "def read\n @message = Message.find(params[:id])\n authorize @message\n @message.comments.each do |comment|\n comment.status = \"read\"\n comment.save\n end\n end", "def sync_messages\n Mail.connection do |imap|\n imap.select 'INBOX'\n validity_id = imap.responses[\"UIDVALIDITY\"].last if imap.responses[\"UIDVALIDITY\"]\n if Message.validity.eql? validity_id\n uids = imap.uid_search([\"NOT\", \"DELETED\"]).sort\n local_uids = Message.ids\n if uids != local_uids\n Sidekiq::Logging.logger.info \"*** Syncing Some ***\"\n new_ids = uids - local_uids\n deleted_ids = local_uids - uids\n unless new_ids.blank?\n fetchdata = imap.uid_fetch(new_ids, ['RFC822'])\n fetchdata.each do |rec|\n validity_id = imap.responses[\"UIDVALIDITY\"].last if imap.responses[\"UIDVALIDITY\"]\n msg = Message.new(uid: rec.attr['UID'], validity_id: validity_id, raw_message: rec.attr['RFC822'])\n msg.save\n end\n end\n self.sync_deleted(deleted_ids.map{|id| [validity_id,id].join ':'}) unless deleted_ids.blank?\n end\n else\n self.sync_all\n end\n Message.ids\n end\n end", "def all_inboxes(graph, login_user)\n cache.cache(\"inbox\"+login_user, :expires_in => 1.day){\n\n # Fetch the first page\n result = graph.get_connections(\"me\", \"inbox\")\n\n # Fetch the next page. We won't fetch more than \n # two pages so as not to reach the api limit.\n next_page = result.next_page\n\n # List of inbox objects\n all = []\n all.push result\n if next_page\n all.push next_page\n end\n thread_array all\n }\n end", "def mark_as_unread\n Notifyer::Notification.all.each do |n|\n n.update(is_read: false)\n end\n redirect_to :back\n end", "def unread_items(params = {})\n @unread_items ||= filtered_items_list('reading-list', params.merge(:exclude => 'user/-/state/com.google/read'))\n end", "def find(folder_id, offset)\n find_opts = {\n :sort_order=>[[\"item:DateTimeReceived\", \"Ascending\"]],\n :indexed_page_item_view=>{\n :max_entries_returned=>batch_size, \n :offset=>offset},\n :item_shape=>{\n :base_shape=>:IdOnly,\n :additional_properties=>[[:field_uri, \"item:DateTimeReceived\"],\n [:field_uri, \"message:IsRead\"],\n [:field_uri, \"message:IsReadReceiptRequested\"]]}}\n \n restriction = [:==, \"item:ItemClass\", \"IPM.Note\"]\n if state[folder_id.key]\n restriction = [:and,\n restriction,\n [:>= , \"item:DateTimeReceived\", state[folder_id.key]]]\n end\n find_opts[:restriction] = restriction\n \n folder_id.find_item(find_opts)\n end", "def notification_groups_mark_as_read(id, opts = {})\n data, _status_code, _headers = notification_groups_mark_as_read_with_http_info(id, opts)\n data\n end", "def index\n @include_read = param_str_to_boolean :include_read, params\n\n if params[:folder_id].present?\n # Retrieve subscribed feeds in the passed folder\n index_folder\n else\n # Retrieve subscribed feeds regardless of folder\n index_all\n end\n rescue => e\n handle_error e\n end", "def unread_messages(user)\n Rails.cache.fetch(\"#{cache_key_with_version}/unread_messages/#{user.id}\") do\n Message.unread_by(user).where(chat_room: self).where.not(user: user).to_a\n end\n end", "def unread\n un_read(false, \"non lue\")\n end", "def mark_as_read_message(safebox_guid, message_id)\n handle_error { sendsecure_connection.patch(\"api/v2/safeboxes/#{safebox_guid}/messages/#{message_id}/read\") }\n end", "def find_in_batches(options={}, &block)\n options[:count] ||= :all\n options = validate_options(options)\n mailbox = options[:mailbox]\n batch_size = options.delete(:batch_size) || 10\n\n start do |imap|\n info \"find_in_batches block\"\n info \"imap.examine/select #{options[:mailbox]}\"\n options[:read_only] ? imap.examine(options[:mailbox]) : imap.select(options[:mailbox])\n\n info \"imap.responses #{\"UIDVALIDITY\"}\"\n validity = imap.responses[\"UIDVALIDITY\"].first\n info \"imap.uid_search #{options[:keys]}\"\n uids = imap.uid_search(options[:keys])\n uids.replace(options[:what].to_sym == :last ? uids.last(options[:count]) : uids.first(options[:count])) if options[:count].is_a?(Integer)\n\n if block_given?\n uids.each_slice(batch_size) do |batch|\n results = []\n info \"imap.uid_fetch #{batch} #{\"(UID FLAGS RFC822.SIZE INTERNALDATE RFC822 BODY.PEEK[HEADER.FIELDS (MESSAGE-ID)])\"}\"\n imap.uid_fetch(batch, \"(UID FLAGS RFC822.SIZE INTERNALDATE RFC822 BODY.PEEK[HEADER.FIELDS (MESSAGE-ID)])\").each do |data|\n uid = data.attr['UID'].to_i\n flags = data.attr['FLAGS'].map {|flag| flag.to_s.downcase.to_sym}\n message_size = data.attr['RFC822.SIZE'].to_i\n message_date = Time.parse(data.attr['INTERNALDATE'])\n rfc822 = data.attr['RFC822']\n results << Message.new(rfc822,{folder: mailbox, validity: validity, uid: uid, flags: flags, message_size: message_size, message_date: message_date})\n end\n info \"imap.uid_store #{batch} #{\"+FLAGS\"} #{[Net::IMAP::DELETED]}\" if options[:delete_after_find]\n imap.uid_store(batch, \"+FLAGS\", [Net::IMAP::DELETED]) if options[:delete_after_find]\n yield results\n end\n info \"imap.expunge\" if options[:delete_after_find]\n imap.expunge if options[:delete_after_find]\n end\n end\n end", "def unread_messages\n @user_wise_unread_messages = current_user.user_messages\n .where(is_read: false)\n .joins(:message)\n .group('messages.user_id').count\n end", "def show\n @seqno = params[:id].to_i\n @total = params[:total].to_i\n\n begin\n @imap = WmailImapUtils.current_imap\n message = @imap.fetch(@seqno, ['RFC822']).first.attr['RFC822']\n @mail = Mail.new(message)\n # get the folder list\n mailbox_list\n rescue\n respond_to do|format|\n format.html {redirect_to authenticate_wmail_accounts_path(:redirect => messages_mailbox_path(:label => selected_label)),\n :alert => 'Connection Lost. Please login to your account'}\n format.js\n end\n end\n end", "def messages\n read_only()\n @conn.uid_search(['ALL']).map do |uid|\n Message.new(@conn, uid)\n end\n end", "def messages\n selected_label = params[:label].blank? ? 'INBOX' : params[:label]\n \n begin\n\n unless selected_label.blank?\n @imap = WmailImapUtils.current_imap\n @imap.select(selected_label)\n @status = @imap.status(selected_label, ['MESSAGES', 'RECENT', 'UNSEEN'])\n max = @status['MESSAGES']\n min = @status['MESSAGES']-10\n @max = 10\n @min = 1\n @mailbox = selected_label\n @inbox = []\n\n min = 1 if (max <= 10 and max > 0)\n\n @inbox = @imap.fetch(min..max, 'ENVELOPE')\n @unseen_flags = @imap.search(['NOT','SEEN'])\n @imap.expunge\n end\n\n session[:selected_label] = selected_label\n \n respond_to do|format|\n format.html\n format.js\n end\n\n rescue\n\n respond_to do|format|\n format.html {redirect_to authenticate_wmail_accounts_path(:redirect => messages_mailbox_path(:label => selected_label)),\n :alert => 'Connection Lost. Please login to your account'}\n format.js\n end\n \n end\n \n end", "def read_messages\n begin\n uri = MQ_CONFIG[\"mq_uri\"]\n conn = Bunny.new(uri)\n conn.start\n channel = conn.create_channel\n\n if MQ_CONFIG[\"digitisation\"][\"source\"].blank?\n logger.warn \"#{Time.now.to_s} WARN: No digitisation source queue defined -> Not listening\"\n return\n end\n\n source = MQ_CONFIG[\"digitisation\"][\"source\"]\n q = channel.queue(source, :durable => true)\n\n logger.debug \"q.message_count = #{q.message_count}\"\n\n unread_messages = Array.new\n\n while q.message_count > 0 do\n delivery_info, metadata, payload = q.pop\n unread_messages.push(payload)\n end\n conn.close\n logger.debug \"Returning array containing #{unread_messages.length} unread messages\"\n unread_messages\n rescue Exception => e\n logger.error \" #{e.message}\"\n logger.error e.backtrace.join(\"\\n\")\n end\n end", "def fetch_messages(gmail, label, criteria, save_attachments)\n mails = []\n gmail.mailbox(label).search(criteria).each do |email|\n subject = \"#{Mail::Encodings.value_decode(email.subject)}\"\n puts \"----------\"\n puts \"[#{email.uid}] #{subject}\"\n from = sender(email.from)\n to = recipients(email.to)\n attachments = attachments(email)\n body = extract_body(email)\n\n # TODO: saving attachments should be configurable\n if save_attachments && email.message.attachments.any?\n puts \"Attachments:\"\n email.message.attachments.each do |attachment|\n save_attachment(email, attachment)\n end\n end\n\n mails << { :uid => email.uid,\n :date => Time.parse(email.date),\n :subject => subject,\n :from => from,\n :to => to,\n :body => body,\n :attachments => attachments }\n end\n mails\n end", "def get_mailbox_messages mailbox_id, posted_since = \"\", include_deleted = \"false\"\n\t\t\tposted_since = Date.today if posted_since.length == 0\n\n\t\t\t@response = api_request 'LoadMessages', [mailbox_id, posted_since, include_deleted]\n\t\t\traise ZenfolioAPI::ZenfolioAPISessionError, @response['error']['message'] if @response['result'].nil? && @response['error'].length > 0\n\n\t\t\t\n\t\tend", "def mark_all_news_as_read\n where(:user_id => User.current_user_id).update_all(:read => 1)\n end", "def cache_list(force_reload=false)\n unless self.is_cached? or force_reload\n @messages = []\n \n # get the list of message id's and return an empty array if there \n # are no messages in the box\n search = @connection.search(\"All\")\n return if search.size == 0\n \n @raw_messages = @connection.fetch(search, \n [\"FLAGS\", \"INTERNALDATE\", \"RFC822.SIZE\", \"ENVELOPE\", \"UID\"])\n @is_cached = true\n \n @raw_messages.each do |raw| \n message = {\n \"seqno\" => raw.seqno, \n \"uid\" => raw.attr[\"UID\"], \n \"date\" => Time.parse(raw.attr[\"INTERNALDATE\"]), \n \"subject\" => raw.attr[\"ENVELOPE\"].subject, \n \"flags\" => raw.attr[\"FLAGS\"], \n \"size\" => raw.attr[\"RFC822.SIZE\"]\n }\n\n [\"to\", \"cc\", \"bcc\", \"from\", \"sender\", \"reply_to\"].each do |a|\n message[a] = raw.attr[\"ENVELOPE\"][a].collect { |address|\n {\n \"name\" => address.name, \n \"address\" => \"#{address.mailbox}@#{address.host}\", \n \"user\" => address.mailbox.downcase, \n \"domain\" => address.host.downcase\n }\n } unless raw.attr[\"ENVELOPE\"][a].nil?\n end #do\n \n @messages.push(message)\n end #do\n end #unless \n end", "def new_messages\r\n self.unread_messages\r\n end", "def new_messages\r\n self.unread_messages\r\n end", "def mailbox_list\n begin\n @imap = WmailImapUtils.current_imap\n folder_list = WmailImapUtils.get_mailbox_list\n @folders_count_hash = Hash[ folder_list.map do |a|\n [a.name, @imap.status(a.name, [\"UNSEEN\"])[\"UNSEEN\"]] unless a.name == \"[Gmail]\"\n end ]\n rescue\n respond_to do|format|\n format.html {redirect_to authenticate_wmail_accounts_path(:redirect => params),\n :alert => 'Connection Lost. Please login to your account'}\n format.js {render :js => \"window.location = '\" + authenticate_wmail_accounts_path(:redirect => params) + \"';\"}\n end\n end\n end", "def reciveable_messages(options={})\n subject_ids = RecipientsFor::ReaderInfo.where(\n reciveable_type: options[:reciveable_type],\n reciveable_id: options[:reciveable_id],\n read: options[:read],\n internal: true\n ).pluck(:subject_id)\n RecipientsFor::Subject.order(\"updated_at asc\").includes(:contents, :reader_infos).where(id: subject_ids)\n end", "def mark_as_unread(options = {})\n default_options = {:conditions => [\"mail_items.mailbox != ?\",@user.mailbox_types[:sent].to_s]}\n add_mailbox_condition!(default_options, @type)\n return update_mail(\"mail_items.read = false\", default_options, options)\n end", "def mark_as_unread_message(safebox_guid, message_id)\n handle_error { sendsecure_connection.patch(\"api/v2/safeboxes/#{safebox_guid}/messages/#{message_id}/unread\") }\n end", "def mark_as_unread()\n update_attribute('read', false)\n end", "def imapsync\n\t\t@imap = Net::IMAP.new( @config[:host], @config[:port], @config[:ssl] )\n\t\tif @imap.login( @config[:username], @config[:password] )\n\t\t\tputs \"Connected\"\n\t\telse\n\t\t\traise(\"Connection Failed\")\n\t\tend\n\n\t\t\n\t\[email protected]('INBOX') #Select INBOX from the gmail account to look for new messages\n\t\tproject=\"\"\n\t\tattrs={}\n\t\[email protected]([\"NOT\",\"SEEN\"]).each do |message_id| # Look for UNREAD MESSAGES\n\t\t\t@mailbox = @imap.fetch(message_id, 'ENVELOPE')[0].attr['ENVELOPE'].to[0].mailbox #Fetch the unread email\n\t\t\t@mailbox = @mailbox.gsub(/([_\\-\\.])+/, ' ').downcase\n\t\t\[email protected]!(/\\b([a-z])/) { $1.capitalize }\n\t\t\t@msg = @imap.fetch(message_id,'RFC822')[0].attr['RFC822']\n\t\t\temail = TMail::Mail.parse(@msg) #Use TMail Library to parse the email message\n\t\t\traise \"Subject Empty\" if email.subject.blank? #Raise Error in case \"Subject\" is empty\n\t\t\t@email_subject=email.subject #Subject of the Email \n @[email protected](\"[\",\"\") #The Format of the Sunject should be [ProjectName][Story Type][Story Title]\n\t\t\t@split_subject=@email_subject.split(\"]\") \n\t\t\tattrs[:project]=@split_subject[0].gsub(/ /,\"\") #Project Name\n\t\t\tif @split_subject[1].empty? \n\t\t\tattrs[:story_title]=\"feature\" # intialise the Story Type as \"feature\" in case this column is empty\n\t\t\telse attrs[:story_type]=@split_subject[1].gsub(/ /,\"\") #Else intialize the story Type\n\t\t\tend\n\t\t\tattrs[:requested_by_email]= email.from #Requested By\n\t\t\tattrs[:story_title]=@split_subject[2].gsub(/ /,\"\") #Story Titile\n\t\t\tif !email.cc \n\t\t\t\tattrs[:cc]=attrs[:requested_by_email] #Incase theres is no person CCed the project should get assigned to the requester of the story himself\n\t\t\telse\n\t\t\t\tattrs[:cc]= email.cc \n\t\t\tend\n\t\t\temail_body = (email.body.gsub(/[\\r]+/,\" \"))\n\t\t\tattrs[:body]=email_body.gsub(/[\\n]+/,\" \")\n\t\t\tattrs[:body]=attrs[:body].unpack('M*').flatten.first #To support Multipart Data.\n\t\t\tattrs[:owned_by]=attrs[:cc][0] #Owner of the Story is the person who was CCed\n\t\t\t\n\t\t\t\n\t\t\t####START CREATING STORIES IN PROJECTS###\n\t\t\tinitialize_all_projects($TOKEN[\"#{attrs[:requested_by_email]}\"][\"token\"]) \t\t#Fetch the Project Ids vs Project Names from Pivotal\n\t\t\t@project_id= @projects_on_pivotal[\"#{attrs[:project]}\"] #Get the Corresponding Project Id as per the name in the Email Subhect\n\t\t\t @story_type=\"#{attrs[:story_type]}\".downcase #The Story Type(feature/bug/chores)\n\t\t\t @story_name=attrs[:story_title] #Story Name/Title\n\t\t\t @token=$TOKEN[\"#{attrs[:requested_by_email]}\"][\"token\"] /#The token of the Requester\n\t\t\t @assigned_by=$TOKEN[\"#{attrs[:requested_by_email]}\"][\"username\"] #Pivotal Username of the Requester\n\t\t\t @description=\"#{attrs[:body]}\" #Description of the story\n\t\t\t @owned_by=$TOKEN[\"#{attrs[:owned_by]}\"][\"username\"] #Pivotal Username of the Owner\n\t\t\t @base_url = \"http://www.pivotaltracker.com:80/services/v3/projects/#{@project_id}/stories\"\n\t\t\t resource_uri = URI.parse(\"#{@base_url}\")\n\t\t\t story_xml=build_story_xml(@project_id,@story_type,@story_name,@assigned_by,@description,@owned_by)#Get the XML to Add New Story\n\t\t\t response = net_http(resource_uri).start do |http|\n\t\t\t\thttp.post(resource_uri.path, story_xml, {'X-TrackerToken' => @token, 'Content-Type' => 'application/xml'}) #POST the parameters to Add New STory\n\t\t\tend\n \n\t\tend\n\t\t\[email protected] #Logout\n\tend", "def fetch_messages(opts = {}, &block)\n check_client_config\n\n opts[:after] = opts.delete(:since) if opts.include?(:since)\n\n mailbox = @client.label(\"INBOX\")\n mailbox.emails(:all, opts).map do |email|\n from = email.from[0]\n\n message_data = {\n :id => email.message_id,\n :source => 'email',\n :thread => email.thread_id,\n :title => email.subject,\n :body => extract_body(email),\n :sender_name => \"#{from.name || from.mailbox}\",\n :sender => \"#{from.mailbox}@#{from.host}\"\n }\n\n block.call Message.build(message_data)\n end\n end", "def mark_as_unread\n post(\"/api/unread_message\", id: fullname)\n end", "def change_mailbox(box, read_only=false)\n @current_box = box\n @read_only = read_only\n first = true\n begin\n if(read_only)\n begin\n imap.examine(box)\n rescue Net::IMAP::BadResponseError\n Logger.warn(\"Read-only connection to #{box} failed. Connecting directly\")\n imap.select(box)\n end\n else\n imap.select(box)\n end\n rescue IOError => boom\n if(first)\n Logger.warn(\"Change mailbox failed. Attempting a reconnect and retrying mailbox\")\n first = false\n reconnect\n retry\n else\n Logger.fatal(\"Failed to change mailbox. Connection error assumed: #{boom}\")\n raise boom\n end\n end\n end" ]
[ "0.8045776", "0.69213146", "0.6893285", "0.66984016", "0.66798705", "0.6635894", "0.6570545", "0.6560365", "0.64427227", "0.6433573", "0.64103264", "0.6405727", "0.6385271", "0.63177586", "0.629245", "0.629245", "0.6258488", "0.6251408", "0.6226226", "0.6223255", "0.61852163", "0.6175717", "0.61737406", "0.6167168", "0.61578", "0.6140979", "0.61344516", "0.611209", "0.6104131", "0.60873955", "0.6073832", "0.6063001", "0.6057582", "0.60574186", "0.6057233", "0.60490155", "0.60248446", "0.60020286", "0.5998679", "0.59550285", "0.5936111", "0.59310263", "0.59299", "0.59138167", "0.5906556", "0.5899728", "0.5863812", "0.5827359", "0.5824535", "0.58199364", "0.58127403", "0.5801509", "0.5797662", "0.5791991", "0.5781658", "0.57804257", "0.57783157", "0.57770216", "0.57716566", "0.57635033", "0.5748501", "0.5724654", "0.5724585", "0.5717359", "0.56972426", "0.56756485", "0.56681514", "0.5664241", "0.56626016", "0.5647891", "0.56423247", "0.5633949", "0.5632972", "0.5630843", "0.56304795", "0.56185746", "0.56032485", "0.5603056", "0.55990195", "0.55803937", "0.5574197", "0.55445284", "0.5538786", "0.55256706", "0.5521964", "0.551478", "0.55112016", "0.551059", "0.5505601", "0.5499454", "0.5499454", "0.5493411", "0.54916465", "0.54901", "0.5477454", "0.5475949", "0.5473354", "0.5470463", "0.5468949", "0.545825" ]
0.6507441
8
Get all messages and delete them. args: imap object and imap folder name
def delMail(imap, folder) pp "Emptying #{folder}.." message_ids = imap.uid_search("ALL") imap.uid_store(message_ids, "+FLAGS", [:Deleted]) imap.expunge end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_messages\n @connection.select('INBOX')\n @connection.search(['ALL']).each do |message_id|\n msg = @connection.fetch(message_id,'RFC822')[0].attr['RFC822']\n begin\n process_message(msg)\n rescue\n handle_bogus_message(msg)\n end\n # Mark message as deleted \n @connection.store(message_id, \"+FLAGS\", [:Deleted])\n end\n end", "def read_messages_via_imap\n\timap = Net::IMAP.new(server,port,usessl)\n\timap.login(mailid,password)\n\timap.select(folder)\n\tsince = included.blank? ? \"1-Jan-2000\" : included.yesterday.to_date.strftime(\"%e-%b-%Y\")\n\timap.uid_search([\"SINCE\",since]).each do |msg_id|\n\t\tnext unless mailmessages.find_by_uid(msg_id).nil?\n\t\tbody = imap.uid_fetch(msg_id,['RFC822']).first.attr['RFC822']\n\n\t\tMailfolderMailhandler::receive(body,self,msg_id)\n\t\timap.store(msg_id, \"+FLAG\", [:Deleted]) if delete_message?\n\tend\n\timap.expunge if delete_message?\n\timap.logout\n end", "def delete_all(mailbox='INBOX')\n mailbox ||= 'INBOX'\n mailbox = Net::IMAP.encode_utf7(mailbox)\n\n start do |imap|\n imap.select(mailbox)\n imap.uid_search(['ALL']).each do |uid|\n imap.uid_store(uid, \"+FLAGS\", [Net::IMAP::DELETED])\n end\n imap.expunge\n end\n end", "def get_messages\n unless @connection.mails.empty?\n @connection.each_mail do |msg|\n begin\n process_message(msg.pop)\n rescue\n handle_bogus_message(msg.pop)\n end\n # Delete message from server\n msg.delete\n end\n end\n end", "def get_messages\n @connection.uid_search(@filter).each do |message|\n puts \"PROCESSING MESSAGE #{message}\"\n [email protected]_fetch(message,\"RFC822\")[0].attr[\"RFC822\"]\n @processor.process(body, @options)\n @connection.uid_copy(message, 'Processed')\n\n @connection.uid_store(message,\"+FLAGS\",[:Deleted])\n end\n @connection.expunge\n #@connection.delete_all\n end", "def delete_all(mailbox='INBOX')\n mailbox ||= 'INBOX'\n mailbox = Net::IMAP.encode_utf7(mailbox)\n\n start do |imap|\n info \"delete_all block\"\n info \"imap.uid_search #{batch} #{\"ALL\"}\"\n imap.uid_search(['ALL']).each do |uid|\n info \"imap.uid_store #{uid} #{\"+FLAGS\"} #{[Net::IMAP::DELETED]}\"\n imap.uid_store(uid, \"+FLAGS\", [Net::IMAP::DELETED])\n end\n info \"imap.expunge\"\n imap.expunge\n end\n end", "def move_messages_trash(messages)\n\t\n\t\tputs messages\n\t\tmessages.each do |message_id|\n\t\t\t\n\t\t\trequest_url = \"https://www.googleapis.com/gmail/v1/users/#{@email}/messages/#{message_id}/trash?access_token=#{@access_token}\"\n\t\t\tresponse = RestClient.post request_url, {:content_type => 'application/x-www-form-urlencoded'}\n\t\t\tresponse_body = JSON.parse(response.body)\n\t\t\tputs response_body\n\t\tend\n\tend", "def delete_all\n start do |pop3|\n unless pop3.mails.empty?\n pop3.delete_all\n pop3.finish\n end\n end\n end", "def empty\n Log.add_info(request, params.inspect)\n\n raise(RequestPostOnlyException) unless request.post?\n\n @folder_id = params[:id]\n mail_account_id = params[:mail_account_id]\n SqlHelper.validate_token([@folder_id, mail_account_id])\n\n trash_folder = MailFolder.get_for(@login_user, mail_account_id, MailFolder::XTYPE_TRASH)\n\n mail_folder = MailFolder.find(@folder_id)\n emails = (MailFolder.get_mails(mail_folder.id, @login_user) || [])\n\n if mail_folder.id == trash_folder.id \\\n or mail_folder.get_parents(false).include?(trash_folder.id.to_s)\n emails.each do |email|\n email.destroy\n end\n flash[:notice] = t('msg.delete_success')\n else\n emails.each do |email|\n email.update_attribute(:mail_folder_id, trash_folder.id)\n end\n flash[:notice] = t('msg.moved_to_trash')\n end\n\n get_mails\n end", "def destroy\n @inbox.destroy\n end", "def get_messages\n @connection.search(@filter).each do |message|\n body = @connection.fetch(message, \"RFC822\")[0].attr[\"RFC822\"]\n begin\n @processor.process(body)\n rescue StandardError => error\n Mailman.logger.error \"Error encountered processing message: #{message.inspect}\\n #{error.class.to_s}: #{error.message}\\n #{error.backtrace.join(\"\\n\")}\"\n next\n end\n @connection.store(message, \"+FLAGS\", @done_flags)\n end\n # Clears messages that have the Deleted flag set\n @connection.expunge\n end", "def delete_messages uids, expunge = true\n log \"DELETING [...#{uids.size} uids]\"\n imap.store uids, '+FLAGS.SILENT', [:Deleted]\n if expunge then\n log \"EXPUNGE\"\n imap.expunge\n end\n end", "def deleteAllEmail\n queryParams = Hash.new\n queryParams['key'] = @API_KEY\n queryParams['mailbox'] = @MAILBOX\n RestClient.post(\"#{@BASE_URI}/emails/deleteall\", nil, {:params => queryParams})\n end", "def destroy\n @messaging_inbox = Messaging::Inbox.find(params[:id])\n @messaging_inbox.destroy\n\n respond_to do |format|\n format.html { redirect_to messaging_inboxes_url }\n format.json { head :ok }\n end\n end", "def messages(*args)\n if new_record?\n raise Errors::FolderNotFound.new(@id, \"Folder does only exist locally\")\n else\n if !@conn_id.nil? && [email protected]? && selectable?\n self.class.message_class.all(@conn_id, @location.path, *args)\n else\n []\n end\n end\n end", "def destroy_all\r\n Message.destroy_all(channel: @channel)\r\n respond_to do |format|\r\n format.html { redirect_to channel_messages_url(@channel), notice: 'Chat erfolgreich geleert.' }\r\n format.json { head :no_content }\r\n end\r\n end", "def markMail(imap, folder)\n pp \"MARKED #{folder}..\"\n message_ids = imap.uid_search(\"ALL\")\n imap.uid_store(message_ids, \"+FLAGS\", [:Seen])\n imap.expunge\nend", "def watchMail(imap, folder)\n \n # Loop for checking message increase in the folder\n begin\n \n imap.select(folder)\n \n # Get the current folder size\n fsize = imap.status(folder, [\"MESSAGES\"])\n csize = fsize[\"MESSAGES\"]\n \n loop do\n fsize = imap.status(folder, [\"MESSAGES\"])\n if fsize[\"MESSAGES\"] > csize\n message_ids = imap.uid_search(\"ALL\")\n uid = message_ids.last\n email = imap.uid_fetch(uid, \"ENVELOPE\")[0].attr[\"ENVELOPE\"]\n pp \"[#{email.from[0].name}] #{email.subject}\"\n csize = fsize[\"MESSAGES\"]\n else\n sleep(10)\n end\n end\n rescue => e\n exit(1)\n end\nend", "def delete_notifications\n Notification.where(origin_type: 'Message', origin_id: @message.id).destroy_all\n end", "def remove_records(messages)\n clause = deleted_query(messages)\n\n clause.delete_all\n end", "def remove_folder\n space = Space.accessible_by(@context).find(params[:id])\n ids = Node.sin_comparison_inputs(unsafe_params[:ids])\n\n if space.contributor_permission(@context)\n nodes = Node.accessible_by(@context).where(id: ids)\n\n UserFile.transaction do\n nodes.update(state: UserFile::STATE_REMOVING)\n\n nodes.where(sti_type: \"Folder\").find_each do |folder|\n folder.all_children.each { |node| node.update!(state: UserFile::STATE_REMOVING) }\n end\n\n Array(nodes.pluck(:id)).in_groups_of(1000, false) do |ids|\n job_args = ids.map do |node_id|\n [node_id, session_auth_params]\n end\n\n Sidekiq::Client.push_bulk(\"class\" => RemoveNodeWorker, \"args\" => job_args)\n end\n end\n\n flash[:success] = \"Object(s) are being removed. This could take a while.\"\n else\n flash[:warning] = \"You have no permission to remove object(s).\"\n end\n\n redirect_to files_space_path(space)\n end", "def delete(msg)\n read_write()\n uid = (msg.kind_of?(EasyIMAP::Message) ? msg.uid : msg)\n @conn.uid_store(uid, '+FLAGS', [:Deleted])\n expunge()\n end", "def clear_messages(*keys)\n keys.each {|key| session[:messages].delete(key)}\n end", "def find_folders(options={}, &block)\n options[:mailbox] ||= ''\n options[:count] ||= :all\n\n options = validate_options(options)\n mailbox = options[:mailbox] || ''\n mailbox = Net::IMAP.encode_utf7(mailbox)\n mailbox = mailbox.empty? ? '*' : \"#{mailbox}/*\"\n include = options[:include] ||= '*'\n exclude = options[:exclude] ||= nil\n include_flags = options[:include_flags] ||= nil\n exclude_flags = options[:exclude_flags] ||= [:Noselect, :All, :Drafts, :Important, :Junk, :Flagged, :Trash]\n\n start do |imap|\n info \"find_folders block\"\n info \"imap.lsub/list #{mailbox}\"\n boxes = options[:subscribed] ? imap.lsub('', mailbox) : imap.list('', mailbox)\n boxes.replace(options[:what].to_sym == :last ? boxes.last(options[:count]) : boxes.first(options[:count])) if options[:count].is_a?(Integer)\n\n if block_given?\n boxes.each do |box|\n name = Net::IMAP.decode_utf7(box.name)\n flags = box.attr ? box.attr.map{|e| e.to_s.downcase.to_sym} : nil\n next if match_folder(name, exclude) || match_folder_flags(flags, exclude_flags)\n next unless match_folder(name, include) || match_folder_flags(flags, include_flags)\n info \"imap.status #{box.name} #{[\"MESSAGES\", \"UNSEEN\", \"UIDVALIDITY\", \"UIDNEXT\"]}\"\n status = imap.status(box.name, [\"MESSAGES\", \"UNSEEN\", \"UIDVALIDITY\", \"UIDNEXT\"])\n yield Folder.new(name, delim: box.delim, flags: flags, messages: status['MESSAGES'], unseen: status['UNSEEN'], validity: status['UIDVALIDITY'], next: status['UIDNEXT'])\n end unless boxes.nil?\n else\n folders = []\n boxes.each do |box|\n name = Net::IMAP.decode_utf7(box.name)\n flags = box.attr ? box.attr.map{|e| e.to_s.downcase.to_sym} : nil\n next if match_folder(name, exclude) || match_folder_flags(flags, exclude_flags)\n next unless match_folder(name, include) || match_folder_flags(flags, include_flags)\n info \"imap.status #{box.name} #{[\"MESSAGES\", \"UNSEEN\", \"UIDVALIDITY\", \"UIDNEXT\"]}\"\n status = imap.status(box.name, [\"MESSAGES\", \"UNSEEN\", \"UIDVALIDITY\", \"UIDNEXT\"])\n folders << Folder.new(name, delim: box.delim, flags: flags, messages: status['MESSAGES'], unseen: status['UNSEEN'], validity: status['UIDVALIDITY'], next: status['UIDNEXT'])\n end unless boxes.nil?\n folders.size == 1 && options[:count] == 1 ? folders.first : folders\n end\n end\n end", "def get_and_reset_messages!(id)\n log \"get_and_reset_messages #{id}\"\n vals = redis.multi do\n redis.lrange(id, 0, -1)\n redis.del(id)\n end\n # what a sad interface\n # vals[0] is the answer to the first statement in the block\n vals[0].map {|m| Marshal.load(m)}\n end", "def fetch_messages(folder, archive_folder, batch_limit, href_regex, reporter=nil, &proc)\n messages = []\n \n if folder == archive_folder # don't descend into archive folder\n log.info \"skipping folder '#{folder}' because it's the archive folder\"\n return messages\n end\n \n # first, retrieve messages in the current folder, and return if we hit the limit\n message_hrefs = folder.message_hrefs href_regex\n log.info \"Total number of messages in folder '#{folder}' is: #{message_hrefs.size}\"\n \n message_hrefs.each do |message|\n begin\n message.raw # trigger the fetch of the raw data\n messages << message\n yield message if proc\n return messages if messages.size >= batch_limit\n rescue Exception => e\n log.warn \"There was a problem retrieving message from Exchange: \" + e.message + \"\\n\" + e.backtrace.join(\"\\n\")\n reporter.call(e) if reporter\n end\n end\n \n begin\n # then descend into the current folder's subfolders\n folder.folders.each do |sub_folder|\n return messages if messages.size >= batch_limit\n messages += fetch_messages(sub_folder, archive_folder, batch_limit-messages.size, href_regex, &proc)\n end\n rescue Exception => e\n log.warn \"There was a problem listing subfolders with Exchange: \" + e.message + \"\\n\" + e.backtrace.join(\"\\n\")\n reporter.call(e) if reporter\n return messages\n end\n \n messages\n end", "def delete_folder\n @sub_shared_folders,@sub_shared_folders_collection,@sub_shared_docs,@sub_shared_docs_collection,sub_shared_docs = [],[],[],[],[]\n action_type = \"deleted\"\n find_portfolio_and_folder\n cur_folder_parent_id = @folder.parent_id\n files_and_docs_of_folder(@folder.id,true,false)\n find_sub_shared_docs\n send_mail_while_deleting_document(action_type)\n send_mail_while_deleting_folder(action_type)\n delete_files_and_docs_of_folder(@folder.id,true)\n Event.create_new_event(\"permanent_delete\",current_user.id,nil,[@folder],current_user.user_role(current_user.id),@folder.name,nil)\n @folder.real_estate_property.destroy if @folder.real_estate_property_id !=nil && @folder.parent_id ==0\n @folder.destroy\n assign_params(\"asset_data_and_documents\",\"show_asset_files\" )\n @msg = \"#{@folder.name} successfully deleted\"\n update_page_after_deletion\n @folder = Folder.find(@folder.parent_id) if @folder.parent_id !=0 && @folder.parent_id != -2\n end", "def message_delete(id)\n request(:delete, \"messages/#{id.to_s}\")\n end", "def destroy\n @inbox = Inbox.find(params[:id])\n @inbox.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url, notice:'Inbox Destroyed' }\n format.json { head :no_content }\n end\n end", "def remove_from_inbox\r\n @content = Content.active.find(params[:id])\r\n @inbox = Inbox.active.find(params[:inbox_id])\r\n \r\n # Can only remove from active (not archived) inboxes, and then only if you own the content or the inbox\r\n raise Kroogi::NotPermitted unless [email protected]? && current_actor.is_self_or_owner?(@content.user, @inbox.user)\r\n @content.remove_from_inbox(@inbox)\r\n flash[:success] = \"Removed '%s' from '%s'\" / [@content.title_long, @inbox.title_long]\r\n redirect_to content_url(current_actor.is_self_or_owner?(@inbox.user) ? @inbox : @content)\r\n end", "def clear\n messages.clear\n end", "def clear\n messages.clear\n end", "def delete\n self.class.call('domain.mailbox.delete', @domain.fqdn, @login)\n end", "def ajax_delete_mails\n Log.add_info(request, params.inspect)\n\n raise(RequestPostOnlyException) unless request.post?\n\n folder_id = params[:id]\n mail_account_id = params[:mail_account_id]\n SqlHelper.validate_token([folder_id, mail_account_id])\n\n unless params[:check_mail].blank?\n mail_folder = MailFolder.find(folder_id)\n trash_folder = MailFolder.get_for(@login_user, mail_account_id, MailFolder::XTYPE_TRASH)\n\n count = 0\n params[:check_mail].each do |email_id, value|\n next if value != '1'\n\n begin\n email = Email.find(email_id)\n rescue => evar\n end\n next if email.nil? or (email.user_id != @login_user.id)\n\n if trash_folder.nil? \\\n or folder_id == trash_folder.id.to_s \\\n or mail_folder.get_parents(false).include?(trash_folder.id.to_s)\n email.destroy\n flash[:notice] ||= t('msg.delete_success')\n else\n begin\n email.update_attribute(:mail_folder_id, trash_folder.id)\n flash[:notice] ||= t('msg.moved_to_trash')\n rescue => evar\n Log.add_error(request, evar)\n email.destroy\n flash[:notice] ||= t('msg.delete_success')\n end\n end\n\n count += 1\n end\n end\n\n get_mails\n end", "def sync_messages\n Mail.connection do |imap|\n imap.select 'INBOX'\n validity_id = imap.responses[\"UIDVALIDITY\"].last if imap.responses[\"UIDVALIDITY\"]\n if Message.validity.eql? validity_id\n uids = imap.uid_search([\"NOT\", \"DELETED\"]).sort\n local_uids = Message.ids\n if uids != local_uids\n Sidekiq::Logging.logger.info \"*** Syncing Some ***\"\n new_ids = uids - local_uids\n deleted_ids = local_uids - uids\n unless new_ids.blank?\n fetchdata = imap.uid_fetch(new_ids, ['RFC822'])\n fetchdata.each do |rec|\n validity_id = imap.responses[\"UIDVALIDITY\"].last if imap.responses[\"UIDVALIDITY\"]\n msg = Message.new(uid: rec.attr['UID'], validity_id: validity_id, raw_message: rec.attr['RFC822'])\n msg.save\n end\n end\n self.sync_deleted(deleted_ids.map{|id| [validity_id,id].join ':'}) unless deleted_ids.blank?\n end\n else\n self.sync_all\n end\n Message.ids\n end\n end", "def fetch_unread_items(folder)\n item_view = ItemView.new(10) # FIXME: some huge number like 5000, but the JS app is too slow for that\n item_view.property_set = EMAIL_SUMMARY_PROPERTY_SET\n folder.find_items(SearchFilter::IsEqualTo.new(EmailMessageSchema::IsRead, false), item_view).items.to_a\n end", "def clear_messages\n @messages.clear\n end", "def deal_mail_messages(id:, **args)\n params = parameters(args) do\n optional_params :start, :limit\n end\n request(:get, \"deals/#{id}/mailMessages\", params)\n end", "def bulk_delete(token, channel_id, messages = [])\n request(\n __method__,\n :post,\n \"#{api_base}/channels/#{channel_id}/messages/bulk_delete\",\n { messages: messages }.to_json,\n Authorization: token,\n content_type: :json\n )\n end", "def destroy\n @store_manager_messages_read = Store::Manager::Messages::Read.find(params[:id])\n @store_manager_messages_read.destroy\n\n respond_to do |format|\n format.html { redirect_to store_manager_messages_reads_url }\n format.json { head :no_content }\n end\n end", "def handle_processed_mail(uid)\n @imap.uid_copy(uid, @imap_setting[:move_folder]) if (@imap_setting[:move_folder])\n @imap.uid_store(uid, \"+FLAGS\", [:Deleted])\n end", "def destroy\n get_message().delete\n end", "def get_mailboxes()\n begin\n mblist = @imap_client.list('', '*')\n rescue => error\n p \"ERROR getting mailboxes: #{error}\"\n return [] \n end\n\n return order_mailboxes(mblist)\n end", "def clear_notifications\n Notification.where(actor_id: id).destroy_all\n end", "def inbox\n folders.find_by_name(\"Inbox\")\n end", "def inbox\n folders.find_by_name(\"Inbox\")\n end", "def delete\n @client.post('/api/del_msg', id: get_attribute(:name))\n end", "def process(&after_each_message)\n Mail.all(read_only: false, delete_after_find: true) do |message|\n message.skip_deletion unless process_message(message)\n after_each_message.call(message) if after_each_message\n end\n end", "def collect_messages(email, password, label, criteria, save_attachments)\n messages = []\n\n gmail = Gmail.connect(email, password)\n\n begin\n criteria.each do |c|\n messages += fetch_messages(gmail, label, c, save_attachments)\n end\n rescue Exception => e\n puts e.inspect\n ensure\n gmail.logout\n end\n messages\n end", "def destroy\n @inbox = Inbox.find(params[:id])\n @inbox.destroy\n\n respond_to do |format|\n format.html { redirect_to inboxes_url }\n format.json { head :no_content }\n end\n end", "def retrieve_tweet_ids\n imap = Net::IMAP.new('imap.gmail.com', 993, true, nil, false)\n imap.login(@account['credentials']['email_address'], @account['credentials']['email_password'])\n imap.select('INBOX')\n imap.search([\"NOT\",\"SEEN\"]).each do |message_id|\n msg = imap.fetch(message_id, 'RFC822')[0].attr['RFC822']\n # imap.store(message_id, '+FLAGS', [:Seen])\nputs msg\n end \n imap.logout()\n imap.disconnect()\n end", "def run\n super \"Cleansing read, unflagged old messages\",\n [:Deleted] do\n @imap.expunge\n log \"Expunged deleted messages\"\n end\n end", "def inbox\n cur_emp = get_logged_employee\n @messages = Message.where(\"sent_to = ?\", cur_emp).where(:is_deleted => nil )\n render \"resumes/message_show\"\n end", "def delete_inbox_repliers(opts = {})\n delete_inbox_repliers_with_http_info(opts)\n nil\n end", "def messagedelete\n TDirmessage.find_by(\"dirmsg_id=?\", params[:messagedelete]).delete\n redirect_back(fallback_location: dirmsgcreate_path)\n end", "def mailbox_list\n begin\n @imap = WmailImapUtils.current_imap\n folder_list = WmailImapUtils.get_mailbox_list\n @folders_count_hash = Hash[ folder_list.map do |a|\n [a.name, @imap.status(a.name, [\"UNSEEN\"])[\"UNSEEN\"]] unless a.name == \"[Gmail]\"\n end ]\n rescue\n respond_to do|format|\n format.html {redirect_to authenticate_wmail_accounts_path(:redirect => params),\n :alert => 'Connection Lost. Please login to your account'}\n format.js {render :js => \"window.location = '\" + authenticate_wmail_accounts_path(:redirect => params) + \"';\"}\n end\n end\n end", "def fetch_messages(gmail, label, criteria, save_attachments)\n mails = []\n gmail.mailbox(label).search(criteria).each do |email|\n subject = \"#{Mail::Encodings.value_decode(email.subject)}\"\n puts \"----------\"\n puts \"[#{email.uid}] #{subject}\"\n from = sender(email.from)\n to = recipients(email.to)\n attachments = attachments(email)\n body = extract_body(email)\n\n # TODO: saving attachments should be configurable\n if save_attachments && email.message.attachments.any?\n puts \"Attachments:\"\n email.message.attachments.each do |attachment|\n save_attachment(email, attachment)\n end\n end\n\n mails << { :uid => email.uid,\n :date => Time.parse(email.date),\n :subject => subject,\n :from => from,\n :to => to,\n :body => body,\n :attachments => attachments }\n end\n mails\n end", "def destroy\n @inbox.destroy\n respond_to do |format|\n format.html { redirect_to inboxes_url, notice: 'Inbox was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n #@message = Message.find(params[:id])\n #@message.destroy\n #redirect_to projects_path\n current_user.delete_message(ActsAsMessageable::Message.find(params[:id]))\n redirect_to trash_url\n end", "def delete_message(data); end", "def delete_message(data); end", "def delete_folder_children_request(folder_id)\n url = URI(\"#{$base_url}/api/projects/#{$project_id}/folders/#{folder_id}/children\")\n\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n request = Net::HTTP::Delete.new(url)\n request[\"accept\"] = 'application/vnd.api+json; version=1'\n request[\"access-token\"] = $access_token\n request[\"uid\"] = $uid\n request[\"client\"] = $client\n response = http.request(request)\n\n if response.code == 304.to_s\n puts \"Folder is empty. Status: #{response.code}\"\n elsif response.code == 504.to_s\n puts \"Gateway Time-out. Status: #{response.code}\"\n puts response.body\n end\n\n response.code\nend", "def delete_attachments\n delete_attachment_queue.each {|k,v| delete_grid_attachment(k,v)}\n end", "def delete_all_inbox_emails_with_http_info(inbox_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: InboxControllerApi.delete_all_inbox_emails ...'\n end\n # verify the required parameter 'inbox_id' is set\n if @api_client.config.client_side_validation && inbox_id.nil?\n fail ArgumentError, \"Missing the required parameter 'inbox_id' when calling InboxControllerApi.delete_all_inbox_emails\"\n end\n # resource path\n local_var_path = '/inboxes/{inboxId}/deleteAllInboxEmails'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] \n\n # auth_names\n auth_names = opts[:auth_names] || ['API_KEY']\n\n new_options = opts.merge(\n :header_params => 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(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: InboxControllerApi#delete_all_inbox_emails\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def run\n local_only_uids = serializer.uids - folder.uids\n return if local_only_uids.empty?\n\n serializer.filter do |message|\n !local_only_uids.include?(message.uid)\n end\n end", "def destroy\n destroy_q(@message, messages_url)\n end", "def supprimerMessage(indice)\r\n\t\[email protected](indice) if @lstMessages.has_key?(indice)\r\n\tend", "def get_mailbox_messages mailbox_id, posted_since = \"\", include_deleted = \"false\"\n\t\t\tposted_since = Date.today if posted_since.length == 0\n\n\t\t\t@response = api_request 'LoadMessages', [mailbox_id, posted_since, include_deleted]\n\t\t\traise ZenfolioAPI::ZenfolioAPISessionError, @response['error']['message'] if @response['result'].nil? && @response['error'].length > 0\n\n\t\t\t\n\t\tend", "def cleanup\n $redis.del key('chat')\n $redis.del key('messages')\n end", "def destroy\n # delete a specific message\n end", "def index\n @messages = current_user.all_messages.not_deleted\n session[:messaging_context] = :index\n end", "def purge_queues\n [incoming_queue_url, outgoing_queue_url].each do |queue_url|\n while true\n messages = client.receive_message(queue_url: queue_url, max_number_of_messages: 10).messages\n break unless messages.first\n messages.each do |message|\n client.delete_message(queue_url: queue_url, receipt_handle: message.receipt_handle)\n end\n end\n end\n end", "def delete_all_inbox_emails(inbox_id, opts = {})\n delete_all_inbox_emails_with_http_info(inbox_id, opts)\n nil\n end", "def clear!\n messages = [ ]\n @messages_mutex.synchronize do\n @messages.size.times do\n messages << @messages.shift(true)\n end\n end\n messages\n end", "def destroy\n @mailbox = Mailbox.find(params[:id])\n @mailbox.destroy\n\n respond_to do |format|\n format.html { redirect_to mailboxes_url }\n format.json { head :no_content }\n end\n end", "def delete_message_by_restaurant\n root_id = @parsed_json[\"message_id\"] if @parsed_json[\"message_id\"]\n check = Notifications.where(\"id=?\", root_id.to_i).first\n if check.nil?\n render :status=>412, :json=>{:status=>:failed, :error=>\"Not exist this message\"}\n else\n sql =\"notifications.alert_type != 'Publish Menu Notification' AND notifications.id=? OR notifications.reply=?\"\n notifications = Notifications.where(sql, root_id.to_i,root_id.to_i)\n for i in notifications\n i.update_attributes(:is_show=>0, :is_show_detail=>0)\n end\n render :status=>200, :json=>{:status=>:success}\n end\n end", "def destroy\n # delete a specific message\n end", "def trash\n cur_emp = get_logged_employee\n @messages = Message.where(\"sent_to = ?\", cur_emp).where(\"is_deleted = ?\", 1 )\n render \"resumes/message_show\"\n end", "def destroy\n @user = User.find(current_user)\n @message = @user.messages.find(params[:id])\n @message.destroy\n\n end", "def empty_mailboxes\n\t\t\tempty_mailbox\n\t\t\tempty_temp_mailbox\n\t\tend", "def sync_new(mailbox)\n # Skip any mailbox with attributes in ignore_attr\n return if ! (mailbox.attr & @@ignore_attr).empty?\n return if !@running\n\n name = Net::IMAP.decode_utf7(mailbox.name)\n cache = @mailboxes[name] || Mailbox.new(name)\n\n puts \"Examining mailbox #{name}\"\n\n begin\n @imap.examine(mailbox.name)\n rescue => e\n puts \"Failed to examine mailbox: #{e}\"\n return\n end\n\n uidvalidity = @imap.responses[\"UIDVALIDITY\"][-1]\n uidnext = @imap.responses[\"UIDNEXT\"][-1]\n\n if cache.uidvalidity != uidvalidity\n puts \"UIDVALIDITY differ, rescaning all mailbox\"\n ids = @imap.search([\"NOT\", \"DELETED\"])\n else\n if (cache.uidmax + 1 == uidnext)\n puts \"No new messages\"\n return\n end\n puts \"UIDVALIDITY match, get new messages only\"\n ids = ((cache.uidmax + 1) .. uidnext).to_a\n end\n\n puts \"; got #{ids.size} messages\"\n\n while(!(block = ids.shift(@@buf_size)).empty?)\n\n break if ! @running\n puts \"; requesting messages #{block.first}..#{block.last} from server\"\n\n msgs = @imap.fetch((block.first..block.last), [\"UID\", \"X-GM-MSGID\", \"X-GM-THRID\", \"X-GM-LABELS\", \"FLAGS\", \"RFC822\"])\n\n if ! msgs\n puts msgs\n next\n end\n\n msgs.each { |msg|\n break if ! @running\n\n body = msg.attr[\"RFC822\"]\n body.force_encoding(\"binary\") if body.respond_to?(:force_encoding) \n body.gsub(\"\\r\\n\", \"\\n\")\n\n labels = msg.attr[\"X-GM-LABELS\"].push(name).collect { |label| Net::IMAP.decode_utf7(label.to_s) }\n\n state = msg.attr[\"FLAGS\"].collect { |flag| flag.to_s.downcase.to_sym }\n puts state\n\n begin\n response = RestClient.post \"http://localhost:8042/message.json\", \n { :body => body, :labels => labels, :state => state, :mailbox => name },\n { :content_type => :json, :accept => :json}\n rescue RestClient::ResourceNotFound => e\n puts \"Warning: resource not found\"\n next\n rescue => e\n puts \"Failed to communicate with heliotrope : #{e.class}\"\n @running = false\n break\n end\n\n puts response \n response = JSON.parse(response)\n\n if response[\"response\"] == \"ok\"\n if response[\"status\"] == \"seen\"\n cache.num_seen += 1\n else\n cache.num_indexed += 1\n end\n else\n cache.num_bad += 1\n puts \"Error for message: \" + response[\"error_message\"]\n end\n\n cache.uidmax = [cache.uidmax || 0, msg.attr[\"UID\"]].max\n }\n end\n\n puts \"Store mailbox #{name} cache\"\n cache.uidnext = uidnext\n cache.uidvalidity = uidvalidity\n @mailboxes[name] = cache\n save_mailboxes\n end", "def delete_message(message_id)\n RestClient.delete(\"#{@url}/messages/#{message_id}\")\n end", "def get_all()\n @conn.close\n @messages\n end", "def destroy\n Log.add_info(request, params.inspect)\n\n raise(RequestPostOnlyException) unless request.post?\n\n mail_account_id = params[:mail_account_id]\n SqlHelper.validate_token([mail_account_id])\n\n mail_folder = MailFolder.find(params[:id])\n trash_folder = MailFolder.get_for(@login_user, mail_account_id, MailFolder::XTYPE_TRASH)\n\n if trash_folder.nil?\n mail_folder.force_destroy\n render(:text => '')\n else\n if mail_folder.get_parents(false).include?(trash_folder.id.to_s)\n mail_folder.force_destroy\n render(:text => '')\n else\n mail_folder.update_attribute(:parent_id, trash_folder.id)\n flash[:notice] = t('msg.moved_to_trash')\n\n prms = ApplicationHelper.get_fwd_params(params)\n prms[:controller] = params[:controller]\n prms[:action] = 'show_tree'\n @redirect_url = ApplicationHelper.url_for(prms)\n render(:partial => 'common/redirect_to', :layout => false)\n end\n end\n end", "def pull_queue(ownnick)\n usr = User.first(:nickname=>ownnick) #find own record\n return ret_fail(ownnick+' not found in db') if usr == nil #must be error\n\n messages = []\n usr.messages.each do |msg|\n messages << msg.data\n msg.destroy\n end\n\n return {'response'=>true, 'messages'=> messages} #return message queue\nend", "def unregister(user_id)\r\n self.message_boxes.delete(user_id.to_s)\r\n end", "def message_destroy(id)\n post(\"/direct_messages/destroy/#{id}.json\")\n end", "def message_destroy(id)\n post(\"/direct_messages/destroy/#{id}.json\")\n end", "def get_messages where = \"inbox\", opts = {}\n query = {\n mark: false\n }\n query.merge! opts\n get(\"/message/#{where}.json\", query: query)\n end", "def undelete_folder 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_undelete_folder_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 @in_message = InMessage.find(params[:id])\n @in_message.destroy\n\n respond_to do |format|\n format.html { redirect_to(in_messages_url) }\n format.xml { head :ok }\n end\n end", "def delete_msg()\n MsgUtil.delete_msg(params[:ch])\n end", "def destroy\n @message = Messages.find(params[:id])\n @message.destroy\n end", "def clean_all\n\t\t\t\t\t@messages = []\n\t\t\t\tend", "def mailbox_convert_messages(mailbox_path, from_imap = false)\n api(\"MailboxConvertMessages\", mailbox_path, from_imap)\n end", "def destroy\n # delete a specific message\n end", "def remove_all_message_reactions(data); end", "def delete(key)\n messages.delete(key)\n end", "def messages\n selected_label = params[:label].blank? ? 'INBOX' : params[:label]\n \n begin\n\n unless selected_label.blank?\n @imap = WmailImapUtils.current_imap\n @imap.select(selected_label)\n @status = @imap.status(selected_label, ['MESSAGES', 'RECENT', 'UNSEEN'])\n max = @status['MESSAGES']\n min = @status['MESSAGES']-10\n @max = 10\n @min = 1\n @mailbox = selected_label\n @inbox = []\n\n min = 1 if (max <= 10 and max > 0)\n\n @inbox = @imap.fetch(min..max, 'ENVELOPE')\n @unseen_flags = @imap.search(['NOT','SEEN'])\n @imap.expunge\n end\n\n session[:selected_label] = selected_label\n \n respond_to do|format|\n format.html\n format.js\n end\n\n rescue\n\n respond_to do|format|\n format.html {redirect_to authenticate_wmail_accounts_path(:redirect => messages_mailbox_path(:label => selected_label)),\n :alert => 'Connection Lost. Please login to your account'}\n format.js\n end\n \n end\n \n end", "def destroy\n @message.images.purge\n @message.zh_tw_images.purge\n @message.zh_cn_images.purge\n @message.vi_images.purge\n @message.hmn_images.purge\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: \"Message was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end" ]
[ "0.715117", "0.68141574", "0.674943", "0.67229223", "0.6708495", "0.66098094", "0.6487989", "0.6344507", "0.6304122", "0.62503076", "0.6232955", "0.6195238", "0.61682206", "0.60330945", "0.5964698", "0.5903679", "0.5897541", "0.5870347", "0.5858864", "0.5800321", "0.5775095", "0.57520324", "0.5649972", "0.56328946", "0.5632546", "0.56091166", "0.5592292", "0.5584814", "0.5563", "0.5556127", "0.5555939", "0.5555939", "0.5548911", "0.5541102", "0.5527486", "0.5494931", "0.54775834", "0.5474639", "0.54536045", "0.5438559", "0.54374915", "0.54336476", "0.54274225", "0.5418368", "0.53978217", "0.53978217", "0.5390966", "0.53906476", "0.53891605", "0.53829896", "0.53619945", "0.5360218", "0.5356685", "0.53542143", "0.5353284", "0.5344526", "0.53436905", "0.53434646", "0.5341918", "0.5335101", "0.5335101", "0.5313526", "0.53097063", "0.5300961", "0.5300083", "0.52998936", "0.52959013", "0.52924186", "0.5287469", "0.5273898", "0.5273552", "0.52699995", "0.52618766", "0.5259513", "0.52553123", "0.523799", "0.5231511", "0.52106476", "0.5209759", "0.5208465", "0.5200654", "0.51988477", "0.5197061", "0.5191996", "0.5191256", "0.518789", "0.5182475", "0.5182475", "0.5182062", "0.5177431", "0.5176538", "0.5174558", "0.51740384", "0.5171998", "0.5171394", "0.51644975", "0.51622367", "0.51532584", "0.51516277", "0.5151096" ]
0.7870711
0
Get the current folder size and the loop until the number of messages increases. Display the subject of each new email recieved while in the loop.
def watchMail(imap, folder) # Loop for checking message increase in the folder begin imap.select(folder) # Get the current folder size fsize = imap.status(folder, ["MESSAGES"]) csize = fsize["MESSAGES"] loop do fsize = imap.status(folder, ["MESSAGES"]) if fsize["MESSAGES"] > csize message_ids = imap.uid_search("ALL") uid = message_ids.last email = imap.uid_fetch(uid, "ENVELOPE")[0].attr["ENVELOPE"] pp "[#{email.from[0].name}] #{email.subject}" csize = fsize["MESSAGES"] else sleep(10) end end rescue => e exit(1) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mailCount count_type=nil\n # Init the email count to start fresh every time this is called\n total_count = 0\n\n # Get the total count of emails in the Exchange inboxes\n exch_count = exchangeMailCount\n total_count += exch_count\n \n # Get the total count of emails in the IMAP inboxes\n imap_count = imapMailCount\n total_count += imap_count\n\n @email_count = total_count\n puts total_count\n growlNotify\n return @email_count.to_s\n end", "def maxsizefrom_subject\n f = 0\n s = 0\n mailbox.email.each do |email|\n if(email.from.bytesize > f)\n f=email.from.bytesize\n end\n if(email.subject.bytesize > s)\n s=email.subject.bytesize\n end\n end\n return f, s\n end", "def show\n @seqno = params[:id].to_i\n @total = params[:total].to_i\n\n begin\n @imap = WmailImapUtils.current_imap\n message = @imap.fetch(@seqno, ['RFC822']).first.attr['RFC822']\n @mail = Mail.new(message)\n # get the folder list\n mailbox_list\n rescue\n respond_to do|format|\n format.html {redirect_to authenticate_wmail_accounts_path(:redirect => messages_mailbox_path(:label => selected_label)),\n :alert => 'Connection Lost. Please login to your account'}\n format.js\n end\n end\n end", "def show_summary\n Log.add_info(request, params.inspect)\n\n mail_account_id = params[:id]\n\n begin\n @mail_account = MailAccount.find(mail_account_id)\n rescue => evar\n Log.add_error(request, evar)\n redirect_to(:controller => 'login', :action => 'logout')\n return\n end\n\n @folder_tree = MailFolder.get_tree_for(@login_user, [mail_account_id])\n mail_folders = @folder_tree.values.flatten.uniq\n mail_folder_ids = mail_folders.collect{|rec| rec.id}\n @unread_emails_h = {}\n unless mail_folder_ids.nil? or mail_folder_ids.empty?\n unread_emails = Email.find(:all, :conditions => \"user_id=#{@login_user.id} and status='#{Email::STATUS_UNREAD}' and mail_folder_id in (#{mail_folder_ids.join(',')})\")\n unread_emails.each do |email|\n mail_folder = mail_folders.find{|rec| rec.id == email.mail_folder_id}\n unless mail_folder.nil?\n @unread_emails_h[mail_folder] ||= 0\n @unread_emails_h[mail_folder] += 1\n end\n end\n end\n @folder_obj_cache ||= MailFolder.build_cache(mail_folders)\n\n render(:layout => (!request.xhr?))\n end", "def max_subject(mailbox)\r\n x = 0\r\n mailbox.emails.each do |email|\r\n while email.subject.length > x do\r\n x = email.subject.length\r\n end\r\n end\r\n return x\r\n end", "def media_elements_folder_size_alert(current_media_elements_folder_size, maximum_media_elements_folder_size)\n @current_media_elements_folder_size_in_gigabytes = current_media_elements_folder_size.to_f / 1024**3\n @maximum_media_elements_folder_size_in_gigabytes = maximum_media_elements_folder_size.to_f / 1024**3\n mail subject: \"#{SETTINGS['application_name']} - media elements folder size is reaching the maximum size allowed\"\n end", "def show_summary\n Log.add_info(request, params.inspect)\n\n mail_account_id = params[:id]\n SqlHelper.validate_token([mail_account_id])\n\n begin\n @mail_account = MailAccount.find(mail_account_id)\n rescue => evar\n Log.add_error(request, evar)\n redirect_to(:controller => 'login', :action => 'logout')\n return\n end\n\n @folder_tree = MailFolder.get_tree_for(@login_user, [mail_account_id])\n# logger.fatal('@@@ ' + sorted_mail_folders.flatten.collect{|rec| rec.name}.inspect)\n mail_folders = TreeElement.get_flattened_nodes(@folder_tree)\n mail_folder_ids = mail_folders.collect{|rec| rec.id.to_s}\n\n @unread_emails_h = {}\n unless mail_folder_ids.nil? or mail_folder_ids.empty?\n unread_emails = Email.where(\"user_id=#{@login_user.id} and status='#{Email::STATUS_UNREAD}' and mail_folder_id in (#{mail_folder_ids.join(',')})\").to_a\n unread_emails.each do |email|\n mail_folder = mail_folders.find{|rec| rec.id == email.mail_folder_id}\n unless mail_folder.nil?\n @unread_emails_h[mail_folder] ||= 0\n @unread_emails_h[mail_folder] += 1\n end\n end\n end\n @unread_emails_h = @unread_emails_h.sort_by{|mail_folder, count| mail_folders.index(mail_folder) }\n\n @draft_emails_h = {}\n unless mail_folder_ids.nil? or mail_folder_ids.empty?\n draft_emails = Email.where(\"user_id=#{@login_user.id} and status='#{Email::STATUS_DRAFT}' and mail_folder_id in (#{mail_folder_ids.join(',')})\").to_a\n draft_emails.each do |email|\n mail_folder = mail_folders.find{|rec| rec.id == email.mail_folder_id}\n unless mail_folder.nil?\n @draft_emails_h[mail_folder] ||= 0\n @draft_emails_h[mail_folder] += 1\n end\n end\n end\n @draft_emails_h = @draft_emails_h.sort_by{|mail_folder, count| mail_folders.index(mail_folder) }\n\n @folder_obj_cache ||= MailFolder.build_cache(mail_folders)\n\n render(:layout => (!request.xhr?))\n end", "def exchangeMailCount\n # Init the email count to start fresh every time this is called\n total_count = 0\n\n # Get the total count of emails in the Exchange inboxes\n exchange_inbox = Array.new\n count = 0\n @exch_accounts.each do |acct|\n exchange_inbox[count] = @exch_accounts[count].inboxFolder.get\n total_count += exchange_inbox[count].unreadMessageCount\n end\n\n return total_count\n end", "def fetch_messages(folder, archive_folder, batch_limit, href_regex, reporter=nil, &proc)\n messages = []\n \n if folder == archive_folder # don't descend into archive folder\n log.info \"skipping folder '#{folder}' because it's the archive folder\"\n return messages\n end\n \n # first, retrieve messages in the current folder, and return if we hit the limit\n message_hrefs = folder.message_hrefs href_regex\n log.info \"Total number of messages in folder '#{folder}' is: #{message_hrefs.size}\"\n \n message_hrefs.each do |message|\n begin\n message.raw # trigger the fetch of the raw data\n messages << message\n yield message if proc\n return messages if messages.size >= batch_limit\n rescue Exception => e\n log.warn \"There was a problem retrieving message from Exchange: \" + e.message + \"\\n\" + e.backtrace.join(\"\\n\")\n reporter.call(e) if reporter\n end\n end\n \n begin\n # then descend into the current folder's subfolders\n folder.folders.each do |sub_folder|\n return messages if messages.size >= batch_limit\n messages += fetch_messages(sub_folder, archive_folder, batch_limit-messages.size, href_regex, &proc)\n end\n rescue Exception => e\n log.warn \"There was a problem listing subfolders with Exchange: \" + e.message + \"\\n\" + e.backtrace.join(\"\\n\")\n reporter.call(e) if reporter\n return messages\n end\n \n messages\n end", "def recalc_size\n if @mail.nil? or @mail.raw_source.nil?\n new_size = self.get_raw.length\n if new_size == 0\n new_size += self.subject.length unless self.subject.nil?\n new_size += self.message.length unless self.message.nil?\n new_size += self.get_attach_size\n end\n self.size = new_size\n else\n self.size = @mail.raw_source.length\n end\n end", "def imapMailCount\n # Init the email count to start fresh every time this is called\n total_count = 0\n\n # Get the total count of emails in the IMAP inboxes\n imap_inbox = Array.new\n count = 0\n @imap_accounts.each do |acct|\n imap_inbox[count] = @imap_accounts[count].IMAPInboxFolder.get\n total_count += imap_inbox[count].unreadMessageCount\n count += 1\n end\n\n return total_count\n end", "def view_html\n\n $anterior = params[:id].to_i - 1\n $siguiente = params[:id].to_i - 1\n\n $buscar_texto = nil\n $buscar_por = nil\n\n ENV['folder'] = 'mailbox'\n load 'script/mailman_server.rb'\n\n adjuntos = ''\n\n @@messages.each do |message|\n @from = message[:from]\n @to = message[:to]\n @cc = message[:cc]\n @bcc = message[:bcc]\n @subject = message[:subject]\n @date = message[:date]\n @text = message[:text_body]\n @html = message[:html_body]\n end\n\n cc_list = @cc.length > 0 ? 'Cc: <span style=\"word-wrap: break-word;\">' + @cc + '</span><br>' : ''\n bcc_list = @bcc.length > 0 ? 'Cco: <span style=\"word-wrap: break-word;\">' + @bcc + '</span><br>' : ''\n\n @@the_message_attachments.each do |att|\n adjuntos += '<li> <a style=\"color:#666; text-decoration:none;\" href='+att.attached_file.url(:original, false)+' target=\"_blank\">'+att.attached_file_file_name+'</a> </li>'\n end\n\n adjuntos_list = (adjuntos.length > 0) ? 'Adjuntos: <ul>' + adjuntos + '</ul>' : ''\n\n # render file: 'messages/view_html'\n\n respond_to do |format|\n format.html {\n render text: '<div class=\"container-fluid\"> ' +\n '<br>' +\n 'De: ' + @from +\n '<br>' +\n 'A: <span style=\"word-wrap: break-word;\">' + @to + '</span>' +\n '<br>' +\n cc_list +\n bcc_list +\n adjuntos_list +\n '<hr class=\"col-lg-12\">' +\n '</div>' + @html, :layout => false\n }\n # format.html {\n # render text: '<div class=\"container-fluid\">' +\n # '<div class=\"col-md-12\" style=\"background-color: #ced8e1\">' +\n # '<h4>' + @subject + '</h4>' +\n # '<hr style=\"margin-top: 0px; border-top: 1px solid #235589\">' +\n # '<strong>' + @from + '</strong>' +\n # '<br>' +\n # '<div style=\"max-width: 90%; float: left\">' +\n # '<small>Para ' + @to[0..50] + '</small>' +\n # '</div>' +\n # '<div style=\"margin-left: 5px; max-width: 1%; float: left\">' +\n # '<div class=\"dropdown\">' +\n # '<button class=\"btn btn-default btn-xs\" type=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\">' +\n # '<span class=\"caret\"></span>' +\n # '</button>' +\n # '<div class=\"dropdown-menu\"\n # style=\"word-wrap: break-word;\n # width: 500px;\n # padding: 20px;\n # height: 300px;\n # overflow: auto\">' +\n # '<table>\n # <tr>\n # <td valign=\"top\">De:</td>\n # <th>' + @from + '</th>\n # </tr>\n # <tr>\n # <td valign=\"top\">Para:</td>\n # <td>' + @to + '</td>\n # </tr>\n # <tr>\n # <td valign=\"top\">Fecha:</td>\n # <td>' + @date + '</td>\n # </tr>\n # <tr>\n # <td valign=\"top\">Asunto:</td>\n # <td>' + @subject + '</td>\n # </tr>\n # </table>\n # </div>\n # </div>\n # </div>\n # </div>\n # </div>'\n # }\n format.json {\n render json: {\n message: @html\n }\n }\n end\n\n end", "def author_mails\n messages = 0\n simplelist = {}\n \n @senders.each do |name, value|\n simplelist[name] = value.mails.length unless value.mails.empty?\n end\n \n # sort the list (from largest to lowest)\n sortedlist = simplelist.sort {|a,b| b[1] <=> a[1] } \n # calculate number of mails\n sortedlist.each {|i| messages += i[1]}\n \n puts \"Mail-number results of #{messages} processed messages:\"\n messages = messages.to_f\n \n sortedlist.each do |name, number|\n # calculate the percent value\n per = (number / messages) * 100\n # shorten it to two numbers after the floating point\n percent = sprintf(\"%2.2f\", per)\n # display\n puts \"#{name}: #{number} (#{percent}%)\"\n end\n end", "def size\n return @messages.size\n end", "def count_messages\r\n @messages.size\r\n end", "def deliver_mh data\n mh_box = @options[:mh_box] || \"#{ENV[\"HOME\"]}/Mail\"\n spam_folder = @options[:mh_folder_spam] || \"/Junk\"\n folder = data['spam'] ? spam_folder : \"/inbox\" + (data['folder'] || \"\")\n \n dest_dir = [mh_box, folder].join(\"/\")\n \n unless File.exist?(dest_dir)\n FileUtils.mkpath(dest_dir)\n end\n \n max = Dir.children(dest_dir).max_by {|i| i.to_i }&.to_i || 0\n mail_id = max + 1\n \n File.open([dest_dir, mail_id].join(\"/\"), \"w\") do |f|\n f.write data[\"mail\"]\n end\n end", "def show\n if params[:email_thread]\n @email_thread = EmailThread.find(params[:email_thread])\n elsif session[:id]\n @summary = Summary.find(session[:id])\n @email_thread = @summary.email_thread\n else\n flash[:notice] = \"You are logged out.\"\n redirect_to(:controller => '/account', :action => 'login')\n return\n end\n @emails = []\n email_count = 0\n for email in @email_thread.myemails\n email_count+=1\n s = email.Body\n #Keep track of tag beginning and ending\n open = false\n count = 1\n while s.include? \"^\"\n if !open\n case params[:control]\n when 'read' , 'sum' , 'show'\n s[s.index(\"^\"),1] = sent(email_count, count)\n when 'label'\n s[s.index(\"^\"),1] = label(email_count, count)\n end\n open = true\n count += 1\n else\n s[s.index(\"^\"),1] = '</div></div>'\n open = false\n end\n end\n s.gsub! \"/-\\\\\", \"^\"\n @emails << email\n end\n #Render correct action\n case params[:control]\n when 'read'\n render :action => 'read'\n when 'sum'\n render :action => 'sum'\n when 'label'\n render :action => 'label'\n when 'show'\n render :action => 'show'\n end\n end", "def count\n @mailcount = `exiqgrep -c #{@direction} #{@email} 2>/dev/null`.chomp\n end", "def fetch_messages(gmail, label, criteria, save_attachments)\n mails = []\n gmail.mailbox(label).search(criteria).each do |email|\n subject = \"#{Mail::Encodings.value_decode(email.subject)}\"\n puts \"----------\"\n puts \"[#{email.uid}] #{subject}\"\n from = sender(email.from)\n to = recipients(email.to)\n attachments = attachments(email)\n body = extract_body(email)\n\n # TODO: saving attachments should be configurable\n if save_attachments && email.message.attachments.any?\n puts \"Attachments:\"\n email.message.attachments.each do |attachment|\n save_attachment(email, attachment)\n end\n end\n\n mails << { :uid => email.uid,\n :date => Time.parse(email.date),\n :subject => subject,\n :from => from,\n :to => to,\n :body => body,\n :attachments => attachments }\n end\n mails\n end", "def more_messages\n log \"Getting more_messages\"\n log \"Old start_index: #@start_index\"\n max = @start_index - 1\n @start_index = [(max + 1 - @limit), 1].max\n log \"New start_index: #@start_index\"\n fetch_ids = search_query? ? @ids[@start_index..max] : (@start_index..max).to_a\n log fetch_ids.inspect\n message_ids = fetch_and_cache_headers(fetch_ids)\n res = get_message_headers message_ids\n with_more_message_line(res)\n end", "def inbox\n @title = \"Conversaciones del grupo \" + @previa_group.name\n @chats = GetChatsForPreviaGroup.call(@previa_group)\n end", "def total\n @messages.size\n end", "def sent(email_count, count)\n \"<div><div id='s#{email_count}.#{count}' class='sentences'><b>#{email_count}.#{count}</b>&nbsp;\"\n end", "def sync_new_mail_count\n c = conversations.count(:conditions => [\"mails.mail_type = 'inbox' and mails.read = 0\"])\n self.class.update_all [\"new_mail_count = ?\", c], [\"id = ?\", id]\n end", "def first_message_number\n @first_message_index < 0 ? @messages.length + @first_message_index : @first_message_index\n end", "def size\n @messages_as_text.size\n end", "def mailbox_size\n @strategy.mailbox_size\n end", "def getMail\n# gets maximum id avoiding nil case\n id = Message.maximum(:id)\n if id.nil?\n id = 0\n else\n id += 1\n end\n allMail = Mail.all #Grab all unread mail\n if !allMail.empty? #Check to see if no new mail\n allMail.each do |mail|\n#This is a method to check to see if author is from grinnell domain\n# if mail.from[0].downcase.include? (\"@grinnell.edu\")\n# if mail.subject.downcase.include? (\"csstudent\")\n message = Message.new\n message.id = id\n #Grab subject that doesn't include csstudent and other tags\n message.subject = addTag(message, mail.subject)\n message.tag_list.sort!\n message.author = mail.from[0]\n message.content = getContent(mail)\n message.created_at = mail.date.to_s\n # Makes it so both have the same time format\n message.updated_at = Time.now.strftime(\"%Y-%m-%d %H:%M\")\n message.save\n id += 1\n# end\n end\n end\n end", "def mails_per_day\n all_mpd = {}\n @senders.each do |name, value|\n # next sender it the current sender has no mails\n next if value.mails.empty?\n \n alldates = []\n value.mails.each {|i| alldates << i.date }\n alldates.sort!\n \n # get the date of the first (=oldest) mail\n since = alldates[0]\n # get the date of today\n now = Date.today()\n # how many days is the first mail old?\n duration = (now - since)\n # divide the number of mails by the duration\n mpd = (value.mails.length / duration).to_f\n # add the mail-per-day value to the dict\n all_mpd[name] = mpd\n end\n \n # sort from biggest to smallest\n all_mpd = all_mpd.sort {|a,b| b[1] <=> a[1] }\n \n puts \"Mails-per-day results of #{all_mpd.length} processed authors:\"\n \n all_mpd.each do |person, mpd|\n dpm = 1 / mpd\n puts \"#{person}: #{sprintf('%0.3f', mpd)} mails/day = #{sprintf('%0.1f', dpm)} days/mail\"\n end\n end", "def receive_data_chunk data\n @smtps_msg_size ||= 0\n @smtps_msg_size += data.join.length\n STDERR.write \"<#{@smtps_msg_size}>\"\n end", "def mailbox_list\n begin\n @imap = WmailImapUtils.current_imap\n folder_list = WmailImapUtils.get_mailbox_list\n @folders_count_hash = Hash[ folder_list.map do |a|\n [a.name, @imap.status(a.name, [\"UNSEEN\"])[\"UNSEEN\"]] unless a.name == \"[Gmail]\"\n end ]\n rescue\n respond_to do|format|\n format.html {redirect_to authenticate_wmail_accounts_path(:redirect => params),\n :alert => 'Connection Lost. Please login to your account'}\n format.js {render :js => \"window.location = '\" + authenticate_wmail_accounts_path(:redirect => params) + \"';\"}\n end\n end\n end", "def main\n # check those arguments\n usage if ARGV[0].nil?\n target = ARGV[0].strip\n maildir = \"#{ENV['HOME']}/Library/Mail\"\n maildir = ARGV[1].strip unless ARGV[1].nil?\n puts \"Using source directory of '#{maildir}'...\"\n puts \"Using target directory of '#{target}'...\"\n deliveries = 0\n\n # make the target directory\n File.umask(077)\n FileUtils.mkdir(target)\n\n # for each dir in source dir matching /\\.mbox$/ (recursive)\n $stdout.sync = true\n traverse(maildir, /\\.mbox$/) do |dir|\n d = \"#{dir}/Messages\"\n next unless FileTest.directory?(d)\n new_d = new_maildir(target, maildir, d)\n\n # for each filename matching /\\.emlx$/\n msgs = 0\n Dir.entries(d).each do |file|\n next unless file =~ /\\.emlx$/\n msgs += 1\n\n # load all lines of source file into array\n lines = IO.readlines(\"#{d}/#{file}\")\n\n # remove first line from array\n lines.delete_at(0)\n\n # from the end of the array, look for \"</plist>\"; until we find\n # the matching \"<?xml...>\" line, we drop each line from the\n # array\n raise \"Invalid file format\" unless lines[-1] =~ /^<\\/plist>/\n last = \"\"\n flags = 0\n lines.reverse_each do |line|\n break if last =~ /^<\\?xml version=\"1.0\" encoding=\"UTF-8\"\\?>/\n if line =~ /<key>flags<\\/key>/\n flags = last.sub(/<integer>/, \"\").sub( /<\\/integer>.*/, \"\").to_i\n end\n last = lines[-1].dup\n lines.delete_at(-1)\n end\n\n # open new Maildir-formatted filename in target dir ($TARGET)\n deliveries += 1\n n = maildirname(deliveries, flags)\n File.open(new_d + \"/\" + n, \"w+\") do |f|\n lines.each { |x| f.print x }\n end\n\n print sprintf(\"\\r%s %d\", \"Converting #{dir}...\", msgs)\n end\n puts unless msgs.zero?\n end\nend", "def count_messages\n Mailboxer::Message.conversation(self).count\n end", "def get_next_message\n return @mailer.get_next_message\n end", "def receive_data_chunk data\n #@smtps_msg_size ||= 0\n #@smtps_msg_size += data.join.length\n #STDERR.write \"<#{@smtps_msg_size}>\"\n end", "def sending_email\n puts\n email = \"Sending notification email\"\n puts bold(email)\n puts email.length.times.map {\"=\"}.join\n puts\n end", "def sync_new(mailbox)\n # Skip any mailbox with attributes in ignore_attr\n return if ! (mailbox.attr & @@ignore_attr).empty?\n return if !@running\n\n name = Net::IMAP.decode_utf7(mailbox.name)\n cache = @mailboxes[name] || Mailbox.new(name)\n\n puts \"Examining mailbox #{name}\"\n\n begin\n @imap.examine(mailbox.name)\n rescue => e\n puts \"Failed to examine mailbox: #{e}\"\n return\n end\n\n uidvalidity = @imap.responses[\"UIDVALIDITY\"][-1]\n uidnext = @imap.responses[\"UIDNEXT\"][-1]\n\n if cache.uidvalidity != uidvalidity\n puts \"UIDVALIDITY differ, rescaning all mailbox\"\n ids = @imap.search([\"NOT\", \"DELETED\"])\n else\n if (cache.uidmax + 1 == uidnext)\n puts \"No new messages\"\n return\n end\n puts \"UIDVALIDITY match, get new messages only\"\n ids = ((cache.uidmax + 1) .. uidnext).to_a\n end\n\n puts \"; got #{ids.size} messages\"\n\n while(!(block = ids.shift(@@buf_size)).empty?)\n\n break if ! @running\n puts \"; requesting messages #{block.first}..#{block.last} from server\"\n\n msgs = @imap.fetch((block.first..block.last), [\"UID\", \"X-GM-MSGID\", \"X-GM-THRID\", \"X-GM-LABELS\", \"FLAGS\", \"RFC822\"])\n\n if ! msgs\n puts msgs\n next\n end\n\n msgs.each { |msg|\n break if ! @running\n\n body = msg.attr[\"RFC822\"]\n body.force_encoding(\"binary\") if body.respond_to?(:force_encoding) \n body.gsub(\"\\r\\n\", \"\\n\")\n\n labels = msg.attr[\"X-GM-LABELS\"].push(name).collect { |label| Net::IMAP.decode_utf7(label.to_s) }\n\n state = msg.attr[\"FLAGS\"].collect { |flag| flag.to_s.downcase.to_sym }\n puts state\n\n begin\n response = RestClient.post \"http://localhost:8042/message.json\", \n { :body => body, :labels => labels, :state => state, :mailbox => name },\n { :content_type => :json, :accept => :json}\n rescue RestClient::ResourceNotFound => e\n puts \"Warning: resource not found\"\n next\n rescue => e\n puts \"Failed to communicate with heliotrope : #{e.class}\"\n @running = false\n break\n end\n\n puts response \n response = JSON.parse(response)\n\n if response[\"response\"] == \"ok\"\n if response[\"status\"] == \"seen\"\n cache.num_seen += 1\n else\n cache.num_indexed += 1\n end\n else\n cache.num_bad += 1\n puts \"Error for message: \" + response[\"error_message\"]\n end\n\n cache.uidmax = [cache.uidmax || 0, msg.attr[\"UID\"]].max\n }\n end\n\n puts \"Store mailbox #{name} cache\"\n cache.uidnext = uidnext\n cache.uidvalidity = uidvalidity\n @mailboxes[name] = cache\n save_mailboxes\n end", "def run\n log \"Flagging tasty messages\"\n\n message_count = 0\n mailboxes = find_mailboxes\n\n mailboxes.each do |mailbox|\n @mailbox = mailbox\n @imap.select @mailbox\n log \"Selected #{@mailbox}\"\n\n message_count += process_unlearned_flagged\n message_count += process_tasty_unflagged\n message_count += process_bland_flagged\n message_count += process_unlearned\n end\n\n log \"Done. Found #{message_count} messages in #{mailboxes.length} mailboxes\"\n end", "def show\n\t@messages = Message.where(:subject_id => @subject.id)\n\n\tpages_and_messages = calculate_pages(@messages)\n\n\t@page = params[:page]\n\t@last_page = pages_and_messages.count\n\n\tif @page.nil?\n\t\t@messages = pages_and_messages[1]\n\t\t@page = 1\n\telse\n\t\t@page = Integer(@page)\n\t\t@messages = pages_and_messages[@page]\n\tend\n\n\tif @page > 1\n\t\t@has_prev_pages = true\n\tend\n\tif @last_page - @page > 0 \n\t\t@has_more_pages = true\n\tend\n\n\tif current_user && current_user.can_edit_and_delete_subject(@subject)\n\t\t@has_rights = true\n\tend\n end", "def start_message\n @all_text_width = 0\n @pop = nil\n \n @text = \"\"\n @text_line = $game_message.texts.size < $game_message.max_line ? $game_message.texts.size + 1 : MAX_LINE + 1\n for i in 0...$game_message.texts.size\n # Change \" \" to \"\" (Spacing for choice)\n @text += \"\" if i >= $game_message.choice_start\n @text += $game_message.texts[i].clone + \"\\x00\"\n end\n \n @item_max = $game_message.choice_max\n convert_special_characters\n reset_window\n update_window_size\n new_page\n end", "def show\n email = Gmailer.gmail.inbox.find(:all).find {|e| e.msg_id == @message.message_id.to_i } #convert due to wrong type\n @attachments = email ? email.message.attachments : []\n end", "def getEmails\n begin\n puts 'attempting to connect to ' + @username + '@gmail.com'\n Gmail.new(@username, @password) do |gmail|\n puts 'connection established'\n #use peek to make emails not be automatically marked as read\n gmail.peek = (@peek === 'true' ? true : false)\n\n if @label == \"none\"\n inbox = gmail.inbox\n boxname = 'inbox'\n else\n inbox = gmail.mailbox(@label)\n boxname = @label + ' box'\n end\n number_unread = inbox.count(:unread)\n if number_unread < 1\n abort(\"There are no new messages in the \" + boxname)\n end\n p \"there are \" + number_unread.to_s + \" unread emails in the \" + boxname\n inbox.emails(:unread).each do |email|\n puts parser(email)\n end\n end\n\n rescue Net::IMAP::NoResponseError\n puts 'connection failed, check your config file for incorrect credentials'\n puts 'perhaps you opted to use a label that doesn\\'t exist, try \"none\" instead'\n end\nend", "def fetch_unread_items(folder)\n item_view = ItemView.new(10) # FIXME: some huge number like 5000, but the JS app is too slow for that\n item_view.property_set = EMAIL_SUMMARY_PROPERTY_SET\n folder.find_items(SearchFilter::IsEqualTo.new(EmailMessageSchema::IsRead, false), item_view).items.to_a\n end", "def run()\r\n\t\twhile 0\r\n\t\t\tbegin \r\n\t\t\t\tlog.info 'Connecting to email server...'\r\n\t\t\t\tif @pop.connect() \r\n\t\t\t\t\t#make the db connection\r\n log.info \"Processing #{@pop.message_count} messages...\"\r\n\r\n\t\t\t\t\tActiveRecord::Base.establish_connection(@config[@db_env])\r\n @pop.each_mail do |m| \r\n proc_msg(m)\t\t\t\t\t\t\t\r\n end\r\n\t\t\t\t\tActiveRecord::Base.connection.disconnect!\r\n\r\n\t\t\t\t\[email protected]()\r\n\t\t\t\t\tlog.info \"Processing complete.\"\r\n\t\t\t\t\tlog.info(\"\")\r\n\t\t\t\telse\r\n\t\t\t\t\tlog.error \"Could not connect to mail server!\\n\"\r\n\t\t\t\t\tlog.info(\"\")\r\n\t\t\t\tend\r\n\t\t\trescue Exception => e\r\n\t\t\t\tlog_exception(e)\r\n\t\t\t\tMessage.send_error_email(\"Error processing an SMS message.\", e)\r\n\t\t\t\[email protected]()\r\n\t\t\t\tsleep(30)\r\n\t\t\tend\r\n\t\t\tsleep(15)\r\n\t\tend\t\r\n\t\tlog.close\r\n\tend", "def starting_msg(n)\n \"#{n} bottles of beer on the wall, #{n} bottles of beer.\"\nend", "def inbox\n folders.find_by_name(\"Inbox\")\n end", "def inbox\n folders.find_by_name(\"Inbox\")\n end", "def message_subject\n active_div.div(:id=>\"inbox_show_message\").div(:class=>\"inbox_subject\").link.text\n end", "def getNewMail\n\n @@CTYPE_TO_EXT = {\n 'image/jpeg' => 'jpg',\n 'image/gif' => 'gif',\n 'image/png' => 'png',\n 'image/tiff' => 'tif'\n }\n begin\n \n # Go through users mail accounts for new attachment files\n userEmails = UserEmail.find_all_by_mail_checking(true);\n userEmails.each do |x|\n if x.last_uid == nil\n x.update_attribute(:last_uid, 0)\n end\n container_name = x.mail_server.gsub(/\\./, \"_\")\n if x.device_id != nil\n device = Device.find_by_id(x.device_id)\n if device != nil\n container_name = device.dev_name\n end\n end\n new_uid = goThroughUserEmails(x.user_id, x.mail_username, x.mail_password, x.mail_server, x.mail_port, x.mail_tls_encryption, x.last_uid, container_name)\n if new_uid > x.last_uid\n x.update_attribute(:last_uid, new_uid)\n end\n end\n rescue => e\n puts \"PROBLEM GOING THROUGH USER EMAILS\"\n puts e \n \n end\n \n \n begin\n \n ## Configurations \n username = \"XXXXXX\"\n password = \"YYYYYY\"\n server = \"imap.gmail.com\"\n port = 993\n \n\n \n # Connect to gmail server\n imap = Net::IMAP.new(server,port,true)\n \n # Login\n imap.login(username, password)\n \n # Select inbox\n imap.select('INBOX')\n \n # get all new mails\n imap.uid_search([\"NOT\", \"DELETED\", \"NOT\", \"SEEN\"]).each do |uid|\n \n # fetches the source of the email for tmail to parse\n source = imap.uid_fetch(uid, 'RFC822')\n \n if source == nil\n puts \"Couldn't find mail with uid: #{uid}\"\n next\n end\n \n source = source.first.attr['RFC822']\n \n # parse with tmail\n email = TMail::Mail.parse(source) \n \n # Print subject and sender\n #p email.subject \n #p email.from \n \n ### Look for hash hidden in receiver name\n username, contextname = findUserAndContext(email.to.to_s)\n if username == nil or contextname == nil\n next\n end\n \n puts \"User: #{username}\"\n puts \"Context: #{contextname}\"\n \n user = User.find_by_username(username)\n contextName = ContextName.find_by_username_and_name(username, contextname)\n \n if user == nil or contextName == nil\n next\n end\n \n # Check that user has named email sender as his email account\n useremail = UserEmail.find_by_user_id_and_email(user.id, email.from)\n if useremail == nil\n next\n end\n \n context = Context.find_by_id(contextName.context_id)\n if context == nil\n next\n end\n \n puts \"Mail is from account that user has named and context is found\"\n \n device = nil\n \n # If has attachments, save them\n if email.has_attachments?\n email.parts.each_with_index do |part, index|\n puts part.content_type\n \n # Text files are ignored. If mail has attachments, body was considerede as attachment.\n if part.content_type == \"text/plain\" or part.content_type == \"multipart/alternative\"\n next\n end\n \n # Create device if doesn't already exist\n if device == nil\n # Try to find virtual device or create it\n device = findOrCreateVirtualDevice(user.id, \"visualrest_mail_box\")\n \n # If device name is already in use for other type of device, \n if device == nil\n puts \"Couldn't create virtual_container with name 'visualrest_mail_box'\"\n next\n end\n end \n \n \n filename = part_filename(part)\n content_type = part.content_type\n filename ||= \"#{index}.#{ext(part)}\"\n file = filename\n fname = file.split(\".\")\n \n # If prefix given in topic, add it to filename\n if email.subject.to_s.include?(\"[p]\") \n # Adds email topic as a prefix for the file\n filename = email.subject.to_s.gsub('[p]', '').strip.gsub(/\\r/, '_') + \"_\" + filename\n end\n \n # Use virtualContainerManager to add the file\n # Create the manager \n @virtualContainerManager = VirtualContainerManager.new(user, device.dev_name)\n \n # Add file with the manager\n @virtualContainerManager.addFile('/' + filename, part.body)\n \n @virtualContainerManager.addMetadata('/' + filename, \"context_hash\", context.context_hash)\n \n # Add metadata\n @virtualContainerManager.addMetadata('/' + filename, \"mail_topic\", email.subject)\n @virtualContainerManager.addMetadata('/' + filename, \"mail_from\", email.from.to_s.strip)\n \n \n \n # Make the commit\n @virtualContainerManager.commit\n \n puts \"File #{filename} was saved to visualrest\"\n end\n end\n end\n \n imap.logout\n imap.disconnect\n \n rescue => e\n puts e\n return\n end \n end", "def read_messages_via_imap\n\timap = Net::IMAP.new(server,port,usessl)\n\timap.login(mailid,password)\n\timap.select(folder)\n\tsince = included.blank? ? \"1-Jan-2000\" : included.yesterday.to_date.strftime(\"%e-%b-%Y\")\n\timap.uid_search([\"SINCE\",since]).each do |msg_id|\n\t\tnext unless mailmessages.find_by_uid(msg_id).nil?\n\t\tbody = imap.uid_fetch(msg_id,['RFC822']).first.attr['RFC822']\n\n\t\tMailfolderMailhandler::receive(body,self,msg_id)\n\t\timap.store(msg_id, \"+FLAG\", [:Deleted]) if delete_message?\n\tend\n\timap.expunge if delete_message?\n\timap.logout\n end", "def message_length; complete_message.length; end", "def recite_subject(number)\n # validate number\n validate_number(number)\n\n i = @size - number\n final_subjects = []\n while i < @size\n subjects = get_subject(@lyrics[i])\n subjects.each do |subject|\n final_subjects.push(subject)\n end\n i+=1\n end\n\n final_subjects = format_final_subject(final_subjects)\n\n return \"This is \" + final_subjects\n end", "def get_mails\n gmail = Gmail.connect @current_user.login, @current_user.password\n return nil unless gmail.logged_in?\n\n mails = gmail.inbox.find :unread, after: @filter_date + 1\n sent_mails = gmail.label(\"[Gmail]/Sent Mail\").find(afetr: @filter_date + 1)\n sent_mails.each { |e| mails << e }\n mails.sort_by!(&:date)\n\n end", "def start_messages\n Server.log.info(\"* Worker count: #{@configs.count}\")\n end", "def display\n\t\tr_str = \"Message: \"\n\t\t(@length / 5).times { |i| r_str += \"#{@string[(i * 5)...(i * 5) + 5]} \" }\n\t\tputs r_str\n\tend", "def display_mail_queue(what)\n emails = case what\n when 'all' then\n puts 'Showing all emails in the system'\n ArMailerRevised.email_class.all\n when 'deliverable' then\n puts 'Showing emails ready to deliver'\n ArMailerRevised.email_class.ready_to_deliver\n when 'delayed' then\n puts 'Showing delayed emails'\n ArMailerRevised.email_class.delayed\n else\n []\n end\n puts 'Mail queue is empty' and return if emails.empty?\n puts Hirb::Helpers::AutoTable.render emails, :fields => [:from, :to, :delivery_time, :last_send_attempt, :updated_at]\n end", "def size(msg)\n debug \"#{Dir.pwd}/#{msg}: #{File.exists?(\"#{Dir.pwd}/#{msg}\")}\"\n if File.exists?(\"#{Dir.pwd}/#{msg}\")\n bytes = File.size(msg)\n \"#{msg} #{bytes}\"\n else\n \"553 File doesn't exist\" \n end\n\n end", "def collect_messages(email, password, label, criteria, save_attachments)\n messages = []\n\n gmail = Gmail.connect(email, password)\n\n begin\n criteria.each do |c|\n messages += fetch_messages(gmail, label, c, save_attachments)\n end\n rescue Exception => e\n puts e.inspect\n ensure\n gmail.logout\n end\n messages\n end", "def new_mail\n poll_response['num_unread'].to_i\n end", "def show\n @messaging = @message.messagings.where(recipient_id: current_user.id).first\n if [email protected]?\n @messaging.status = 1\n @messaging.save\n end\n @children = Messaging.where('message_id in (?) AND recipient_id = ?', @message.children.pluck(:id), current_user.id)\n for child in @children\n child.status = 1\n child.save\n end\n if !params[:page].blank?\n @page = params[:page]\n else\n @page = 1\n end\n if !params[:type].blank?\n @type = params[:type]\n else\n @type = 'inbox'\n end\n end", "def to_s\n num_postcards = @mail_items.count { |items| item.class == Postcard }\n \"The mailbox has #{num_postcards} postcards and #{@mail_items - num_postcards}\"\n end", "def name_and_unread(mailbox)\n if mailbox.messages.unread.size.zero?\n folder_icon(mailbox) + mailbox.name\n else\n folder_icon(mailbox) + mailbox.name + content_tag(:span, mailbox.messages.unread.size, :class => 'unread-messages-counter')\n end\n end", "def index\n @type = params[:type]\n @per_page = 7\n if !params[:page].blank?\n @page = params[:page]\n else\n @page = 1\n end\n @sent_count = Message.where('sender_id = ? AND status != 2', current_user.id).count\n @inbox_count = Messaging.where(\"recipient_id = ? AND status = 0\", current_user.id).count\n case @type\n when 'sent'\n @messages = Message.where('sender_id = ? AND status != 2', current_user.id).order('created_at DESC').paginate(:page => @page, :per_page => @per_page)\n else\n @messages = Message.joins(:messagings).where(\"messagings.recipient_id = ? AND messages.status != 2\", current_user.id).order('created_at DESC').paginate(:page => @page, :per_page => @per_page)\n end\n @grouped = @messages.to_a.group_by { |t| t.parent }\n end", "def next_message; end", "def next_message; end", "def num_messages\n\n begin\n\n id_cuenta = params[:id]\n $folder = \"inbox\"\n @setting_email = SettingsEmail.where(id: id_cuenta)\n\n if @setting_email.blank?\n\n render json: {\n errors: {\n message: \"Debes configurar la cuenta de correo entrante\"\n }\n }\n\n else\n\n @setting_email.each do |setting|\n $server = setting.server\n $port = setting.port\n $username = setting.username\n $password = setting.password\n end\n\n ENV['option'] = 'num_messages'\n load 'script/mailman_function.rb'\n render json: {\n errors: {\n data: @@num_messages,\n status: 200,\n message: \"conexión exitosa\"\n }\n }\n\n end\n\n rescue\n\n render json: {\n errors: {\n data: @data,\n status: 500,\n message: \"Error! valida las credenciales de acceso o revisa la configuración de tu cuenta\"\n }\n }\n\n end\n\n end", "def message_count\n 0\n end", "def send_gmail_to_listing(username, password, subject_text, worksheet_key, html_path, image_path)\n # Connect to gmail and puts\n # username and password are parameters you will input as argument on command line\n gmail = Gmail.connect(username, password)\n puts \"Gmail login\"\n\n # Call the go_through_all_the_lines function wich returns all the emails in an array\n email_listing = go_through_all_the_lines(worksheet_key)\n\n # Iterate through all the emails\n email_listing.each do |email|\n # For each email send mail to email\n gmail.deliver do\n to email\n # subject_text variable is a parameter you will input as argument on command line\n subject subject_text\n # Send the content in the email as html\n html_part do\n content_type 'text/html; charset=UTF-8'\n # Call the get_email_html function to get the body content\n body get_email_html(html_path)\n end\n # Call the get_email_image function to add an image to the email\n add_file get_email_image(image_path)\n end\n # Puts a message on console when the email is successfully sent\n puts \"Email successfully sent to #{email}\"\n end\n # Call the save_to_file function to save the output in a text file\n save_to_file(email_listing)\n # Log out of gmail and puts\n gmail.logout\n puts \"Gmail logout script finished\"\n\nend", "def check_queue_size_all\n queue = `#{config[:path]} | /bin/egrep '[0-9]+ Kbytes in [0-9]+ Request\\|Mail queue is empty'`\n queue == 'Mail queue is empty' ? 0 : queue.split(' ')[4].to_i\n end", "def sync_messages\n Mail.connection do |imap|\n imap.select 'INBOX'\n validity_id = imap.responses[\"UIDVALIDITY\"].last if imap.responses[\"UIDVALIDITY\"]\n if Message.validity.eql? validity_id\n uids = imap.uid_search([\"NOT\", \"DELETED\"]).sort\n local_uids = Message.ids\n if uids != local_uids\n Sidekiq::Logging.logger.info \"*** Syncing Some ***\"\n new_ids = uids - local_uids\n deleted_ids = local_uids - uids\n unless new_ids.blank?\n fetchdata = imap.uid_fetch(new_ids, ['RFC822'])\n fetchdata.each do |rec|\n validity_id = imap.responses[\"UIDVALIDITY\"].last if imap.responses[\"UIDVALIDITY\"]\n msg = Message.new(uid: rec.attr['UID'], validity_id: validity_id, raw_message: rec.attr['RFC822'])\n msg.save\n end\n end\n self.sync_deleted(deleted_ids.map{|id| [validity_id,id].join ':'}) unless deleted_ids.blank?\n end\n else\n self.sync_all\n end\n Message.ids\n end\n end", "def index\n collect_messages\n @message = Message.new\n #Stalker.enqueue('email.send', :to => '[email protected]')\n end", "def get_messages\n @connection.uid_search(@filter).each do |message|\n puts \"PROCESSING MESSAGE #{message}\"\n [email protected]_fetch(message,\"RFC822\")[0].attr[\"RFC822\"]\n @processor.process(body, @options)\n @connection.uid_copy(message, 'Processed')\n\n @connection.uid_store(message,\"+FLAGS\",[:Deleted])\n end\n @connection.expunge\n #@connection.delete_all\n end", "def check_for_big_messages\n if message_size > user_thread.options[:max_email_size]\n Log.librato(:count, \"system.process_uid.big_message\", 1)\n user_thread.update_user(:last_uid => uid)\n return false\n else\n return true\n end\n end", "def new_messages_notification(mailbox_name,mailbox_link,new_message_count,total_message_count)\n\t\tmessage_multiple = new_message_count > 1 ? 'msgs' : 'msg'\n\t\tmessage_desc = new_message_count > 1 ? 'Click here to read them.' : 'Click here to read it.'\n\n\t\[email protected](\n\t\t\tkind = RESPONSIVE_KIND,\n\t\t\ttitle = \"#{new_message_count} new #{message_multiple} | #{mailbox_name} (#{total_message_count})\",\n\t\t\tdescription = message_desc,\n\t\t\tcontext = mailbox_name, \n\t\t\tsticky = true, \n\t\t\tpriority = 0\n\t\t)\n\tend", "def each_message(uids, type) # :yields: TMail::Mail\n parts = mime_parts uids, type\n\n uids = []\n\n each_part parts, true do |uid, message|\n mail = TMail::Mail.parse message\n\n begin\n success = yield uid, mail\n\n uids << uid if success\n rescue => e\n log e.message\n puts \"\\t#{e.backtrace.join \"\\n\\t\"}\" unless $DEBUG # backtrace at bottom\n log \"Subject: #{mail.subject}\"\n log \"Message-Id: #{mail.message_id}\"\n p mail.body if verbose?\n\n raise if $DEBUG\n end\n end\n\n uids\n end", "def print_tree_size()\n\t\tputs \"Total size for #{@folder_walker.folder} is #{commify(@folder_walker.total_size)}\"\n\tend", "def first_unread_message\n gmail.inbox.find(:unread).find do |email|\n email.to[0].mailbox.include? 'performance_group'\n end\n end", "def sync\n folders = get_gfolders(:refresh => true)\n folders or return\n\n by_title = gdocs_by_title(folders)\n\n @messages = []\n\n top = by_title['CMS']\n unless top\n flash[:error] = 'No CMS folder in your FixNix Docs'\n return render 'document/sync'\n end\n\n client = get_gdata_client\n return unless client\n\n unless by_title[cycle_gfolder(@cycle)]\n folder = client.create_folder(@cycle.slug, :parent => top)\n by_title[cycle_gfolder(@cycle)] = folder\n session[:gfolders] = {} # clear cache\n @messages << \"Created #{folder.full_title}\"\n end\n\n cycle_folder = by_title[\"#{top.full_title}/#{@cycle.slug}\"]\n\n ['Systems', 'Accepted'].each do |name|\n unless by_title[\"#{cycle_folder.full_title}/#{name}\"]\n folder = client.create_folder(name, :parent => cycle_folder)\n by_title[\"#{cycle_folder.full_title}/#{name}\"] = folder\n session[:gfolders] = {} # clear cache\n @messages << \"Created #{folder.full_title}\"\n end\n end\n\n systems = by_title[\"#{cycle_folder.full_title}/Systems\"]\n\n System.all.each do |sys|\n path = system_gfolder(@cycle, sys)\n unless by_title[path]\n folder = client.create_folder(sys.slug, :parent => systems)\n session[:gfolders] = {} # clear cache\n @messages << \"Created #{folder.full_title}\"\n end\n end\n end", "def list_of_messages()\n\t\t\n\t\t#Create a new request\n\t\trequest_url = \"https://www.googleapis.com/gmail/v1/users/#{@email}/messages?labelIds=Label_1&access_token=#{@access_token}\"\n\n\t\t#GET REQUEST\n\t\tresponse = RestClient.get request_url\n\t\tresponse_body = JSON.parse(response.body)\n\n\t\t#Looping through all the Messages and grabbing id\n\t\tmessages= Array.new\n\n\t\ttemp = response_body['messages']\n\t\ttemp.each do |item|\n\t\t\tmessages.push(item['id'])\n\t\tend \n\t\n\t\treturn messages\n\tend", "def check_for_new_messages\n messages = twitter.direct_messages(:since_id => last_message_retrieved)\n @num_messages = messages.length\n end", "def inbox\n cur_emp = get_logged_employee\n @messages = Message.where(\"sent_to = ?\", cur_emp).where(:is_deleted => nil )\n render \"resumes/message_show\"\n end", "def get_messages\n unless @connection.mails.empty?\n @connection.each_mail do |msg|\n begin\n process_message(msg.pop)\n rescue\n handle_bogus_message(msg.pop)\n end\n # Delete message from server\n msg.delete\n end\n end\n end", "def actual_received_count\n actual_messages.size\n end", "def loop_message_five_times(mssg)\n count = 0\n while count < 5 do\n puts mssg\n count += 1\n end\nend", "def send_welcome_email\n subscription = self.subscription\n parent_no_valids = ParentNoValid.where(subscription: subscription)\n parent_no_valids.each do |parent_no_valid|\n ParentNoValidMailer.welcome(parent_no_valid).deliver_now\n end\n end", "def upd_folder_size\n \n @t1 = Thread.new{ \n \n @time_samples = []\n \n puts \"in upd_folder_size...\"\n prev_size = 0\n loop {\n puts \"in loop each 2 secs\"\n this_size = 0\n @fen_d.children.each { |pn|\n this_size += (pn.size? || 0) if pn.file?\n }\n @time_samples << (this_size - prev_size).abs\n puts \"upd, @time_samples: #{@time_samples.inspect}\"\n sleep @sleep_sample\n prev_size = this_size\n }\n\n }\n \n end", "def upd_folder_size\n \n @t1 = Thread.new{ \n \n @time_samples = []\n \n puts \"in upd_folder_size...\"\n prev_size = 0\n loop {\n puts \"in loop each 2 secs\"\n this_size = 0\n @fen_d.children.each { |pn|\n this_size += (pn.size? || 0) if pn.file?\n }\n @time_samples << (this_size - prev_size).abs\n puts \"upd, @time_samples: #{@time_samples.inspect}\"\n sleep @sleep_sample\n prev_size = this_size\n }\n\n }\n \n end", "def send_email(gmail, body, mail_address)\n\n body_content = body\n mail_address = mail_address\n gmail = gmail\n\n gmail.deliver do\n to mail_address\n\n subject \"[Presentation] - The Hacking Project - Formation d'informatique gratuite\"\n html_part do\n content_type 'text/html; charset=UTF-8'\n body body_content\n end\n puts \"mail sent to #{mail_address}\"\n #in order to stay below the 10 mail / sec limit\n sleep(1)\n\n end\nend", "def enquiries\n messages = CustomMessage.includes(:sent_messageable, :documentable).where(received_messageable: @user, ancestry:nil)\n messages = messages.limit(params[:limit])\n\n if messages\n @message_parents = messages\n else\n @object = \"Message\"\n render \"api/v1/errors/404\", status: 404\n end\n end", "def get_messages\n @connection.select('INBOX')\n @connection.search(['ALL']).each do |message_id|\n msg = @connection.fetch(message_id,'RFC822')[0].attr['RFC822']\n begin\n process_message(msg)\n rescue\n handle_bogus_message(msg)\n end\n # Mark message as deleted \n @connection.store(message_id, \"+FLAGS\", [:Deleted])\n end\n end", "def content_size; @message_impl.getContentSize; end", "def mails\n\n begin\n @imap = WmailImapUtils.current_imap\n \n if not @imap.blank?\n @mailbox = params['mailbox']\n @min = params['min'].to_i\n @max = params['max'].to_i\n @total = params['total'].to_i\n\n @imap.select(@mailbox)\n @mails = @imap.fetch(@total-@max..@total-@min, 'ENVELOPE')\n @unseen_flags = @imap.search(['NOT','SEEN'])\n end\n rescue\n redirect_to authenticate_wmail_accounts_path(:redirect => messages_mailbox_path(:label => selected_label)),\n :alert => 'Connection Lost. Please login to your account'\n end\n end", "def load(number_of_messages)\n loaded_messages = count_loaded_messages\n while loaded_messages < number_of_messages\n message_thread = find_message_thread\n item = check_and_find_first(message_thread, message_thread_elements_css, wait: 5)\n scroll_up_to(item)\n sleep(4)\n return loaded_messages if loaded_messages == count_loaded_messages\n\n loaded_messages = count_loaded_messages\n end\n loaded_messages\n end", "def thread(messages)\n # create id_table\n @id_table = create_id_table(messages)\n\n # create root hierachy siblings out of containers with zero children\n # TODO: would probably be nicer to use a list instead of empty root node\n root = Container.new()\n @id_table.each_pair { |message_id, container| root.add_child(container) if container.parent.nil? }\n \n # discard id_table\n @id_table = nil\n\n # prune dummy containers\n prune_empty_containers(root)\n\n # group again this time use Subject only\n #subject_table = group_root_set_by_subject(root)\n\n root\n end", "def new\n @currentname = MUser.find_by(\"user_id=?\", params[:clickuser_id])\n clickuser @currentname\n TDirmessage.where(\"receiver_user_id=? and sender_user_id=? and dirworkspace_id=?\", session[:user_id], params[:clickuser_id], session[:workspace_id]).update_all(is_read: false)\n main\n @message = TDirmessage.select(\"m_users.user_id,m_users.user_name,t_dirmessages.dir_message,t_dirmessages.dirmsg_id,t_dirmessages.created_at,t_dirmessages.dirmsg_id,t_dirmessages.count\")\n .joins(\"join m_users on t_dirmessages.sender_user_id = m_users.user_id\")\n .where(\"((receiver_user_id=? and sender_user_id=?) or (receiver_user_id=? and sender_user_id=?))\", session[:user_id], params[:clickuser_id], params[:clickuser_id], session[:user_id]).order(\"created_at ASC\")\n @dstar = TDirmessage.select(\"t_directstars.stardimsg_id\")\n .joins(\"join t_directstars on t_directstars.stardimsg_id=t_dirmessages.dirmsg_id\")\n .where(\"dirworkspace_id=? and t_directstars.star_userid=?\", session[:workspace_id], session[:user_id])\n @array = Array.new\n @dstar.each { |r|\n @array.push(r.stardimsg_id)\n }\n @message.each { |thread|\n @thredcount = HDirmessageReply.select(\"*\")\n .joins(\"join t_dirmessages on t_dirmessages.dirmsg_id=h_dirmessage_replies.dirmsg_id\")\n .where(\"h_dirmessage_replies.dirmsg_id=?\", thread.dirmsg_id)\n thread.count = @thredcount.size\n }\n #@pubarray = Array.new\n #@m_channel.each { |r|\n #@pubarray.push(r.channel_name)\n #}\n #@public_channel_list = MChannel.select(\"distinct m_channels.channel_name,m_channels.channel_id\")\n #.joins(\"join m_workspaces on m_workspaces.workspace_id = m_channels.workspace_id\")\n #.where(\" m_channels.status=1 and m_workspaces.workspace_id=? and m_channels.user_id!=?\", session[:workspace_id], session[:user_id])\n #@dirmsg_original = TDirmessage.select(\"m_users.user_name,t_dirmessages.count,t_dirmessages.dirmsg_id,t_dirmessages.dir_message,t_dirmessages.created_at\")\n #.joins(\"join m_users on m_users.user_id=t_dirmessages.sender_user_id\")\n #.where(\"t_dirmessages.dirmsg_id=?\", session[:dirthread_id]).order(\"t_dirmessages.created_at ASC\")\n #@dirthread_msg = HDirmessageReply.select(\"m_users.user_name,h_dirmessage_replies.dirmsg_id,h_dirmessage_replies.dirthread_msg,h_dirmessage_replies.created_at\")\n #.joins(\"join m_users on m_users.user_id=h_dirmessage_replies.reply_user_id\")\n #.where(\"h_dirmessage_replies.dirmsg_id=? and h_dirmessage_replies.reply_user_id=?\", session[:dirthread_id], session[:user_id]).order(\"h_dirmessage_replies.created_at ASC\")\n #@dirmsg_original.each { |thread|\n #@thredcount = HDirmessageReply.select(\"*\")\n #.joins(\"join t_dirmessages on t_dirmessages.dirmsg_id=h_dirmessage_replies.dirmsg_id\")\n #.where(\"h_dirmessage_replies.dirmsg_id=?\", thread.dirmsg_id)\n #thread.count = @thredcount.size\n #}\n\n end", "def get_messages\n @connection.search(@filter).each do |message|\n body = @connection.fetch(message, \"RFC822\")[0].attr[\"RFC822\"]\n begin\n @processor.process(body)\n rescue StandardError => error\n Mailman.logger.error \"Error encountered processing message: #{message.inspect}\\n #{error.class.to_s}: #{error.message}\\n #{error.backtrace.join(\"\\n\")}\"\n next\n end\n @connection.store(message, \"+FLAGS\", @done_flags)\n end\n # Clears messages that have the Deleted flag set\n @connection.expunge\n end", "def show\n @messages = @discussion.messages.where(\"discussion_id = ?\", @discussion.id).order(created_at: :asc).last(5)\n @messages_count = @discussion.messages.count\n end", "def nlst(msg) # :yields: nil\n Dir[\"*\"].join \" \" \n end", "def index\n @inbox = Email.to(@user.name)\n process_incoming(@inbox)\n @sent = Email.from(@user.name)\n end", "def find_folders(options={}, &block)\n options[:mailbox] ||= ''\n options[:count] ||= :all\n\n options = validate_options(options)\n mailbox = options[:mailbox] || ''\n mailbox = Net::IMAP.encode_utf7(mailbox)\n mailbox = mailbox.empty? ? '*' : \"#{mailbox}/*\"\n include = options[:include] ||= '*'\n exclude = options[:exclude] ||= nil\n include_flags = options[:include_flags] ||= nil\n exclude_flags = options[:exclude_flags] ||= [:Noselect, :All, :Drafts, :Important, :Junk, :Flagged, :Trash]\n\n start do |imap|\n info \"find_folders block\"\n info \"imap.lsub/list #{mailbox}\"\n boxes = options[:subscribed] ? imap.lsub('', mailbox) : imap.list('', mailbox)\n boxes.replace(options[:what].to_sym == :last ? boxes.last(options[:count]) : boxes.first(options[:count])) if options[:count].is_a?(Integer)\n\n if block_given?\n boxes.each do |box|\n name = Net::IMAP.decode_utf7(box.name)\n flags = box.attr ? box.attr.map{|e| e.to_s.downcase.to_sym} : nil\n next if match_folder(name, exclude) || match_folder_flags(flags, exclude_flags)\n next unless match_folder(name, include) || match_folder_flags(flags, include_flags)\n info \"imap.status #{box.name} #{[\"MESSAGES\", \"UNSEEN\", \"UIDVALIDITY\", \"UIDNEXT\"]}\"\n status = imap.status(box.name, [\"MESSAGES\", \"UNSEEN\", \"UIDVALIDITY\", \"UIDNEXT\"])\n yield Folder.new(name, delim: box.delim, flags: flags, messages: status['MESSAGES'], unseen: status['UNSEEN'], validity: status['UIDVALIDITY'], next: status['UIDNEXT'])\n end unless boxes.nil?\n else\n folders = []\n boxes.each do |box|\n name = Net::IMAP.decode_utf7(box.name)\n flags = box.attr ? box.attr.map{|e| e.to_s.downcase.to_sym} : nil\n next if match_folder(name, exclude) || match_folder_flags(flags, exclude_flags)\n next unless match_folder(name, include) || match_folder_flags(flags, include_flags)\n info \"imap.status #{box.name} #{[\"MESSAGES\", \"UNSEEN\", \"UIDVALIDITY\", \"UIDNEXT\"]}\"\n status = imap.status(box.name, [\"MESSAGES\", \"UNSEEN\", \"UIDVALIDITY\", \"UIDNEXT\"])\n folders << Folder.new(name, delim: box.delim, flags: flags, messages: status['MESSAGES'], unseen: status['UNSEEN'], validity: status['UIDVALIDITY'], next: status['UIDNEXT'])\n end unless boxes.nil?\n folders.size == 1 && options[:count] == 1 ? folders.first : folders\n end\n end\n end" ]
[ "0.60687375", "0.5973583", "0.58890414", "0.58464164", "0.57725275", "0.57662296", "0.57595015", "0.57320666", "0.56180024", "0.5595161", "0.5556608", "0.55356663", "0.5535499", "0.5496299", "0.5449656", "0.54237795", "0.5350977", "0.5295367", "0.52566683", "0.52468854", "0.52389973", "0.52163756", "0.5190178", "0.5175494", "0.51696736", "0.5160555", "0.5152628", "0.5150634", "0.5141114", "0.5137205", "0.51346153", "0.5129255", "0.5125449", "0.512469", "0.5119482", "0.51037526", "0.51022464", "0.509588", "0.50954044", "0.5092235", "0.5088449", "0.5087476", "0.5083734", "0.5057192", "0.5054663", "0.50474954", "0.50474954", "0.5043553", "0.5038359", "0.50371414", "0.5024093", "0.50145864", "0.5014156", "0.50051755", "0.49920598", "0.4990238", "0.49901402", "0.49899986", "0.4986261", "0.49828783", "0.4978604", "0.49781308", "0.49652615", "0.49599603", "0.49599603", "0.4932011", "0.49316555", "0.49287957", "0.49242765", "0.49203303", "0.49177966", "0.49177164", "0.49175185", "0.4912632", "0.49112886", "0.4906431", "0.49043265", "0.4898183", "0.4893594", "0.489233", "0.48921993", "0.4883962", "0.48806366", "0.48716238", "0.48584196", "0.48483863", "0.48483863", "0.484774", "0.48466218", "0.48428643", "0.4835586", "0.4833856", "0.48306304", "0.48271883", "0.48269126", "0.4819559", "0.48182857", "0.48106843", "0.48009822", "0.47964153" ]
0.73914623
0
Attach the work to a collection
def attach_work_to_collection(work,collection) attached = true collection.reindex_extent = Hyrax::Adapters::NestingIndexAdapter::LIMITED_REINDEX begin work.member_of_collections << collection work.save! rescue StandardError => e attached = false end attached end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attach_to_work(work, file_set_params = {})\n acquire_lock_for(work.id) do\n # Ensure we have an up-to-date copy of the members association, so that we append to the end of the list.\n work.reload unless work.new_record?\n file_set.visibility = work.visibility unless assign_visibility?(file_set_params)\n work.ordered_members << file_set\n work.representative = file_set if work.representative_id.blank?\n work.thumbnail = file_set if work.thumbnail_id.blank?\n # Save the work so the association between the work and the file_set is persisted (head_id)\n # NOTE: the work may not be valid, in which case this save doesn't do anything.\n work.save\n Hyrax.config.callback.run(:after_create_fileset, file_set, user, warn: false)\n end\n end", "def attach_to_work(work, file_set_params = {})\n acquire_lock_for(work.id) do\n # Ensure we have an up-to-date copy of the members association, so that we append to the end of the list.\n work.reload unless work.new_record?\n file_set.visibility = work.visibility unless assign_visibility?(file_set_params)\n work.ordered_members << file_set\n # heliotrope change: don't assign representative_id and thumbnail_id\n # work.representative = file_set if work.representative_id.blank?\n # work.thumbnail = file_set if work.thumbnail_id.blank?\n # Save the work so the association between the work and the file_set is persisted (head_id)\n # NOTE: the work may not be valid, in which case this save doesn't do anything.\n work.save\n Hyrax.config.callback.run(:after_create_fileset, file_set, user)\n end\n end", "def attach_file_to_work(work, file_set_params = {})\n acquire_lock_for(work.id) do\n # Ensure we have an up-to-date copy of the members association, so that we append to the end of the list.\n work.reload unless work.new_record?\n ## move next four statements to update_work_with_file_set\n #copy_visibility(work, file_set) unless assign_visibility?(file_set_params)\n #work.ordered_members << file_set\n #set_representative(work, file_set)\n #set_thumbnail(work, file_set)\n update_work_with_file_set( work, file_set, file_set_params )\n # Save the work so the association between the work and the file_set is persisted (head_id)\n # NOTE: the work may not be valid, in which case this save doesn't do anything.\n work.save\n end\n end", "def attach_file_to_work(work, file_set, file_set_params)\n acquire_lock_for(work.id) do\n # Ensure we have an up-to-date copy of the members association, so\n # that we append to the end of the list.\n work.reload unless work.new_record?\n unless assign_visibility?(file_set_params)\n copy_visibility(work, file_set)\n end\n work.ordered_members << file_set\n set_representative(work, file_set)\n set_thumbnail(work, file_set)\n\n # Save the work so the association between the work and the file_set is persisted (head_id)\n work.save\n end\n end", "def attach_ordered_members_to_work(work)\n acquire_lock_for(work.id) do\n work.ordered_members = ordered_members\n work.save\n ordered_members.each do |file_set|\n Hyrax.config.callback.run(:after_create_fileset, file_set, user, warn: false)\n end\n end\n end", "def attach_to_work(work, file_set_params = {})\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"work.id=#{work.id}\",\n \"file_set_params=#{file_set_params}\",\n \"\" ] if file_set_ordered_ordered_members_actor_debug_verbose\n file_set.visibility = work.visibility unless assign_visibility?(file_set_params)\n work.representative = file_set if work.representative_id.blank?\n work.thumbnail = file_set if work.thumbnail_id.blank?\n end", "def attach_to_work( work, file_set_params = {}, uploaded_file_id: nil )\n Deepblue::LoggingHelper.bold_debug [ Deepblue::LoggingHelper.here,\n Deepblue::LoggingHelper.called_from,\n \"work.id=#{work.id}\",\n \"file_set_params=#{file_set_params}\" ]\n acquire_lock_for( work.id ) do\n # Ensure we have an up-to-date copy of the members association, so that we append to the end of the list.\n work.reload unless work.new_record?\n file_set.visibility = work.visibility unless assign_visibility?(file_set_params)\n work.ordered_members << file_set\n work.representative = file_set if work.representative_id.blank?\n work.thumbnail = file_set if work.thumbnail_id.blank?\n # Save the work so the association between the work and the file_set is persisted (head_id)\n # NOTE: the work may not be valid, in which case this save doesn't do anything.\n work.save\n Deepblue::UploadHelper.log( class_name: self.class.name,\n event: \"attach_to_work\",\n id: file_set.id,\n uploaded_file_id: uploaded_file_id,\n work_id: work.id,\n work_file_set_count: work.file_set_ids.count )\n Hyrax.config.callback.run(:after_create_fileset, file_set, user)\n end\n rescue Exception => e # rubocop:disable Lint/RescueException\n Rails.logger.error \"#{e.class} work.id=#{work.id} -- #{e.message} at #{e.backtrace[0]}\"\n Deepblue::LoggingHelper.bold_debug [ Deepblue::LoggingHelper.here,\n Deepblue::LoggingHelper.called_from,\n \"ERROR\",\n \"e=#{e.class.name}\",\n \"e.message=#{e.message}\",\n \"e.backtrace:\" ] +\n e.backtrace\n Deepblue::UploadHelper.log( class_name: self.class.name,\n event: \"attach_to_work\",\n event_note: \"failed\",\n id: work.id,\n uploaded_file_id: uploaded_file_id,\n work_id: work.id,\n exception: e.to_s,\n backtrace0: e.backtrace[0] )\n end", "def add_work(&bl)\n pool.post &bl\n end", "def attach; end", "def assign_nested_attributes_for_collection(env, attributes_collection)\n return true unless attributes_collection\n attributes_collection = attributes_collection.sort_by { |i, _| i.to_i }.map { |_, attributes| attributes }\n # checking for existing works to avoid rewriting/loading works that are\n # already attached\n existing_works = env.curation_concern.member_ids\n attributes_collection.each do |attributes|\n next if attributes['id'].blank?\n if existing_works.include?(attributes['id'])\n remove(env.curation_concern, attributes['id']) if has_destroy_flag?(attributes)\n else\n add(env, attributes['id'])\n end\n end\n end", "def assign_nested_attributes_for_collection(env, attributes_collection)\n return true unless attributes_collection\n attributes_collection = attributes_collection.sort_by { |i, _| i.to_i }.map { |_, attributes| attributes }\n # checking for existing works to avoid rewriting/loading works that are\n # already attached\n existing_works = env.curation_concern.member_ids\n attributes_collection.each do |attributes|\n next if attributes['id'].blank?\n if existing_works.include?(attributes['id'])\n remove(env.curation_concern, attributes['id']) if has_destroy_flag?(attributes)\n else\n add(env, attributes['id'])\n end\n end\n end", "def add_members_to_collection collection = nil\n collection ||= @collection\n collection.member_ids = batch.concat(collection.member_ids)\n collection.save\n batch.each do |id|\n begin\n member = ActiveFedora::Base.find(id)\n rescue\n end\n if collection.is_community?\n # \"target is a community, add to belongsToCommunity\"\n add_member_to_community(member, collection)\n if member.instance_of? Collection\n # \"member is a collection, make all children inherit belongsToCommunity\"\n member.materialized_members.each do |o|\n add_member_to_community(o, collection)\n end\n end\n end\n\n if member.respond_to? :hasCollection\n # \"member is a file, add the target collection id to hasCollection\"\n add_file_to_collection(member, collection)\n end\n\n if collection.belongsToCommunity?\n # \"if the target collection has community, the children added should inherit its belongsToCommunity\"\n belongsToCommunity = collection.belongsToCommunity + member.belongsToCommunity\n member.belongsToCommunity = belongsToCommunity\n member.save\n end\n end\n end", "def assign_collection\n source, collection = get_source_and_collection\n collection.updatable_by?(current_user) || raise(Hobo::PermissionDeniedError, \"#{self.class.name}#assign_collection\")\n collection.real_source << source unless(collection.real_source.include?(source))\n collection.save!\n end", "def append_to(collection)\n raise \"#{self.name}#append_to not implemented\"\n end", "def assign_nested_attributes_for_collection( env, attributes_collection )\n return true if attributes_blank? attributes_collection\n return true unless env.curation_concern.respond_to? :provenance_child_add\n attributes_collection = attributes_collection.sort_by { |i, _| i.to_i }.map { |_, attributes| attributes }\n # checking for existing works to avoid rewriting/loading works that are already attached\n existing_works = env.curation_concern.member_ids\n current_user = env.user\n attributes_collection.each do |attributes|\n next if attributes['id'].blank?\n if existing_works.include?( attributes['id'] )\n remove( env, attributes['id'], current_user ) if has_destroy_flag?( attributes )\n else\n add( env, attributes['id'], current_user )\n end\n end\n end", "def assign_nested_attributes_for_collection_association association_name, attributes_collection\n return if attributes_collection.nil?\n\n associate_existing_records(association_name, attributes_collection)\n\n super\n end", "def collection_approve(work, collection)\n work.collection_items.each do |ci|\n next unless ci.collection == collection\n ci.update_attribute(:collection_approval_status, CollectionItem::APPROVED)\n ci.update_attribute(:user_approval_status, CollectionItem::APPROVED)\n ci.save\n end\n end", "def assign_nested_attributes_for_collection(env, attributes_collection)\n return true unless attributes_collection\n\n attributes = extract_attributes(attributes_collection)\n cast_concern = !env.curation_concern.is_a?(Valkyrie::Resource)\n resource = cast_concern ? env.curation_concern.valkyrie_resource : env.curation_concern\n inserts, destroys = split_inserts_and_destroys(attributes, resource)\n\n # short circuit to avoid casting unnecessarily\n return true if destroys.empty? && inserts.empty?\n # we fail silently if we can't insert the object; this is for legacy\n # compatibility\n return true unless check_permissions(ability: env.current_ability,\n inserts: inserts,\n destroys: destroys)\n update_members(resource: resource, inserts: inserts, destroys: destroys)\n\n return true unless cast_concern\n env.curation_concern = Hyrax.metadata_adapter\n .resource_factory\n .from_resource(resource: resource)\n\n # # checking for existing works to avoid rewriting/loading works that are\n # # already attached\n # existing_works = env.curation_concern.member_ids\n # attributes_collection.each do |attributes|\n # next if attributes['id'].blank?\n # if existing_works.include?(attributes['id'])\n # remove( env, env.curation_concern, attributes['id']) if has_destroy_flag?(attributes)\n # else\n # add(env, attributes['id'])\n # end\n # end\n end", "def create_collections\n self.collections.each do |c|\n self.add_collection(c)\n end\n end", "def collection(new_collection)\n self.collection_key = new_collection\n end", "def compose new_collection, *collections, &block\n @@graph.add(new_collection, collections, operation: :compose, &block)\n end", "def add_common_work common_work\n CatalogsCommonWorks.where(catalog_id: self.id, common_work_id: common_work.id)\n .first_or_create(catalog_id: self.id, common_work_id: common_work.id)\n \n common_work.recordings.each do |recording|\n self.attach_recording recording\n end\n end", "def add_note_collection(upload_id)\n upload = Upload.find(upload_id.to_i)\n \n if not @collection.uploads.include?(upload)\n @collection.uploads << upload\n end\n end", "def set_collection(coll)\n set_collection_ivar(coll)\n end", "def set_collection\n @collection = Collection.find(params[:id])\n end", "def set_collection\n @collection = Collection.find(params[:id])\n end", "def set_collection\n @collection = Collection.find(params[:id])\n end", "def set_collection\n @collection = Collection.find(params[:id])\n end", "def make_collection\n @resource.make_collection\n end", "def add_items(items,coll)\n items.each {|item| coll.collection_highlight_items << CollectionHighlightItem.create(item_id:\"#{item}\")}\nend", "def set_collection\n @collection = Collection.find(params[:id])\n end", "def set_collection\n @collection = Collection.find(params[:id])\n end", "def store_in(name)\n self.collection_name = name.to_s\n set_collection\n end", "def store_in(name)\n self.collection_name = name.to_s\n set_collection\n end", "def set_post_with_collection\n @post_with_collection = PostWithCollection.find(params[:id])\n end", "def set_collection(collection)\n Loggging.log.debug \"action set_collection: name = #{self.get_name}, version = #{self.get_version}, action_name = #{self.get_action_name}\"\n if !(collection.is_a? Array)\n raise TypeError.new(\"Collection must be a list or array\")\n end\n collection.each do |entity|\n if !(entity.is_a? Hash)\n raise TypeError.new(\"Entity must be an dict o hash\")\n end\n end\n\t\[email protected]_value(\"data\",\n @gateway[1],\n self.get_name,\n self.get_version,\n self.get_action_name,\n collection)\n return self\n end", "def save_collection(obj)\n original_collections << [obj, obj.dup]\n end", "def set_collection\n @collection = Collection.find(params[:id])\n end", "def set_collection\n @collection = Collection.find(params[:id])\n end", "def set_collection\n @collection = Collection.find(params[:id])\n end", "def instantiate_collection(collection)\n collection.collect! { |record| instantiate_record(record) }\n end", "def set_collection\n @collection = Collection.find(params[:collection_id])\n end", "def update\n @collection = Collection.find(params[:id])\n \n #Parent collection stuff\n parent_child_violation = false\n access_violation = false\n if params.include?(\"collection\") and params[:collection].include?(\"parent_id\") and params[:collection][\"parent_id\"] != \"\"\n parent_collection = Collection.find(params[:collection][\"parent_id\"])\n \n if (parent_collection.user_id != @collection.user_id)\n access_violation = true\n \n else\n #if !collection_is_parent(@collection, parent_collection)\n if !parent_collection.ancestors.include?(@collection)\n @collection.parent_id = parent_collection.id\n \n #inherits project (and permissions) of parent by default\n inherit_collection(parent_collection)\n else\n parent_child_violation = true\n end\n end #if parent\n end #if params\n \n #Update\n #do this now, so the spawn doesn't PG:Error b/c spawned code has locked @colllection\n update_collection_attrs_suc = false\n if (not parent_child_violation and not access_violation)\n update_collection_attrs_suc = @collection.update_attributes(params[:collection])\n end\n\n #Validation\n if (params.include?(\"post\") and params[:post].include?(\"ifilter_id\") and params[:post][:ifilter_id] != \"\" )\n f = get_ifilter( params[:post][:ifilter_id].to_i )\n\n validate_collection_helper(@collection, f)\n end\n \n #Add metadata from a metaform\n if (params.include?(\"post\") and params[:post].include?(\"metaform_id\") and params[:post][:metaform_id] != \"\" )\n add_collection_metaform(@collection, params[:post][:metaform_id].to_i)\n end\n\n #Add to my project\n if (params.include?(\"proj\") and params[:proj].include?(\"id\") and params[:proj][:id] != \"\" )\n project = Project.find( params[:proj][:id] )\n add_project_col(project, @collection) #call to collection helper, adds collection to project\n end\n \n #Add selected upload as a note to the collection\n if (params.include?(\"note\") and params[\"note\"].include?(\"upload_id\") and (!params[\"note\"][\"upload_id\"].blank?) )\n add_note_collection( params[\"note\"][\"upload_id\"] )\n end\n\n if (params.include?(\"remove_ids\") and (!params[\"remove_ids\"].blank?) )\n remove_notes_collection( params[\"remove_ids\"] ) #Remove notes\n end\n\n=begin\n #Add to other project (as editor)\n if (params.include?(\"ed_proj\") and params[:ed_proj].include?(\"pro_id\") and params[:ed_proj][:pro_id] != \"\" )\n project = Project.find( params[:ed_proj][:pro_id] )\n add_project_col(project, @collection) #from collection helper\n end\n=end\n #Recursive remove from project\n if params.include?(\"remove_project\")\n params[\"remove_project\"].each do |k,v|\n if v.to_i == 1\n project = Project.find(k.to_i)\n @collection.projects.delete project\n @collection.descendants.each do |c|\n if !c.projects.empty?\n c.projects.delete project\n end\n end\n end\n end\n end\n\n respond_to do |format|\n if access_violation\n @collection.errors.add(:base, \"You are not authorized to do that.\")\n format.html { render action: \"edit\" }\n elsif parent_child_violation \n #flash[:error] = \"Warning: cannot set parent collection to a child.\"\n @collection.errors.add(:base, \"Cannot set parent collection to a child.\")\n format.html { render action: \"edit\" }\n elsif update_collection_attrs_suc\n format.html { redirect_to edit_collection_path(@collection), notice: 'Collection was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def perform_post_with_objects_from_collection(path, options, klass, collection_name)\n perform_request_with_objects_from_collection(:post, path, options, klass, collection_name)\n end", "def set_collection\n @collection = Collection.find_by_friendlier_id!(params[:id])\n end", "def set_collection\n @collection = Collection.friendly.find params[:id]\n end", "def prepare_collection!(_wrapper, _element, _options)\n end", "def add_collection_with_ems_param(builder_class, collection_name, extra_properties = {}, settings = {})\n add_collection(builder_class, collection_name, extra_properties, settings) do |builder|\n ems_builder_param(builder)\n\n yield builder if block_given?\n end\n end", "def add(*items)\n notify_will_change! if items.count > 0\n items.each do |item|\n collection.push item\n end\n @collection\n end", "def add_project_col(project, collection)\n #Add this collection to the project\n if !project.collections.collect {|pc| pc.id}.include?(collection.id)\n project.collections << collection\n #add_owner(project, collection) #not finished\n end\n\n #Add this collection's descendants to the project\n collection.descendants.each do |c|\n if !project.collections.collect {|pc| pc.id}.include?(c.id)\n project.collections << c\n end\n end\n\n project.save\n end", "def assign_nested_attributes_for_collection(env, attributes_collection)\n return true unless attributes_collection\n\n attributes = extract_attributes(attributes_collection)\n cast_concern = !env.curation_concern.is_a?(Valkyrie::Resource)\n resource = cast_concern ? env.curation_concern.valkyrie_resource : env.curation_concern\n inserts, destroys = split_inserts_and_destroys(attributes, resource)\n\n # short circuit to avoid casting unnecessarily\n return true if destroys.empty? && inserts.empty?\n # we fail silently if we can't insert the object; this is for legacy\n # compatibility\n return true unless check_permissions(ability: env.current_ability,\n inserts: inserts,\n destroys: destroys)\n\n update_members(resource: resource, inserts: inserts, destroys: destroys)\n\n return true unless cast_concern\n env.curation_concern = Hyrax.metadata_adapter\n .resource_factory\n .from_resource(resource: resource)\n end", "def set_collection\n @collection = Collection.friendly.find(params[:id])\n end", "def call(change_set, collection_ids: [])\n change_set.member_of_collection_ids += collection_ids\n\n Success(change_set)\n end", "def attach(attachment)\n if attachment_ids\n self.attachment_ids |= [attachment.id] if attachment_ids.size < MAX_ATTACHMENTS\n else\n self.attachment_ids = [attachment.id]\n end\n self.joined_attachments << attachment\n end", "def save_collection(obj)\n\t original_collections << [obj, obj.dup]\n\tend", "def <<(work)\n @work_queue.push work\n end", "def set_collection(options = {})\n self._collection = Collection.new(self, self.collection_name, options)\n end", "def perform_put_with_objects_from_collection(path, options, klass, collection_name)\n perform_request_with_objects_from_collection(:put, path, options, klass, collection_name)\n end", "def attach!(attachment)\n ids_method, association_method = if attachment.is_a?(User)\n ['assignee_ids', 'assignees']\n else\n [\"#{attachment.class.name.downcase}_ids\", attachment.class.name.tableize]\n end\n\n unless self.send(ids_method).include?(attachment.id)\n self.send(association_method) << attachment\n end\n end", "def set_shared_collection\n @shared_collection = SharedCollection.find(params[:id])\n end", "def <<(work)\n # TODO option to increase worker threads if work queue gets saturated\n @work_queue.push work\n self\n end", "def preload(collection)\n collection\n end", "def initialize(collection)\n @collection = collection\n end", "def auto_collect(what, options = {})\n options[:annotation] ||= I18n.t(:user_left_comment_on_date, :username => current_user.full_name,\n :date => I18n.l(Time.now, :format => :long))\n watchlist = current_user.watch_collection\n collection_item = CollectionItem.find_by_collection_id_and_object_id_and_object_type(watchlist.id, what.id,\n what.class.name)\n if collection_item.nil?\n collection_item = begin # No care if this fails.\n CollectionItem.create(:annotation => options[:annotation], :object => what, :collection_id => watchlist.id)\n rescue => e\n logger.error \"** ERROR COLLECTING: #{e.message} FROM #{e.backtrace.first}\"\n nil\n end\n if collection_item && collection_item.save\n return unless what.respond_to?(:summary_name) # Failsafe. Most things should.\n flash[:notice] ||= ''\n flash[:notice] += ' '\n flash[:notice] += I18n.t(:item_added_to_watch_collection_notice,\n :collection_name => self.class.helpers.link_to(watchlist.name,\n collection_path(watchlist)),\n :item_name => what.summary_name)\n CollectionActivityLog.create(:collection => watchlist, :user => current_user,\n :activity => Activity.collect, :collection_item => collection_item)\n end\n end\n end", "def collect(options = {})\n Remote::CollectionJob.create(options.merge(:feed_id => self.id))\n end", "def set_item_collection\n @item_collection = ItemCollection.find(params[:id])\n end", "def set_collection\n self._collection = Mongoid::Collection.new(self, self.collection_name)\n end", "def build_collection(c_hsh)\n title = c_hsh['title']\n desc = c_hsh['desc']\n col = Collection.new(title: title, description: desc, creator: Array(user_key))\n col.apply_depositor_metadata(user_key)\n\n # Build all the works in the collection\n works_info = Array(c_hsh['works'])\n c_works = works_info.map{|w| build_work(w)}\n\n # Add each work to the collection\n c_works.each{|cw| col.members << cw}\n\n col.save!\n end", "def perform_post_with_object_from_collection(path, options, klass, collection_name)\n perform_request_with_object_from_collection(:post, path, options, klass, collection_name)\n end", "def collection\n @collection ||= participatory_processes\n end", "def set_data_collection\n @data_collection = DataCollection.find(params[:id])\n end", "def setup #:nodoc:\n params = self.params\n input_collection = FileCollection.find(params[:collection_id])\n self.results_data_provider_id ||= input_collection.data_provider_id\n input_collection.sync_to_cache\n \n safe_symlink(input_collection.cache_full_path.to_s, input_collection.name)\n \n true\n end", "def create(collection, entity)\n @mutex.synchronize do\n entity.id = command(collection).create(entity)\n entity\n end\n end", "def initialize(collection)\n @collection = collection\n end", "def prepare\n puts \"Populating #{@collection} with #{@options.documents} documents\"\n @mq.populate_collection(@options.documents)\n end", "def insert\n Thread.current[:\"[mongoid]:insert-consumer\"]\n end", "def insert\n Thread.current[:\"[mongoid]:insert-consumer\"]\n end", "def insert\n Thread.current[:\"[mongoid]:insert-consumer\"]\n end", "def store_in(name, options = {})\n self.collection_name = name.to_s\n set_collection(options)\n end", "def initialize\n @coll = self.class.collection\n end", "def collection\n @collection ||= load_collection\n end", "def add(tasks)\n tasks.each do |task|\n iter = @model.append()\n self.set(iter, task)\n end\n @tasks += tasks\n end", "def work\n\t\tsuper\n\t\t@link = @work\n\tend", "def create\n attrs = create_attributes\n @object = klass.new\n object.reindex_extent = Hyrax::Adapters::NestingIndexAdapter::LIMITED_REINDEX\n run_callbacks :save do\n run_callbacks :create do\n klass == Collection ? create_collection(attrs) : work_actor.create(environment(attrs))\n end\n end\n log_created(object)\n end", "def update_collections_for(user, collections, options = {})\n not_owned_collection = collections.find { |c| not c.owned_by?(user) }\n if not_owned_collection\n raise Exception.new(\"Tried to save listing to collection #{not_owned_collection.id}, which is not owned by user #{user.id}\")\n end\n already_saved_collections = self.collections_owned_by(user)\n to_save_collections = collections - already_saved_collections\n to_remove_collections = already_saved_collections - collections\n self.class.transaction do\n self.collections += to_save_collections\n self.collections -= to_remove_collections\n @saves_count = nil\n end\n end", "def attach(source); end", "def set_collection_post\n @collection_post = CollectionPost.find(params[:id])\n end", "def add_collections_and_works(new_member_ids, valkyrie: false)\n ### TODO: Change to do this through Valkyrie. Right now using existing AF method to get multi-membership check.\n af_self = Wings::ActiveFedoraConverter.new(resource: self).convert\n af_ids = valkyrie ? Wings::IdConverterService.convert_to_active_fedora_ids(new_member_ids) : new_member_ids\n af_self.add_member_objects(af_ids)\n end", "def initialize\n @collection = []\n end", "def rebuild_document_collection()\n end", "def update!(**args)\n @collection = args[:collection] if args.key?(:collection)\n end", "def add_to_collection\n\n if request.post?\n # Actually add the item to the collection\n ids = request.params[:id].split(',')\n ids.each do |id|\n add_to_collection_action(request.params[:collection], id)\n end\n\n # Don't render the default \"Add to Collection\" dialog - render the \"Success!\" dialog contents\n flash[:success] ||= \"The item has been added to the collection\"\n render 'catalog/add_to_collection_success'\n end\n\n end", "def collection_method name, &block\n collection_methods[name] = block\n end", "def add_to_database\n Partner.add({\"assignment_id\" => \"#{self.assignment_id}\", \"name_worked\" => \"#{self.name_worked}\"})\n end", "def collection\n @collection.is_a?(Proc) ? @collection.call : @collection\n end", "def touch_collection_date\n self.collection.updated_at = DateTime.now()\n self.collection.save\n end", "def initialize\n @collection={}\n end", "def waiver_collection\n run_context.waiver_collection\n end", "def persist_collections!\n upsert_refresh_state_records(:status => :started, :refresh_state_status => :started)\n link_data_to_refresh_state_part\n\n persist!\n send_changes_to_queue!\n send_task_updates_to_queue!\n\n persister.persister_finished_at = Time.now.utc.to_datetime.to_s\n log_refresh_time_tracking(:refresh_state_part)\n\n upsert_refresh_state_records(:status => :finished)\n\n :success\n rescue StandardError => e\n upsert_refresh_state_records(:status => :error, :error_message => e.message.truncate(150))\n\n raise(e)\n end", "def initialize\n @coll=self.class.collection\n end" ]
[ "0.6794248", "0.6728939", "0.6595821", "0.6533343", "0.6373338", "0.62597394", "0.6197687", "0.6012525", "0.5997932", "0.589586", "0.589586", "0.5816458", "0.57911694", "0.57782656", "0.5719103", "0.56780744", "0.5677392", "0.5676644", "0.56722075", "0.5623032", "0.56229496", "0.5532922", "0.5484691", "0.5469093", "0.538928", "0.538928", "0.538928", "0.538928", "0.5386176", "0.5386097", "0.53833973", "0.53833973", "0.53786206", "0.53786206", "0.53781766", "0.5364444", "0.5351353", "0.53462243", "0.53462243", "0.53462243", "0.532911", "0.5322828", "0.53086495", "0.52967954", "0.5285825", "0.5279628", "0.52778596", "0.5269017", "0.5256754", "0.52462375", "0.52416617", "0.5231065", "0.5224513", "0.52209294", "0.5220114", "0.52183455", "0.5208453", "0.52050036", "0.5190082", "0.51850164", "0.5178738", "0.516241", "0.5161126", "0.5148919", "0.5148774", "0.5138319", "0.5128772", "0.5124657", "0.5122508", "0.51157194", "0.5110902", "0.5102573", "0.5101504", "0.50980794", "0.5090342", "0.507505", "0.507505", "0.507505", "0.5070387", "0.50604475", "0.50561213", "0.5055819", "0.50373316", "0.5027273", "0.50151086", "0.500804", "0.50054234", "0.49992025", "0.49979916", "0.49834925", "0.4982319", "0.4978548", "0.49766964", "0.49731296", "0.49712083", "0.49666166", "0.4941374", "0.49411896", "0.49402243", "0.49383044" ]
0.8328691
0
Create a work using the xml parsed
def create_work(xml_metadata) parsed_data = Ingest::Services::MetadataParser.new(xml_metadata, @depositor, @collection, @config).parse work_attributes = parsed_data[:work_attributes] # Create new work record and save new_work = work_record(work_attributes) new_work.save! new_work end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tasks_from_xml( doc )\r\n\r\n # Extract details of every task into a flat array\r\n tasks = []\r\n\r\n logger.error \"DEBUG: BEGIN get_tasks_from_xml\"\r\n\r\n tracker_alias = Setting.plugin_redmine_loader['tracker_alias'].force_encoding \"UTF-8\"\r\n tracker_field_id = nil;\r\n #FIXME Надо проверить как оно работает\r\n doc.each_element( \"Project/ExtendedAttributes/ExtendedAttribute[Alias='#{tracker_alias}']/FieldID\") do | ext_attr |\r\n tracker_field_id = ext_attr.text.to_i;\r\n end\r\n\r\n doc.each_element( 'Project/Tasks/Task' ) do | task |\r\n begin\r\n logger.error \"Project/Tasks/Task found\"\r\n struct = OpenStruct.new\r\n struct.level = task.get_elements( 'OutlineLevel' )[0].text.to_i if task.get_elements('OutlineLevel')[0]\r\n struct.outlinenumber = task.get_elements('OutlineNumber')[0].text.strip if task.get_elements('OutlineNumber')[0]\r\n\r\n if auxString = struct.outlinenumber\r\n index = auxString.rindex('.')\r\n if index\r\n index -= 1\r\n struct.outnum = auxString[0..index]\r\n end\r\n end\r\n\r\n struct.tid = task.get_elements('ID')[0].text.to_i if task.get_elements('ID')[0]\r\n struct.uid = task.get_elements('UID')[0].text.to_i if task.get_elements('UID')[0]\r\n struct.title = task.get_elements('Name')[0].text.strip if task.get_elements('Name')[0]\r\n struct.start = task.get_elements('Start')[0].text.split(\"T\")[0] if task.get_elements('Start')[0]\r\n struct.finish = task.get_elements('Finish')[0].text.split(\"T\")[0] if task.get_elements('Finish')[0]\r\n\r\n s1 = task.get_elements('Start')[0].text.strip if task.get_elements('Start')[0]\r\n s2 = task.get_elements('Finish')[0].text.strip if task.get_elements('Finish')[0]\r\n\r\n task.each_element( \"ExtendedAttribute[FieldID='#{tracker_field_id}']/Value\") do | tracker_value |\r\n struct.tracker_name = tracker_value.text\r\n end\r\n\r\n # If the start date and the finish date are the same it is a milestone\r\n struct.milestone = (s1 == s2) ? 1 : 0\r\n\r\n struct.percentcomplete = task.get_elements( 'PercentComplete')[0].text.to_i\r\n struct.notes = task.get_elements( 'Notes' )[ 0 ].text.strip if task.get_elements( 'Notes' )[0]\r\n struct.predecessors = []\r\n struct.delays = []\r\n task.each_element( 'PredecessorLink' ) do | predecessor |\r\n begin\r\n struct.predecessors.push( predecessor.get_elements('PredecessorUID')[0].text.to_i )\r\n struct.delays.push( predecessor.get_elements('LinkLag')[0].text.to_i )\r\n end\r\n end\r\n\r\n tasks.push( struct )\r\n #rescue\r\n# rescue => error\r\n# # Ignore errors; they tend to indicate malformed tasks, or at least,\r\n# # XML file task entries that we do not understand.\r\n# logger.error \"DEBUG: Unrecovered error getting tasks: #{error}\"\r\n end\r\n end\r\n\r\n # Sort the array by ID. By sorting the array this way, the order\r\n # order will match the task order displayed to the user in the\r\n # project editor software which generated the XML file.\r\n\r\n tasks = tasks.sort_by { | task | task.tid }\r\n\r\n outlinenumber2UID = tasks.group_by(&:outlinenumber)\r\n\r\n # Step through the sorted tasks. Each time we find one where the\r\n # *next* task has an outline level greater than the current task,\r\n # then the current task MUST be a summary. Record its name and\r\n # blank out the task from the array. Otherwise, use whatever\r\n # summary name was most recently found (if any) as a name prefix.\r\n\r\n all_categories = []\r\n category = ''\r\n\r\n tasks.each_index do | index |\r\n task = tasks[ index ]\r\n next_task = tasks[ index + 1 ]\r\n\r\n # Instead of deleting the sumary tasks I only delete the task 0 (the project)\r\n\r\n #if ( next_task and next_task.level > task.level )\r\n # category = task.title.strip.gsub(/:$/, '') unless task.title.nil? # Kill any trailing :'s which are common in some project files\r\n # all_categories.push(category) # Keep track of all categories so we know which ones might need to be added\r\n #tasks[ index ] = \"Prueba\"\r\n if task.level == 0\r\n category = task.title.strip.gsub(/:$/, '') if task.title.present? # Kill any trailing :'s which are common in some project files\r\n all_categories.push(category) # Keep track of all categories so we know which ones might need to be added\r\n tasks[ index ] = nil\r\n else\r\n task.category = category\r\n end\r\n end\r\n\r\n # Remove any 'nil' items we created above. Add parent_uid field\r\n tasks = tasks.compact.uniq.map do |task|\r\n task.parent_uid = outlinenumber2UID[task.outnum][0].uid if outlinenumber2UID[task.outnum].present?\r\n task\r\n end\r\n\r\n # Now create a secondary array, where the UID of any given task is\r\n # the array index at which it can be found. This is just to make\r\n # looking up tasks by UID really easy, rather than faffing around\r\n # with \"tasks.find { | task | task.uid = <whatever> }\".\r\n\r\n uid_tasks = []\r\n\r\n tasks.each do | task |\r\n uid_tasks[ task.uid ] = task\r\n end\r\n\r\n # OK, now it's time to parse the assignments into some meaningful\r\n # array. These will become our redmine issues. Assignments\r\n # which relate to empty elements in \"uid_tasks\" or which have zero\r\n # work are associated with tasks which are either summaries or\r\n # milestones. Ignore both types.\r\n\r\n real_tasks = []\r\n\r\n #doc.each_element( 'Project/Assignments/Assignment' ) do | as |\r\n # task_uid = as.get_elements( 'TaskUID' )[ 0 ].text.to_i\r\n # task = uid_tasks[ task_uid ] unless task_uid.nil?\r\n # next if ( task.nil? )\r\n\r\n # work = as.get_elements( 'Work' )[ 0 ].text\r\n # Parse the \"Work\" string: \"PT<num>H<num>M<num>S\", but with some\r\n # leniency to allow any data before or after the H/M/S stuff.\r\n # hours = 0\r\n # mins = 0\r\n # secs = 0\r\n\r\n # strs = work.scan(/.*?(\\d+)H(\\d+)M(\\d+)S.*?/).flatten unless work.nil?\r\n # hours, mins, secs = strs.map { | str | str.to_i } unless strs.nil?\r\n\r\n #next if ( hours == 0 and mins == 0 and secs == 0 )\r\n\r\n # Woohoo, real task!\r\n\r\n # task.duration = ( ( ( hours * 3600 ) + ( mins * 60 ) + secs ) / 3600 ).prec_f\r\n\r\n # real_tasks.push( task )\r\n #end\r\n\r\n set_assignment_to_task(doc,uid_tasks)\r\n\r\n logger.error \"DEBUG: Real tasks: #{real_tasks.inspect}\"\r\n logger.error \"DEBUG: Tasks: #{tasks.inspect}\"\r\n\r\n real_tasks = tasks if real_tasks.empty?\r\n\r\n real_tasks = real_tasks.uniq if real_tasks.present?\r\n all_categories = all_categories.uniq.sort\r\n\r\n logger.error \"DEBUG: END get_tasks_from_xml\"\r\n\r\n return real_tasks, all_categories\r\n end", "def run\n @xml.xpath(@object._nodes_xpath).each do |node|\n object = @object.new\n parse_text_properties(node,object)\n parse_attribute_properties(node,object)\n parse_embedded_properties(node,object)\n @nodes << object\n end\n @nodes\n end", "def from_xml(node)\r\n @story_id = node['id']\r\n @title = node['name']\r\n @description = node['description'] || \"\"\r\n @url = node['url']\r\n accepted_at_node = node['accepted_at']\r\n @accepted_at = accepted_at_node.nil? ? nil : DateTime.parse(accepted_at_node)\r\n @created_at = DateTime.parse(node['created_at'])\r\n @updated_at = DateTime.parse(node['updated_at'])\r\n @requested_by_id = node['requested_by_id']\r\n @current_state = node['current_state']\r\n owned_by_node = node['owned_by']\r\n @owned_by_id = node['owned_by_id'] # owned_by_node.nil? || owned_by_node.length == 0 ? 'no one' : owned_by_node\r\n @story_type = node['story_type']\r\n estimate_node = node['estimate']\r\n @estimate = estimate_node.nil? ? 0 : estimate_node.to_i\r\n @estimate = 0 if @estimate < 0\r\n labelnode = node['labels']\r\n @labels = labelnode\r\n\r\n self\r\n end", "def start_element(name)\n @current_node = name.to_s\n if name.to_s == 'work'\n new_work\n end\n end", "def load_from_xml(xml_text)\n item = parse_xml(xml_text)\n if block_given? then self.create(item) { |i| yield(i) }\n else self.create(item)\n end\n end", "def parse_xml(xml)\n new from_xml(xml)\n end", "def initialize(run, xml)\n @run = run\n\n parse_xml(xml)\n end", "def process_xml(string)\n xml_processor_helper(create_document(string))\nend", "def new_parser_with_data\n\tdoc = load_sample_xml\n\tparser = GreenButton::Parser.new(doc)\nend", "def initialize(run, xml)\n super(run, xml)\n\n @error = false\n @structure = parse_data(xml_first_child(xml))\n\n # cached outputs\n @values = nil\n @refs = nil\n @types = nil\n @sizes = nil\n @total_size = nil\n end", "def parse\n #return a cached version if it exists\n return @nexml if @nexml\n\n #start at the root element\n skip_leader\n\n #start with a new Nexml object\n version = attribute( 'version' )\n generator = attribute( 'generator' )\n @nexml = NeXML::Nexml.new( version, generator )\n\n #perhaps a namespace api as well\n \n #start parsing other elements\n while next_node\n case local_name\n when \"otus\"\n @nexml.add_otus( parse_otus )\n when \"trees\"\n @nexml.add_trees( parse_trees )\n when \"characters\"\n @nexml.add_characters( parse_characters )\n end\n end\n\n #close the libxml parser object\n #close\n\n #return the Nexml object\n @nexml\n end", "def xml_parser(directory_name, filename)\n @doc = Document.new File.new(directory_name + filename)\n get_dataset_name(filename)\n set_topics\n set_dataset_rel_and_attr\n get_footnotes\n record_attributes\n @dataset.save\n end", "def from_xml(xml)\n\t\tend", "def import_process_framework\r\n uploaded_file = params[:xml_file]\r\n unless uploaded_file.nil?\r\n orig_name = uploaded_file.original_filename\r\n if File.extname(orig_name).downcase == \".xml\" \r\n data = uploaded_file.read if uploaded_file.respond_to? :read\r\n doc = REXML::Document.new( data )\r\n position_model = ProcessModel.find(:first, :order=> \"position DESC\")\r\n model_position = position_model.nil?? 1: (position_model.position+1) \r\n doc.elements.each(\"process_model\") do |e| \r\n if ProcessModel.find_by_name(e.attributes[\"name\"]).nil? \r\n new_process_model = ProcessModel.new\r\n new_process_model.name = e.attributes[\"name\"]\r\n new_process_model.author_id = User.current.id\r\n new_process_model.date = Time.now\r\n new_process_model.description = e.text\r\n new_process_model.position = model_position\r\n new_process_model.save\r\n ++ model_position\r\n activies = e.get_elements(\"activity\")\r\n activity_position =1\r\n activies.each do |acty|\r\n new_activity = Activity.new\r\n new_activity.name = acty.attributes[\"name\"]\r\n new_activity.description = acty.text\r\n new_activity.model_id = new_process_model.id\r\n new_activity.position= activity_position\r\n ++activity_position\r\n new_activity.save\r\n action_position = 1\r\n actions = acty.get_elements(\"action\")\r\n actions.each do |acns|\r\n new_action = Action.new\r\n new_action.name = acns.attributes[\"name\"]\r\n new_action.description = acns.text\r\n new_action.activity_id = new_activity.id\r\n new_action.position = action_position\r\n new_action.save\r\n ++action_position \r\n task_position = 1\r\n tasks = acns.get_elements(\"task\")\r\n tasks.each do |task|\r\n new_task = PfTask.new\r\n new_task.name = task.attributes[\"name\"]\r\n new_task.description = task.text\r\n new_task.action_id = new_action.id\r\n new_task.position = task_position\r\n ++task_position\r\n new_task.save\r\n end\r\n end\r\n end\r\n \r\n else \r\n flash[:error] = l(:lable_model_already_exist)\r\n redirect_to :controller=>'init_select',:action=>'select_models',:project_id => @project\r\n return\r\n end\r\n end \r\n flash[:notice] = l(:lable_import_successfully)\r\n redirect_to :controller=>'init_select',:action=>'select_models',:project_id => @project\r\n return\r\n else\r\n flash[:error] = l(:lable_import_unsuccessfully)\r\n redirect_to :controller=>'init_select',:action=>'select_models',:project_id => @project\r\n return\r\n end\r\n else\r\n flash[:error] = l(:lable_please_select_file_first)\r\n redirect_to :controller=>'init_select',:action=>'select_models',:project_id => @project\r\n return\r\n end\r\n end", "def init_from_xml(xmlDoc)\r\n @type = xmlDoc.expanded_name\r\n xmlDoc.each_element(\"ID\") { |e| @procID = e.text }\r\n xmlDoc.each_element(\"GROUP\") { |e| @group = e.text }\r\n xmlDoc.each_element(\"PATH\") { |e| @path = e.text }\r\n xmlDoc.each_element(\"ARGSLINE\") { |e| @cmdLineArgs = e.text }\r\n xmlDoc.each_element(\"ENV\") { |e| @env = e.text }\r\n # Dump the XML description of the OML configuration into a file\r\n xmlDoc.each_element(\"OML_CONFIG\") { |config|\r\n configPath = nil\r\n config.each_element(\"omlc\") { |omlc|\r\n configPath = \"/tmp/#{omlc.attributes['exp_id']}-#{@procID}.xml\"\r\n }\r\n f = File.new(configPath, \"w+\")\r\n config.each_element {|el|\r\n f << el.to_s\r\n }\r\n f.close\r\n # Set the OML_CONFIG environment with the path to the XML file\r\n @env << \" OML_CONFIG=#{configPath} \"\r\n }\r\n end", "def batch_xml(xml) \r\n xml.batch(:ID => 1) do\r\n xml.tag!(:bat_date, date)\r\n xml.tag!(:bat_id, batchid)\r\n xml.tag!(:site_num, facility.sitecode.rjust(5, '0'))\r\n xml.tag!(:bat_time, (batch_time.strftime(\"%H:%M:%S\") unless batch_time.blank?))\r\n xml.tag!(:chk_vol, (correspondence == true) ? 0 : checks.count)\r\n xml.tag!(:eob_vol, eobs.count)\r\n xml.tag!(:img_vol, images_count)\r\n xml.tag!(:total_pay_amt, sprintf('%.02f', total_payment.to_f))\r\n xml.tag!(:lockbox, lockbox)\r\n xml.tag!(:bank_bat_id, index_batch_number)\r\n xml.tag!(:bat_type, (correspondence == true) ? 'C' : 'P')\r\n xml.tag!(:src_file, src_file_name)\r\n xml.tag!(:process_dt, (created_at.strftime(\"%Y-%m-%d %H:%M:%S\")))\r\n xml.tag!(:rework, '0')\r\n end\r\n end", "def as_process(xml)\n xml.process(version: version,\n priority: priority,\n note: note,\n lifecycle: lifecycle,\n laneId: lane_id,\n elapsed: elapsed,\n attempts: attempts,\n datetime: created_at.to_time.iso8601,\n status: status,\n name: process)\n end", "def initialize(filename)\n @filename = filename\n Powirb.log.debug(\"Retrieving workitem from #{@filename}\")\n begin\n\t @doc = Nokogiri::XML(open(@filename))\n\trescue Exception => e\n\t Powirb.log.error(e)\n\tend\t\n end", "def setup\n xml_results = <<BEGIN\n <search:response total=\"2\" start=\"1\" page-length=\"10\" xmlns:search=\"http://marklogic.com/appservices/search\">\n <search:result index=\"1\" uri=\"/documents/discoverBook.xml\" path=\"fn:doc('/documents/discoverBook.xml')\" score=\"243\" confidence=\"0.97047\" fitness=\"1\">\n <search:snippet>\n <search:match path=\"fn:doc('/documents/discoverBook.xml')/*:book/*:bookinfo/*:title\">Discoverers <search:highlight>and</search:highlight> Explorers</search:match>\n <search:match path=\"fn:doc('/documents/discoverBook.xml')/*:book/*:chapter[1]/*:chapterinfo/*:biblioentry/*:title\">Discoverers <search:highlight>and</search:highlight> Explorers</search:match>\n </search:snippet>\n </search:result>\n <search:result index=\"2\" uri=\"/documents/a_and_c.xml\" path=\"fn:doc('/documents/a_and_c.xml')\" score=\"234\" confidence=\"0.952329\" fitness=\"1\">\n <search:snippet>\n <search:match path=\"fn:doc('/documents/a_and_c.xml')/PLAY/PERSONAE/PERSONA[10]\">Officers, Soldiers, Messengers, <search:highlight>and</search:highlight> other Attendants.</search:match>\n </search:snippet>\n </search:result>\n <search:qtext>and</search:qtext>\n <search:metrics>\n <search:query-resolution-time>PT0.009197S</search:query-resolution-time>\n <search:facet-resolution-time>PT0.000083S</search:facet-resolution-time>\n <search:snippet-resolution-time>PT0.019534S</search:snippet-resolution-time>\n <search:total-time>PT0.029033S</search:total-time>\n </search:metrics>\n</search:response>\nBEGIN\n\n xml_results_noh = <<BEGIN\n <search:response total=\"2\" start=\"1\" page-length=\"10\" xmlns:search=\"http://marklogic.com/appservices/search\">\n <search:result index=\"1\" uri=\"/documents/discoverBook.xml\" path=\"fn:doc('/documents/discoverBook.xml')\" score=\"243\" confidence=\"0.97047\" fitness=\"1\">\n <search:snippet>\n <search:match path=\"fn:doc('/documents/discoverBook.xml')/*:book/*:bookinfo/*:title\">Discoverers and Explorers</search:match>\n <search:match path=\"fn:doc('/documents/discoverBook.xml')/*:book/*:chapter[1]/*:chapterinfo/*:biblioentry/*:title\">Discoverers and Explorers</search:match>\n </search:snippet>\n </search:result>\n <search:result index=\"2\" uri=\"/documents/a_and_c.xml\" path=\"fn:doc('/documents/a_and_c.xml')\" score=\"234\" confidence=\"0.952329\" fitness=\"1\">\n <search:snippet>\n <search:match path=\"fn:doc('/documents/a_and_c.xml')/PLAY/PERSONAE/PERSONA[10]\">Officers, Soldiers, Messengers, and other Attendants.</search:match>\n </search:snippet>\n </search:result>\n <search:qtext>and</search:qtext>\n <search:metrics>\n <search:query-resolution-time>PT0.009197S</search:query-resolution-time>\n <search:facet-resolution-time>PT0.000083S</search:facet-resolution-time>\n <search:snippet-resolution-time>PT0.019534S</search:snippet-resolution-time>\n <search:total-time>PT0.029033S</search:total-time>\n </search:metrics>\n</search:response>\nBEGIN\n\n results_with_facets = <<-BEGIN\n<search:response total=\"21973\" start=\"1\" page-length=\"10\" xmlns:search=\"http://marklogic.com/appservices/search\">\n <search:result index=\"9\" uri=\"/Users/clarkrichey/Downloads/wits/wits21402.xml\" path=\"fn:doc(&quot;/Users/clarkrichey/Downloads/wits/wits21402.xml&quot;)\" score=\"196\" confidence=\"0.338805\" fitness=\"0.890659\">\n <search:snippet>\n <search:match path=\"fn:doc(&quot;/Users/clarkrichey/Downloads/wits/wits21402.xml&quot;)/*:Incident/*:Subject\">1 newspaper editor injured in letter <search:highlight>bomb</search:highlight> attack by Informal Anarchist Federation in Turin, Piemonte, Italy</search:match>\n <search:match path=\"fn:doc(&quot;/Users/clarkrichey/Downloads/wits/wits21402.xml&quot;)/*:Incident/*:EventTypeList\">\n<search:highlight>Bombing</search:highlight>\n</search:match>\n <search:match path=\"fn:doc(&quot;/Users/clarkrichey/Downloads/wits/wits21402.xml&quot;)/*:Incident/*:WeaponTypeList/*:WeaponType\">Letter <search:highlight>Bomb</search:highlight></search:match>\n </search:snippet>\n </search:result>\n <search:result index=\"10\" uri=\"/Users/clarkrichey/Downloads/wits/wits23118.xml\" path=\"fn:doc(&quot;/Users/clarkrichey/Downloads/wits/wits23118.xml&quot;)\" score=\"196\" confidence=\"0.338805\" fitness=\"0.890659\">\n <search:snippet>\n <search:match path=\"fn:doc(&quot;/Users/clarkrichey/Downloads/wits/wits23118.xml&quot;)/*:Incident/*:Subject\">1 government employee killed in <search:highlight>bombing</search:highlight> in Ghazni, Afghanistan</search:match>\n <search:match path=\"fn:doc(&quot;/Users/clarkrichey/Downloads/wits/wits23118.xml&quot;)/*:Incident/*:EventTypeList\">\n<search:highlight>Bombing</search:highlight>\n</search:match>\n </search:snippet>\n </search:result>\n <search:facet name=\"Region\">\n <search:facet-value name=\"Africa\" count=\"622\">Africa</search:facet-value>\n <search:facet-value name=\"Central and South America\" count=\"1012\">Central and South America</search:facet-value>\n <search:facet-value name=\"East Asia-Pacific\" count=\"1198\">East Asia-Pacific</search:facet-value>\n <search:facet-value name=\"Eurasia\" count=\"761\">Eurasia</search:facet-value>\n <search:facet-value name=\"Europe\" count=\"1057\">Europe</search:facet-value>\n <search:facet-value name=\"Middle East and Persian Gulf\" count=\"10374\">Middle East and Persian Gulf</search:facet-value>\n <search:facet-value name=\"North America and Caribbean\" count=\"16\">North America and Caribbean</search:facet-value>\n <search:facet-value name=\"South Asia\" count=\"6933\">South Asia</search:facet-value>\n </search:facet>\n <search:facet name=\"Country\">\n <search:facet-value name=\"England\" count=\"200\">England</search:facet-value>\n <search:facet-value name=\"Ireland\" count=\"422\">Ireland</search:facet-value>\n <search:facet-value name=\"Brazil\" count=\"10\">Brazil</search:facet-value>\n </search:facet>\n <search:qtext>bomb</search:qtext>\n <search:metrics>\n <search:query-resolution-time>PT0.420016S</search:query-resolution-time>\n <search:facet-resolution-time>PT0.002873S</search:facet-resolution-time>\n <search:snippet-resolution-time>PT0.039998S</search:snippet-resolution-time>\n <search:total-time>PT0.463759S</search:total-time>\n </search:metrics>\n</search:response>\n BEGIN\n @search_results = ActiveDocument::SearchResults.new(xml_results)\n @search_results_noh = ActiveDocument::SearchResults.new(xml_results_noh)\n @faceted_results = ActiveDocument::SearchResults.new(results_with_facets)\n end", "def make_contents_xml\n puts_message params[:temp_id]\n \n temp_id = params[:temp_id].to_i\n @temp = Mytemplate.get(temp_id)\n temp = @temp\n erase_job_done_file_temp(@temp)\n path = temp.path\n njob = path + \"/do_job.mJob\"\n mjob_file= <<-EOF\n <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n <plist version=\"1.0\">\n <dict>\n \t<key>Action</key>\n \t<string>MakeContentsXML</string>\n \t<key>DocPath</key>\n \t<string>#{path}</string> \n <key>ID</key>\n \t<string>#{temp.id}</string> \t\n </dict>\n </plist>\n </xml>\n EOF\n \n\n mjob = path + \"/do_job.mJob\" \n \n File.open(mjob,'w') { |f| f.write mjob_file } \n\n if File.exists?(mjob)\n system \"open #{mjob}\"\n end \n \n puts_message \"make_contens_xml finished\"\n \n render :nothing => true\n end", "def test_show_a_simple_parse\n @rank = 0\n\n self.xml_file= File.new('test/contents.xml')\n\n # Open a database\n db = SQLite3::Database.new \"life_planner.db\"\n\n db.execute <<-SQL\n DROP TABLE IF EXISTS tasks;\n SQL\n\n # Create a table\n rows = db.execute <<-SQL\n create table tasks (\n id INTEGER PRIMARY KEY NOT NULL,\n name TEXT NOT NULL,\n note TEXT,\n rank INTEGER,\n parent INTEGER,\n splitable BOOLEAN,\n remaining_time INTEGER,\n FOREIGN KEY(parent) REFERENCES tasks(id)\n );\n SQL\n\n @count = 0\n root_node = self.get_root_node\n disp_node root_node, 0\n\n insert_node_in_db db, root_node, 0\n\n puts @count\n # FIXME mon dossier TODO list et tout ce qui est dedans n'apparait nulle part!\n\n # FIXME il manque des noeuds! Car on ne parse pas à l'intérieur des dossiers?\n end", "def jobs\n doc = Nokogiri::XML open(@url)\n\n doc.search('//job').map { |node|\n Job.new(attributes_from(node))\n }\n end", "def initialize(xml_contents)\n @doc = @entry = Document.parse(xml_contents)\n details = @doc.at_xpath('measure/measureDetails')\n @id = details.at_xpath('uuid').text.upcase\n @hqmf_set_id = details.at_xpath('guid').text.upcase\n @hqmf_version_number = details.at_xpath('version').text.to_i\n @title = details.at_xpath('title').text\n @description = details.at_xpath('description').text\n @cms_id = \"CMS#{details.at_xpath('emeasureid').text}v#{@hqmf_version_number}\"\n @nqf_id = details.at_xpath('nqfid/@extension').value\n\n @attributes = []\n details.children.reject {|e| e.name == 'text'}.each do |attribute|\n attribute_data = Utilities::MEASURE_ATTRIBUTES_MAP[attribute.name.to_sym]\n if (attribute_data)\n attribute_data['value'] = attribute.at_xpath('@extension').try(:value) || attribute.text\n @attributes << HQMF::Attribute.from_json(attribute_data)\n end\n end\n\n @criteria_map = {}\n @measure_period_map = {\n details.at_xpath('period/@uuid').value => :measure_period,\n details.at_xpath('period/startDate/@uuid').value => :measure_period_start,\n details.at_xpath('period/stopDate/@uuid').value => :measure_period_end\n }\n @measure_period_map.keys.each do |key|\n @criteria_map[key] = OpenStruct.new(id: HQMF::Document::MEASURE_PERIOD_ID, hqmf_id: key)\n end\n \n # Extract the data criteria\n @source_data_criteria = []\n @derived_data_criteria = []\n @attribute_map = {}\n @doc.xpath('measure/elementLookUp/qdm').each do |entry|\n data_type = entry.at_xpath('@datatype').value\n if !['Timing Element', 'attribute'].include? data_type\n criteria = DataCriteria.new(entry)\n @source_data_criteria << criteria\n @criteria_map[criteria.hqmf_id] = criteria\n elsif data_type == 'attribute'\n attribute = Attribute.new(entry.at_xpath('@id').value, entry.at_xpath('@oid').value, entry.at_xpath('@name').value)\n @attribute_map[attribute.id] = attribute\n elsif data_type == 'Timing Element'\n name = entry.at_xpath('@name').value\n if MEASURE_PERIOD_TITLES[name]\n hqmf_id = entry.at_xpath('@uuid').value\n @criteria_map[hqmf_id] = OpenStruct.new(id: HQMF::Document::MEASURE_PERIOD_ID, hqmf_id: hqmf_id)\n @measure_period_map[hqmf_id] = MEASURE_PERIOD_TITLES[name]\n end\n end\n end\n\n # Extract the population criteria and population collections\n @populations = []\n @population_criteria = []\n \n population_defs = @doc.xpath('measure/measureGrouping/group')\n population_defs.each_with_index do |population_def, population_index|\n\n population = {}\n population_def.xpath('clause').each do |criteria_def|\n\n criteria = PopulationCriteria.new(criteria_def, self, population_index)\n @population_criteria << criteria\n population[criteria.type] = criteria.id\n\n end\n\n @doc.xpath('measure/measureObservations').children.reject {|e| e.name == 'text'}.each_with_index do |observ_def, observ_index|\n observ = PopulationCriteria.new(observ_def, self, population_index)\n @population_criteria << observ\n population[observ.type] = observ.id\n raise \"multiple observations... don't know how to tie to populations\" if observ_index > 0\n end\n\n population['id'] = \"Population#{population_index}\"\n population['title'] = \"Population #{population_index}\" if population_defs.length > 1\n @populations << population\n\n end\n\n\n puts \"\\t NEED TO HANDLE STRATIFICATIONS\"\n # stratifier_id_def = population_def.at_xpath('cda:templateId/cda:item[@root=\"'+HQMF::Document::STRATIFIED_POPULATION_TEMPLATE_ID+'\"]/@controlInformationRoot', NAMESPACES)\n # population['stratification'] = stratifier_id_def.value if stratifier_id_def\n\n end", "def process_xml(xml)\n doc = REXML::Document.new xml\n @message_identifier = doc.text(\"//imsx_POXRequestHeaderInfo/imsx_messageIdentifier\")\n @lis_result_sourcedid = doc.text(\"//resultRecord/sourcedGUID/sourcedId\")\n\n if REXML::XPath.first(doc, \"//deleteResultRequest\")\n @operation = DELETE_REQUEST\n elsif REXML::XPath.first(doc, \"//readResultRequest\")\n @operation = READ_REQUEST\n elsif REXML::XPath.first(doc, \"//replaceResultRequest\")\n @operation = REPLACE_REQUEST\n @score = doc.get_text(\"//resultRecord/result/resultScore/textString\")\n end\n extention_process_xml(doc)\n end", "def parse_xml\n\n raise \"parse_xml method has not been implemented in this class\"\n \n end", "def parse( x )\n cycle( xml( x ) )\n end", "def tran_xml(xml, index, job, batch, transaction_set_count) \n if !payer.blank? && !payer.status.blank? && (!payer.gateway.blank? || !payer.gateway_temp.blank?)\n gateway = payer.status.upcase == 'MAPPED' ? payer.gateway : (payer.gateway_temp || 'HLSC')\n payid = payer.payer_identifier(micr_line_information)\n footnote_indicator = (payer.footnote_indicator ? 1 : 0)\n else raise 'Invalid Payer'\n puts \"Payer record for check number #{check_number} is incomplete or invalid\"\n log.error \"Payer record for check number #{check_number} is incomplete or invalid\"\n end\n\n payee_name ||= batch.facility.name.to_s.strip\n xml.tran(:ID => index + 1) do\n xml.tag!(:batch_attrib, 1)\n xml.tag!(:gateway, gateway)\n xml.tag!(:pay_id, payid)\n xml.tag!(:payee_nm, (payee_name.slice(0, 25) if !payee_name.blank?))\n xml.tag!(:aba_num, (micr_line_information.aba_routing_number if micr_line_information))\n xml.tag!(:chk_act, (micr_line_information.payer_account_number if micr_line_information))\n xml.tag!(:chk_num, check_number)\n xml.tag!(:chk_amt, sprintf('%.02f', check_amount.to_f))\n xml.tag!(:eob_id, (index + 1))\n xml.tag!(:tid, job.transaction_number)\n xml.tag!(:rework, '0')\n xml.tag!(:payer_footnote_based, (footnote_indicator || 0))\n xml.tag!(:worklist_status_cd, '')\n xml.tag!(:transaction_receipt_dt, (batch.date.strftime(\"%Y-%m-%d\") unless batch.date.blank?))\n xml.tag!(:hlsc_file_nm, batch.src_file_name)\n xml.tag!(:show_on_worklist, '0')\n xml.tag!(:transaction_guid, guid)\n end\n transaction_set_count += 1\n end", "def initialize(xml, fileName, pa, responseDir)\r\n @responseDir = responseDir\r\n @xml = REXML::Document.new(xml) \r\n @fileName = fileName\r\n @nps = []\r\n @seed = 0\r\n\r\n \tif pa == nil\r\n\t \t@parseAdapter = ParseAdapter.new\r\n\t else\r\n\t \t@parseAdapter = pa\r\n \tend\r\n end", "def parse\n Ox.parse(@xml)\n end", "def create(work)\n @work = work\n @method = :create\n end", "def parse(io)\n self.doc = Nokogiri::XML(io)\n end", "def create_work_and_files(file_dir, dom)\n @log.info 'Ingesting DSpace item'\n\n start_time = DateTime.now\n\n # data mapper\n params = collect_params(dom)\n pp params if @debug\n\n @log.info 'Handle: ' + params['handle'][0]\n\n @log.info 'Creating Hyrax work...'\n work = create_new_work(params)\n\n if @config['metadata_only']\n @log.info 'Metadata only'\n else\n @log.info 'Getting uploaded files'\n uploaded_files = get_files_to_upload(file_dir, dom)\n\n @log.info 'Attaching file(s) to work job...'\n AttachFilesToWorkJob.perform_now(work, uploaded_files)\n end\n\n # record this work in the handle log\n @handle_report.write(\"#{params['handle']},#{work.id}\\n\")\n\n # record the time it took\n end_time = Time.now.minus_with_coercion(start_time)\n total_time = Time.at(end_time.to_i.abs).utc.strftime('%H:%M:%S')\n @log.info 'Total time: ' + total_time\n @log.info 'DONE!'.green\nend", "def build_new_works\n\n return if self.status==:new_only_effort #estimation only, no schedule\n\n work_actual_array=self.task.work_actuals\n\n d1 = Date.last_monday(self.task.start)\n d2 = task.stop\n\n logger.info \" build_works_for_baseline from #{d1} to #{d2}\"\n\n d1.step(d2, 7) do |date|\n self.works.build do |w|\n w.start_date =date\n w.duration =WORK_TIME_FRAME\n w.workhours =Baseline.corresponding_work(work_actual_array, date).nil_or.workhours\n w.description=Baseline.corresponding_work(work_actual_array, date).nil_or.description\n end\n end\n end", "def perform_beginning_tasks(element, attrs)\n if element == \"Batch\"\n meta_data_from_batch = Hash[*attrs.flatten(1)]\n @job = Job.find(meta_data_from_batch[\"DocID\"])\n @batch = @job.batch\n @facility = @batch.facility\n @check_information = @job.check_informations.first\n micr_info = @check_information.micr_line_information\n @payer = micr_info.payer if micr_info\n if [\"PROCESSING\", \"NEW\", \"COMPLETED\", \"INCOMPLETED\"].include? @job.job_status\n RevremitMailer.notify_late_ocr_xml_arrival(@check_information.check_number, @batch.id, @batch.batchid).deliver\n abort(\"The job is already allocated for the processing...Details are mailed to #{$RR_REFERENCES['email']['late_ocr_xml_arrival']['notification']}\")\n end\n @job.update_attributes(:is_ocr => true, :ocr_status => \"OCR PROCESSING\", :job_status => \"OCR PROCESSING\")\n end\n\n if element == \"Grid\"\n attr_top_element_hash = Hash[*attrs.flatten(1)]\n @remark_code_grid_identifier = attr_top_element_hash[\"Name\"] == \"REMARKS\" ? true : false\n end\n\n if element == \"RemarkCode\" or element == \"RemarkCodeDescription\"\n @remark_code_identifier = true\n end\n\n if @remark_code_identifier\n if element == \"DataValue\"\n @data_value_identifier = true\n end\n if element == \"TEXTSTRING\" and @data_value_identifier and @remark_code_grid_identifier\n attr_hash = Hash[*attrs.flatten(1)]\n @remark_codes_with_desc << attr_hash[\"WORD\"]\n elsif element == \"TEXTSTRING\" and @data_value_identifier\n attr_hash = Hash[*attrs.flatten(1)]\n unless attr_hash[\"WORD\"].blank?\n @remark_codes << attr_hash[\"WORD\"] unless @remark_codes.include? attr_hash[\"WORD\"]\n end\n end\n end\n construct_the_data_structures(element, attrs)\n end", "def build_document\n self.root = XML::Node.new('Workbook')\n root['xmlns'] = 'urn:schemas-microsoft-com:office:spreadsheet'\n root['xmlns:o'] = 'urn:schemas-microsoft-com:office:office'\n root['xmlns:x'] = 'urn:schemas-microsoft-com:office:excel'\n root['xmlns:ss'] = 'urn:schemas-microsoft-com:office:spreadsheet'\n root['xmlns:html'] = 'http://www.w3.org/TR/REC-html40'\n end", "def initialize(xml_data)\n initialize_data(Sequel.postgres('roadworks'), xml_data)\n end", "def find_work\n\n end", "def from_xml_elem(ctx, root)\n #p [:from_xml_elem, :ctx, root]\n attributes = root.attributes.inject({ }) { |hash, (k, v)| hash[k] = EscapeXML.unescape(v.to_s); hash}\n text, children = root.children.partition{ |x| text_node?(x) }\n text = text.map{ |x| x.to_s}.reject{ |s| s =~ /^\\s*$/}.join('')\n element_name = root.name\n if element_name !~ /[A-Z]/\n element_name = Doodle::Utils.camel_case(element_name)\n end\n klass = Utils.const_lookup(element_name, ctx)\n #p [:creating_new, klass, text, attributes]\n #p [:root1, root]\n # don't pass in empty text - screws up when class has only\n # child elements (and no attributes) because tries to\n # instantiate child element from empty string \"\"\n if text == \"\"\n text = nil\n end\n args = [text, attributes].compact\n oroot = klass.new(*args) {\n #p [:in_block]\n from_xml_elem(root)\n }\n #p [:oroot, oroot]\n oroot\n end", "def start_job\n associate(Wesabe::Job.from_xml(Hpricot::XML(post(:url => \"/credentials/#{id}/jobs.xml\")) / :job))\n end", "def initialize\n\t@xml = '<?xml version=\"1.0\"?>\n<?misc:processingInstruction \"with arguments\"?>\n<?other:piNoArgs ?>\n<!DOCTYPE outer PUBLIC \"public id\" \"foobar\" [\n <!ENTITY foo \"bletch\">\n <!ELEMENT el>\n <!ATTLIST el EMPTY>\n <!NOTATION notation ignored>\n]>\n<!-- comment -->\n<outer>\n data&amp;&foo;\nmore on next line<simpleTag>text</simpleTag>\n<inner:tag a=\"tabs\tto\tspaces&foo;\"/><![CDATA[xx<z&xx</\nnewline in cdata\n]]>\n<p>text <b>bold café coffee</b> more text</p>\n</outer>'\n\n\temptyAttrs = Hash.new()\n\t@newlineTok = NQXML::Text.new(\"\\n\")\n\n\tattrs = Hash.new()\n\tattrs['version'] = '1.0'\n\t@xmlDecl = NQXML::XMLDecl.new('xml', attrs, '<?xml version=\"1.0\"?>')\n\n\tsrc = '<?misc:processingInstruction \"with arguments\"?>'\n\t@piWithArgs =\n\t NQXML::ProcessingInstruction.new('misc:processingInstruction',\n\t\t\t\t\t '\"with arguments\"', src)\n\n\t@piNoArgs = NQXML::ProcessingInstruction.new('other:piNoArgs', '',\n\t\t\t\t\t\t '<?other:piNoArgs ?>')\n\n\t@entityTag =\n\t NQXML::GeneralEntityTag.new('foo', 'bletch', nil, nil,\n\t\t\t\t\t'<!ENTITY foo \"bletch\">')\n\t@element = NQXML::Element.new('el', '', '<!ELEMENT el>')\n\t@attlist = NQXML::Attlist.new('el', 'EMPTY', '<!ATTLIST el EMPTY>')\n\t@notation = NQXML::Notation.new('notation', 'ignored',\n\t\t\t\t\t'<!NOTATION notation ignored>')\n\t@doctypePubid =\n\t NQXML::PublicExternalID.new('\"public id\"', '\"foobar\"',\n\t\t\t\t\t'PUBLIC \"public id\" \"foobar\"')\n\t@doctype =\n\t NQXML::Doctype.new('outer', @doctypePubid,\n\t\t\t [@entityTag, @element, @attlist, @notation],\n\t\t\t \"<!DOCTYPE outer PUBLIC \\\"public id\\\" \\\"foobar\\\" [\\n\" +\n\t\t\t \" <!ENTITY foo \\\"bletch\\\">\\n\" +\n\t\t\t \" <!ELEMENT el>\\n\" +\n\t\t\t \" <!ATTLIST el EMPTY>\\n\" +\n\t\t\t \" <!NOTATION notation ignored>\\n\" +\n\t\t\t \"]>\")\n\n\t@comment = NQXML::Comment.new('<!-- comment -->')\n\t@outerStart = NQXML::Tag.new('outer', emptyAttrs, false, '<outer>')\n\t@textDataWithSub = NQXML::Text.new(\"\\n data&bletch\\nmore on next line\")\n\t@simpleTagStart = NQXML::Tag.new('simpleTag', emptyAttrs, false,\n\t\t\t\t\t '<simpleTag>')\n\t@simpleTextData = NQXML::Text.new('text')\n\t@simpleTagEnd = NQXML::Tag.new('simpleTag', nil, true, '</simpleTag>')\n\n\tattrs = Hash.new()\n\tattrs['a'] = 'tabs to spacesbletch'\n\t@innerTagStart = NQXML::Tag.new('inner:tag', attrs, false,\n\t\t\t\t\t'<inner:tag a=\"tabs\tto\tspaces&foo;\"/>')\n\n\t@innerTagEnd = NQXML::Tag.new('inner:tag', nil, true,\n\t\t\t\t\t'<inner:tag a=\"tabs\tto\tspaces&foo;\"/>')\n\t@pTagStart = NQXML::Tag.new('p', emptyAttrs, false, '<p>')\n\t@pTagEnd = NQXML::Tag.new('p', nil, true, '</p>')\n\t@bTagStart = NQXML::Tag.new('b', emptyAttrs, false, '<b>')\n\t@bTagEnd = NQXML::Tag.new('b', nil, true, '</b>')\n\t@textText = NQXML::Text.new('text ')\n\t@boldText = NQXML::Text.new('bold café coffee')\n\t@moreTextText = NQXML::Text.new(' more text')\n\n\t@cdata = NQXML::Text.new(\"xx<z&xx</\\nnewline in cdata\\n\",\n\t\t\t\t \"<![CDATA[xx<z&xx</\\nnewline in cdata\\n]]>\")\n\t@outerEnd = NQXML::Tag.new('outer', nil, true, '</outer>')\n\n\t@sub1_xml = '<?xml version=\"1.0\"?>\n<!DOCTYPE outer SYSTEM \"foobar\" [\n <!ENTITY example \"<p>An ampersand (&#38;#38;) may be escaped numerically (&#38;#38;#38;) or with a general entity (&amp;amp;).</p>\" >\n]>\n'\n\tsrc = '<!ENTITY example \"<p>An ampersand (&#38;#38;) may be' +\n\t ' escaped numerically (&#38;#38;#38;) or with a general entity' +\n\t ' (&amp;amp;).</p> >'\n\tval = \"<p>An ampersand (&#38;) may be escaped numerically\" +\n\t \" (&#38;#38;) or with a general entity (&amp;amp;).</p>\"\n\t@sub1Entity = NQXML::GeneralEntityTag.new('example', val, nil, nil,\n\t\t\t\t\t\t src)\n\t\t\t\t\t\t\n\t@sub2_xml = '<?xml version=\"1.0\"?>\n<!DOCTYPE test [\n<!ELEMENT test (#PCDATA) >\n<!ENTITY % xx \\'&#37;zz;\\'>\n<!ENTITY % zz \\'&#60;!ENTITY tricky \"error-prone\" >\\' >\n%xx;\n]>\n<test>This sample shows a &tricky; method.</test>\n'\n\t@xxEntity =\n\t NQXML::ParameterEntityTag.new('xx', '%zz;', nil,\n\t\t\t\t\t '<!ENTITY % zz \\'&#37;zz;\\'>')\n\n\tsrc = '<!ENTITY % zz \\'&#60;!ENTITY tricky \"error-prone\" >\\' >'\n\tval = '<!ENTITY tricky \"error-prone\" >'\n\t@zzEntity = NQXML::ParameterEntityTag.new('zz', val, nil, src)\n end", "def parse(xml, parse_ext = false)\n if @external\n @tree = @document.createDocumentFragment\n else\n @tree = @document\n end\n @parse_ext = parse_ext\n @current = @tree\n @inDocDecl = 0\n @decl = \"\"\n @inDecl = 0\n @idRest = 0\n @extID = nil\n @cdata_f = false\n @cdata_buf = ''\n @nsdecl = []\n super(xml)\n @tree\n end", "def build_work(w_hsh)\n title = Array(w_hsh[:title])\n creator = Array(w_hsh[:creator])\n rights = Array(w_hsh[:rights])\n desc = Array(w_hsh[:description])\n methodology = w_hsh[:methodology]\n subject = Array(w_hsh[:subject])\n contributor = Array(w_hsh[:contributor])\n date_created = Array(w_hsh[:date_created]) \n rtype = Array(w_hsh[:resource_type] || 'Dataset')\n\n gw = GenericWork.new( title: title, creator: creator, rights: rights,\n description: desc, resource_type: rtype,\n methodology: methodology, subject: subject,\n contributor: contributor, date_created: date_created ) \n paths_and_names = w_hsh[:files].zip w_hsh[:filenames]\n fsets = paths_and_names.map{|fp| build_file_set(fp[0], fp[1])}\n fsets.each{|fs| gw.ordered_members << fs}\n gw.apply_depositor_metadata(user_key)\n gw.owner=(user_key)\n gw.save!\n return gw\n end", "def generate\n begin\n xml_string = ''\n ERB.new(template,0).result(bind { xml_string })\n rescue Exception => e\n puts \"XML CONTENT CREATION ERROR => \"\n puts e\n OutputXml.log.error \"#{Time.now}: Error during XML creation\"\n OutputXml.log.info \"Batch Id - \" + @checks.first.batch.id.to_s\n OutputXml.log.info e\n OutputXml.log.info e.backtrace.join(\"\\n\")\n OutputXml.log.info \"\\n\"\n puts \"Detailed description of the error can be found at - /output_logs/XMLGeneration.log\"\n end\n end", "def create_job xml, name\n\t\t\tputs \"==> Creating job for project: '#{name}'\"\n\t\t\tbegin\n\t\t\t\tcreate_response = RestClient.post \"#{@jenkins_host}:#{@jenkins_port}/createItem/?name=#{name}\", xml , {:content_type => :xml}\n\t\t\t\treturn create_response.code.to_s\n\t\t\trescue Exception => e\n\t\t\t\tputs \"==> Error creating job #{name}\"\n\t\t\t\treturn \"500\"\n\t\t\tend\n\t\tend", "def initialize(xml)\n teams = xml.xpath('team')\n home_team = teams.first\n away_team = teams.last\n @id = xml[:id]\n @scheduled = Time.parse xml[:scheduled]\n @status = xml[:status]\n @home = create_hash(home_team)\n @away = create_hash(away_team)\n end", "def retrieve\n content = IO.readlines(url).join('')\n\tdoc = Nokogiri::XML(content)\n\tself.class.rules.each_pair do |k,v|\n\t tmp = doc.xpath(v)\n\n\t case k\n\t when 'time_spent'\n\t\t self.send(\"#{k}=\", to_hours(tmp[0].content))\n\t\twhen 'user'\n\t\t self.send(\"#{k}=\", User.find_by_name(tmp[0].content))\n\t\telse\n\t\t self.send(\"#{k}=\", tmp[0].content) unless tmp[0].nil?\t\t\n\t end\n\tend\n\t\n\tself.workitem = WorkItem.find_by_wid(File.dirname(self.url).split(/\\//).last)\n\t\n\tPlace.logger.info(\"saved workrecord #{self.url}\")\n\t\n self.save\n end", "def parse_xml xml_doc\n return nil if xml_doc.at(\"title\").nil?\n @id = id\n\n %w[title description upload_date number_of_likes number_of_plays width height number_of_comments url duration].each do |attribute|\n instance_variable_set(\"@#{attribute}\", xml_doc.at(attribute).inner_html)\n end\n\n @owner = User.new\n %w[id username display_name is_plus is_staff profileurl realname username videosurl].each do |attribute|\n @owner.instance_variable_set(\"@#{attribute}\", xml_doc.at(\"owner\").attributes[attribute])\n end\n\n (xml_doc/:thumbnail).each do |thumbnail|\n @thumbs << build_thumbnail(thumbnail)\n end\n end", "def process_xml(xml)\n doc = REXML::Document.new xml\n @message_identifier = doc.text(\"//imsx_statusInfo/imsx_messageIdentifier\").to_s\n @code_major = doc.text(\"//imsx_statusInfo/imsx_codeMajor\")\n @code_major.downcase! if @code_major\n @severity = doc.text(\"//imsx_statusInfo/imsx_severity\")\n @severity.downcase! if @severity\n @description = doc.text(\"//imsx_statusInfo/imsx_description\")\n @description = @description.to_s if @description\n @message_ref_identifier = doc.text(\"//imsx_statusInfo/imsx_messageRefIdentifier\")\n @operation = doc.text(\"//imsx_statusInfo/imsx_operationRefIdentifier\")\n @score = doc.text(\"//readResultResponse//resultScore/textString\")\n @score = @score.to_s if @score\n end", "def build\n asdocs = scan(@src)\n\n if asdocs.empty?\n puts \"No .asdoc files found.\"\n else\n create_xml(asdocs)\n to_disk(xml)\n end\n end", "def read_xml\n # date & time of rejections\n self.fecha_hora_confeccion = @doc.get_elements('//CreDtTm')[0].text\n self.process_date_time = Date.parse(self.fecha_hora_confeccion[0,10]) rescue Date.today\n # fiscal id, bank suffix & date of order\n self.OrgnlMsgId = @doc.get_elements('//OrgnlMsgId')[0].text\n self.OrgnlPmtInfId = @doc.get_elements('//OrgnlPmtInfId')[0].text\n begin # sufijo based on OrgnlPmtInfId\n self.sufijo = self.OrgnlPmtInfId[4,3]\n rescue # sufijo based on OrgnlMsgId\n self.sufijo = self.OrgnlMsgId[22,3]\n end\n begin # nif based on OrgnlPmtInfId\n self.nif = self.OrgnlPmtInfId[7,9]\n rescue # nif based on OrgnlMsgId\n self.nif = self.OrgnlMsgId[25,9]\n end\n begin # nif based on OrgnlPmtInfId\n self.fecha_devolucion = self.OrgnlPmtInfId[16,8].to_date\n rescue # nif based on OrgnlMsgId\n self.fecha_devolucion = self.OrgnlMsgId[3,8].to_date\n end\n # Original file data\n self.numero_total_adeudos = @doc.elements['//CstmrPmtStsRpt'].elements['OrgnlPmtInfAndSts'].elements['OrgnlNbOfTxs'].text\n self.importe_total = @doc.elements['//CstmrPmtStsRpt'].elements['OrgnlPmtInfAndSts'].elements['OrgnlCtrlSum'].text\n #\n # Loop thru rejections (TxInfAndSts)\n #\n receipt_no = ''\n remesa_old = ''\n referencia_tipo = ''\n cuenta_acreedor = ''\n @doc.elements.each('//TxInfAndSts') do |e|\n referencia_adeudo = e.elements['OrgnlEndToEndId'].text\n codigo_rechazo = e.elements['StsRsnInf'].elements['Rsn'].elements['Cd'].text\n importe_adeudo = (e.elements['OrgnlTxRef'].elements['Amt'].elements['InstdAmt'].text.to_d) * (-1)\n fecha_cobro = e.elements['OrgnlTxRef'].elements['ReqdColltnDt'].text.to_date\n referencia_mandato = e.elements['OrgnlTxRef'].elements['MndtRltdInf'].elements['MndtId'].text\n fecha_firma_mandato = e.elements['OrgnlTxRef'].elements['MndtRltdInf'].elements['DtOfSgntr'].text.to_date\n concepto = e.elements['OrgnlTxRef'].elements['RmtInf'].elements['Ustrd'].text\n nombre_deudor = e.elements['OrgnlTxRef'].elements['Dbtr'].elements['Nm'].text\n cuenta_deudor = e.elements['OrgnlTxRef'].elements['DbtrAcct'].elements['Id'].elements['IBAN'].text\n cuenta_acreedor = e.elements['OrgnlTxRef'].elements['CdtrAcct'].elements['Id'].elements['IBAN'].text\n referencia_tipo = referencia_adeudo[34,1]\n id_bill = referencia_adeudo[0,9].to_i # if referencia_tipo=='I'->invoice_id else referencia_tipo!='I'->bill_id\n id_client_payment = referencia_adeudo[9,9].to_i\n receipt_no = referencia_adeudo[18,6]\n id_client = referencia_mandato.last(8).to_i\n remesa_old = referencia_adeudo[10,6]\n\n # *** Save in returns array ***\n self.lista_devoluciones.push(referencia_adeudo: referencia_adeudo,\n codigo_rechazo: codigo_rechazo,\n importe_adeudo: importe_adeudo,\n fecha_cobro: fecha_cobro,\n referencia_mandato:referencia_mandato,\n fecha_firma_mandato: fecha_firma_mandato,\n concepto: concepto,\n nombre_deudor: nombre_deudor,\n cuenta_deudor: cuenta_deudor,\n bill_id: id_bill,\n client_payment_id: id_client_payment,\n receipt_no: receipt_no,\n client_id: id_client)\n end\n self.cuenta_acreedor = cuenta_acreedor\n self.remesa = receipt_no\n self.remesa_old = remesa_old\n self.referencia_tipo = referencia_tipo\n end", "def create_trial_from_xml(trial_xml)\n trial = Trial.new\n trial[:org_study_id] = trial_xml.xpath(\"//id_info//org_study_id\").text\n trial[:secondary_id] = trial_xml.xpath(\"//id_info//secondary_id\").text\n trial[:nct_id] = trial_xml.xpath(\"//nct_id\").text\n trial[:nct_alias] = trial_xml.xpath(\"//nct_alias\").text\n trial[:brief_title] = trial_xml.xpath(\"//brief_title\").text\n trial[:official_title] = trial_xml.xpath(\"//official_title\").text\n trial[:lead_sponsor_name] = trial_xml.xpath(\"//sponsors//lead_sponsor//agency\").text\n trial[:lead_sponsor_class] = trial_xml.xpath(\"//sponsors//lead_sponsor//agency_class\").text\n trial[:brief_summary] = trial_xml.xpath(\"//brief_summary//textblock\").text\n trial[:detailed_description] = trial_xml.xpath(\"//detailed_description//textblock\").text\n trial[:overall_status] = trial_xml.xpath(\"//overall_status\").text\n trial[:start_date] = trial_xml.xpath(\"//start_date\").text\n trial[:phase] = trial_xml.xpath(\"//phase\").text\n trial[:study_type] = trial_xml.xpath(\"//study_type\").text\n trial[:study_design] = trial_xml.xpath(\"//study_design\").text\n trial[:primary_outcome_measure] = trial_xml.xpath(\"//primary_outcome//measure\").text\n trial[:primary_outcome_time_frame] = trial_xml.xpath(\"//primary_outcome//time_frame\").text\n trial[:primary_outcome_safety_issue] = trial_xml.xpath(\"//primary_outcome//safety_issue\").text\n trial[:secondary_outcome_measure] = trial_xml.xpath(\"//secondary_outcome//measure\").text\n trial[:secondary_outcome_time_frame] = trial_xml.xpath(\"//secondary_outcome//time_frame\").text\n trial[:secondary_outcome_safety_issue] = trial_xml.xpath(\"//secondary_outcome//safety_issue\").text\n trial[:number_of_groups] = trial_xml.xpath(\"//number_of_arms\").text\n trial[:enrollment] = trial_xml.xpath(\"//enrollment\").text\n trial[:condition] = trial_xml.xpath(\"//condition\").text\n trial[:arm_group_label] = trial_xml.xpath(\"//arm_group//arm_group_label\").text\n trial[:arm_group_description] = trial_xml.xpath(\"//arm_group//description\").text\n trial[:eligibility_criteria_text] = trial_xml.xpath(\"//eligibility//criteria//textblock\").text\n trial[:gender] = trial_xml.xpath(\"//eligibility//gender\").text\n trial[:minimum_age] = clean_raw_age(trial_xml.xpath(\"//eligibility//minimum_age\").text, \"0\")\n trial[:maximum_age] = clean_raw_age(trial_xml.xpath(\"//eligibility//maximum_age\").text, \"150\")\n trial[:overall_official_name] = trial_xml.xpath(\"//overall_official//last_name\").text\n trial[:overall_official_role] = trial_xml.xpath(\"//overall_official//role\").text\n trial[:overall_official_affiliation] = trial_xml.xpath(\"//overall_official//affiliation\").text\n trial[:overall_contact_name] = trial_xml.xpath(\"//overall_contact//last_name\").text\n trial[:overall_contact_email] = trial_xml.xpath(\"//overall_contact//email\").text\n trial[:overall_contact_phone] = trial_xml.xpath(\"//overall_contact//phone\").text\n trial[:results_reference_citation] = trial_xml.xpath(\"//results_reference//citation\").text\n trial[:results_reference_PMID] = trial_xml.xpath(\"//results_reference//pmid\").text\n trial[:verification_date] = trial_xml.xpath(\"//verification_date\").text\n trial[:lastchanged_date] = trial_xml.xpath(\"//lastchanged_date\").text\n trial[:firstreceived_date] = trial_xml.xpath(\"//firstreceived_date\").text\n trial[:responsible_party_type] = trial_xml.xpath(\"//responsible_party_type\").text\n trial[:keyword] = trial_xml.xpath(\"//keyword\").text\n trial[:is_fda_regulated] = trial_xml.xpath(\"//is_fda_regulated\").text\n trial[:has_expanded_access] = trial_xml.xpath(\"//has_expanded_access\").text\n trial[:condition_browse_mesh_term] = trial_xml.xpath(\"//condition_browse//mesh_term\").text\n trial.save\n trial\nend", "def initialize(data, changeset)\n @reader = XML::Reader.string(data)\n @changeset = changeset\n # document that's (re-)used to handle elements expanded out of the\n # diff processing stream.\n @doc = XML::Document.new\n @doc.root = XML::Node.new(\"osm\")\n end", "def initialize(xml)\n @source = isxml?(xml) ? xml : File.read(xml)\n @doc_stream = AltoDocStream.new\n parser = Nokogiri::XML::SAX::Parser.new(doc_stream)\n parser.parse(@source)\n end", "def parse_text(text)\n\t\tNode.destroy_all(work_id: self.id)\n\t\tLink.destroy_all(work_id: self.id)\n\t\tLinkCollection.destroy_all(work_id: self.id)\n\n\t\tstack = Array.new\n\t\tnew_ordering= []\n\t\tlink_colls_queue = []\n\t\ttext.each_line do |line|\n\t\t\t#parser rules: any amount of whitespace followed immediately by < means new node. Otherwise, new note.\n\t\t\t#<TYPE.CATEGORY>TITLE\n\t\t\t#if the occurence of <*> is before the first occurence of \" then it's a new\n\t\t\t#@angleBracketLocation = line.index(/[ ,\\t]*<.*>/)\n\t\t\n\t\t\tfirst_char = get_text_from_regexp(line, /[ ,\\t]*(.)/)\n\t\t\n\t\t\t#if a new node should be made\n\t\t\tif first_char == '.'\n\t\t\t\tnew_node = Node.new\n\t\t\t\tbuild_node(new_node, line)\n\t\t\t\tnew_node.save\n\n\t\t\t\t#get the parent.\n\t\t\t\tdepth = new_node.depth\n\n\t\t\t\tnewNodeDepth = NodeDepth.new(new_node.id, depth)\n\t\t\t\t\n\t\t\t\tif depth == 0 #if it's a base element\n\t\t\t\t\tstack.push(newNodeDepth)\n\t\t\t\telse\n\t\t\t\t\tcurrNodeDepth = stack.pop\n\t\t\t\t\twhile depth <= currNodeDepth.depth do #while you're less deep, therefore it aint yo momma \n\t\t\t\t\t\tcurrNodeDepth = stack.pop\n\t\t\t\t\tend #at this point, @currNodeDepth is the nearest element that's not as deep as the new one, it's parent\n\t\t\t\t\tparentNode = Node.find(currNodeDepth.node_idnum)\n\t\t\t\t\tif parentNode.id == new_node.id #if it didn't find any parent\n\t\t\t\t\t\tparent_id = nil\n\t\t\t\t\telse\n\t\t\t\t\t\tparent_id = parentNode.id\n\t\t\t\t\tend\n\n\t\t\t\t\t#creates the link, and the sets the parent and child relation\n\t\t\t\t\trelation = Link.new(child_id: new_node.id, parent_id: parent_id, work_id: self.id)\n\t\t\t\t\trelation.save\n\t\t\t\t\tnew_node.parent_relationships << relation\n\t\t\t\t\tparentNode.child_relationships << relation\n\n\t\t\t\t\tstack.push(currNodeDepth)#push the parent back in, in case it has siblings\n\t\t\t\t\tstack.push(newNodeDepth)#push self in, in case it has children\n\n\t\t\t\t\t#@new_node.parent_relationships.build(child_id: @new_node.id, parent_id:@parentNode.id)\n\t\t\t\t\t#@new_node.parents << @parentNode\n\t\t\t\t\t#@parent_node.child=\n\t\t\t\t\t#make this nodes id into the parents child.\n\t\t\t\t\t#make the child's parent the parentNode's id.\n\t\t\t\tend\n\t\t\t\tnew_node.save\n\t\t\t\tnew_ordering.push(ObjectPlace.new(\"Node\", new_node.id))\n\n\t\t\t#if it's a note\n\t\t\telsif first_char == '-'\n\t\t\t\tnew_note = Note.new()\n\t\t\t\tbuild_note(new_note, line)\n\n\t\t\t\t#this is a bug. it just gets attached to the previous node without regard for depth\n\t\t\t\t#binding.pry\n\t\t\t\tif (new_note.depth != 0 && !stack.empty?) #if it could have a parent and there are possibilities\n\n\t\t\t\t\tcurrNodeDepth = stack.pop\n\t\t\t\t\twhile new_note.depth <= currNodeDepth.depth do #while you're less deep, therefore it aint yo momma \n\t\t\t\t\t\tcurrNodeDepth = stack.pop\n\t\t\t\t\tend #at this point, @currNodeDepth is the nearest element that's not as deep as the new one, it's parent\n\t\t\t\t\tparentNode = Node.find(currNodeDepth.node_idnum)\n\t\t\t\t\tstack.push(currNodeDepth)\n\t\t\t\t\n\t\t\t\t\tnew_note.node_id = parentNode.id\n\t\t\t\t\t#parentNode.add_note_to_combined(new_note)\n\t\t\t\tend\n\t\t\t\tnew_note.save\n\t\t\t\tnew_ordering.push(ObjectPlace.new(\"Note\", new_note.id))\t\t\t\t\n\t\t\t#for special chars\n\t\t\telsif first_char == ':'\n\n\t\t\t\t#ordering.insert(line_number, ObjectPlace.new(\"LinkCollection\", nil))\n\t\t\t\t#set_order(ordering)\n\t\t\t\t#parent_node = find_element_parent(link_coll_depth, line_number, ordering)\n\n\t\t\t\twhitespace = get_text_from_regexp(text, /(.*):/)\n\t\t\t\tlink_coll_depth = (whitespace.length)/3 #+2?\n\t\t\t\tparentNode = nil\n\t\t\t\tif (link_coll_depth != 0 && !stack.empty?) #if it could have a parent and there are possibilities\n\n\t\t\t\t\tcurrNodeDepth = stack.pop\n\t\t\t\t\twhile link_coll_depth <= currNodeDepth.depth do #while you're less deep, therefore it aint yo momma \n\t\t\t\t\t\tcurrNodeDepth = stack.pop\n\t\t\t\t\tend #at this point, @currNodeDepth is the nearest element that's not as deep as the new one, it's parent\n\t\t\t\t\tparentNode = Node.find(currNodeDepth.node_idnum)\n\t\t\t\t\tstack.push(currNodeDepth)\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tlink_coll = self.link_collections.build\n\t\t\t\tbuild_link_collection(link_coll, line, parentNode)\t\n\t\t\t\tlink_colls_queue.append({link_coll: link_coll, text: get_text_from_regexp(line, /:(.*)/)})\n\t\t\t\t#binding.pry\n\t\t\t\tnew_ordering.push(ObjectPlace.new(\"LinkCollection\", link_coll.id))\n\t\t\telse\n\t\t\t\tplace_holder = work.place_holders.create(text:line_content)\n\t\t\t\tnew_ordering.push(ObjectPlace.new(\"PlaceHolder\", place_holder.id))\n\t\t\tend\n\t\tend\n\n\t\tset_order(new_ordering)\n\t\t#at the end, build those links (appending the newly made nodes if needed.) This way, all nodes are mode before it thinks\n\t\t#it needs to be doing this shit\n\t\tlink_colls_queue.each do |link_coll_pair|\n\t\t\t#build its child links\n\t\t\tlink_coll_pair[:link_coll].set_links(link_coll_pair[:text])\n\t\tend\n\n\t\t#should fix this so I can get rid of populate_ordering, only works here because things are produced in order, can do it as I go\n\t\t#o = populate_ordering\n\tend", "def parse(document_xml)\n @xml = Nokogiri::XML(document_xml)\n\n # Iterate over each element node and dispatch it to the appropriate parser\n @xml.xpath('//w:body').children.each do |node|\n case node.name\n when 'p'\n no_numbering_prop = node.xpath('.//w:numPr').length.zero? || node.xpath('.//w:numPr/w:ilvl | .//w:numPr/w:numId').length.zero?\n not_multiparagraph_list_item = (@buffer.is_a?(Swordfish::Node::List) ? node.xpath('.//w:ind[@w:left]').length.zero? : true)\n if no_numbering_prop && not_multiparagraph_list_item\n # Regular paragraph\n # (The buffer check makes sure that this isn't an indented paragraph immediately after a list item,\n # which means we're most likely dealing with a multi-paragraph list item)\n flush\n @swordfish_doc.append _node_parse_paragraph(node)\n elsif node.xpath('.//w:numPr/ancestor::w:pPrChange').length.zero?\n # List paragraph\n # (must have a numPr node, but cannot have a pPrChange ancestor, since that means\n # we are just looking at historical changes)\n # (Don't flush because we need to first ensure the list is fully parsed)\n _node_parse_list(node)\n end\n when 'tbl'\n flush\n @swordfish_doc.append _node_parse_table(node)\n end\n end\n flush\n end", "def from_xml\n @children = xml_doc.xpath('//base/*').collect{ |child_node|\n build_child_from_xml child_node\n }\n end", "def parse\n self.new_part\n self.file_contents.each_line do |line|\n\n # parse the current line\n result = self.parser.parse(line, @@parse_signatures)\n\n # if there is no documentation for the result,\n # create a new part and then set the current part to nil.\n if result.nil?\n self.new_part\n self.current_part = nil\n next\n else\n\n # if new doc block is found with the current part == nil,\n # create a new part\n self.new_part if self.current_part.nil?\n end\n \n # log the result if the logger is enabled\n Logger.new(STDOUT).info(result) if @@log_lines\n\n # figure out what to do based on the result type\n case result[:tag]\n when :title\n self.title = result[:title]\n when :route\n self.current_part.set_route(result[:route])\n when :method\n self.current_part.set_method(result[:method])\n when :signature\n self.current_part.set_signature(result[:text])\n when :response\n\n # open the current response tag using the code as a key\n if result[:open]\n @@open_response = result[:code]\n @@open_response_id = result[:id]\n else\n @@open_response = nil\n end\n when :header\n\n # open the current header tag using the code as a key\n if result[:open]\n @@open_header = result[:name]\n else\n @@open_header = nil\n end\n when :param\n\n # open the current param tag using the name as the key\n if result[:open]\n @@open_param = result[:name]\n @@open_param_type = result[:type]\n @@open_param_default = result[:default]\n else\n @@open_param = nil\n end\n when :doc\n\n # figure out if the doc needs to be added to an\n # open response or param tag\n if !@@open_response.nil?\n self.current_part.append_response(@@open_response.to_i, @@open_response_id, result[:text])\n elsif !@@open_param.nil?\n self.current_part.append_param(@@open_param, result[:text], @@open_param_type, @@open_param_default)\n elsif !@@open_header.nil?\n self.current_part.append_header(@@open_header, result[:text])\n else\n self.current_part.append_doc(result[:text])\n end\n end\n\n self.lines += 1\n end\n\n # add the part and create a new one\n self.new_part\n\n # remove any empty parts or parts without method signatures (for ruby docs)\n if self.type == :RUBY\n self.parts = self.parts.select{ |part| !part.route.nil? || !part.signature.nil? }\n end\n end", "def from_xml(*args, &block)\n create_represented(*args, &block).from_xml(*args)\n end", "def jobs\r\n @parser.jobs\r\n end", "def initialize(o)\r\n @xml = o\r\n \r\n # map element names to methods, prolly not the best way to do this\r\n @xml.elements.each do |e|\r\n Mb_obj.class_eval(\"def #{e.name.to_s}() REXML::XPath.first(self.xml, \\\"#{e.name.to_s}).text\\\").text end\") \t \r\n end\r\n end", "def initialize(stats_xml)\n\t\t\t@hash = Hash.new\n\t\t\tfile = File.new(stats_xml)\n\t\t\tdoc = Document.new file\n\t\t\tprocess_xml(doc)\n\t\tend", "def import_xml(raw)\n doc = Nokogiri::XML(raw)\n\n @events = []\n doc.css('entry').each do |entry|\n fields = {\n :id => entry.css('id').text,\n :published => entry.css('published').text,\n :title => entry.css('title').text,\n :summary => entry.css('content').text,\n :start => DateTime.parse(entry.xpath('gd:when').first['startTime']),\n :end => DateTime.parse(entry.xpath('gd:when').first['endTime']),\n :where => entry.xpath('gd:where').first['valueString'],\n :url => entry.css('link').first['href']\n }\n \n @events << Event.new(fields)\n end\n\n return @events\n end", "def start\n parse!\n run\n end", "def create_new_work(params)\n @log.info 'Configuring work attributes'\n\n # set depositor\n depositor = User.find_by_user_key(@config['depositor'])\n raise 'User ' + @config['depositor'] + ' not found.' if depositor.nil?\n\n # set noid\n id = Noid::Rails::Service.new.minter.mint\n\n # set resource type\n resource_type = 'Thesis'\n unless params['resource_type'].first.nil?\n resource_type = params['resource_type'].first\n end\n\n # set visibility\n if params.key?('embargo_release_date')\n params['visibility_after_embargo'] = 'open'\n params['visibility_during_embargo'] = 'authenticated'\n else\n params['visibility'] = 'open'\n end\n\n # set admin set to deposit into\n unless @config['admin_set_id'].nil?\n params['admin_set_id'] = @config['admin_set_id']\n end\n\n # set campus\n params['campus'] = [@config['campus']]\n\n @log.info 'Creating a new ' + resource_type + ' with id:' + id\n\n if @config['type_to_work_map'][resource_type].nil?\n raise 'No mapping for ' + resource_type\n end\n\n model_name = @config['type_to_work_map'][resource_type]\n\n # student research but with a label that is otherwise Publication\n if params['degree_level'] || params['advisor']\n model_name = 'Thesis'\n end\n\n # create the actual work based on the mapped resource type\n model = Kernel.const_get(model_name)\n work = model.new(id: id)\n work.update(params)\n work.apply_depositor_metadata(depositor.user_key)\n work.save\n\n work\nend", "def prepare_final_xml\n @base_xml.elements[\"#{@ns}:OccupancyLevels/#{@ns}:OccupancyLevel/#{@ns}:OccupantQuantity\"].text = @occupant_quantity if !@occupant_quantity.nil?\n @base_xml.elements[\"#{@ns}:SpatialUnits/#{@ns}:SpatialUnit/#{@ns}:NumberOfUnits\"].text = @number_of_units if !@number_of_units.nil?\n\n # Add new element in the XML file\n add_user_defined_field_to_xml_file('OpenStudioModelName', @name)\n add_user_defined_field_to_xml_file('StandardTemplateYearOfConstruction', @built_year)\n add_user_defined_field_to_xml_file('StandardTemplate', @standard_template)\n add_user_defined_field_to_xml_file('BuildingRotation', @building_rotation)\n add_user_defined_field_to_xml_file('FloorHeight', @floor_height)\n add_user_defined_field_to_xml_file('WindowWallRatio', @wwr)\n add_user_defined_field_to_xml_file('PartyWallStoriesNorth', @party_wall_stories_north)\n add_user_defined_field_to_xml_file('PartyWallStoriesSouth', @party_wall_stories_south)\n add_user_defined_field_to_xml_file('PartyWallStoriesEast', @party_wall_stories_east)\n add_user_defined_field_to_xml_file('PartyWallStoriesWest', @party_wall_stories_west)\n add_user_defined_field_to_xml_file('Width', @width)\n add_user_defined_field_to_xml_file('Length', @length)\n add_user_defined_field_to_xml_file('PartyWallFraction', @party_wall_fraction)\n add_user_defined_field_to_xml_file('ModelNumberThermalZones', @model.getThermalZones.size)\n add_user_defined_field_to_xml_file('ModelNumberSpaces', @model.getSpaces.size)\n add_user_defined_field_to_xml_file('ModelNumberStories', @model.getBuildingStorys.size)\n add_user_defined_field_to_xml_file('ModelNumberPeople', @model.getBuilding.numberOfPeople)\n add_user_defined_field_to_xml_file('ModelFloorArea(m2)', @model.getBuilding.floorArea)\n\n wf = @model.weatherFile.get\n add_user_defined_field_to_xml_file('ModelWeatherFileName', wf.nameString)\n add_user_defined_field_to_xml_file('ModelWeatherFileDataSource', wf.dataSource)\n add_user_defined_field_to_xml_file('ModelWeatherFileCity', wf.city)\n add_user_defined_field_to_xml_file('ModelWeatherFileStateProvinceRegion', wf.stateProvinceRegion)\n add_user_defined_field_to_xml_file('ModelWeatherFileLatitude', wf.latitude)\n add_user_defined_field_to_xml_file('ModelWeatherFileLongitude', wf.longitude)\n prepare_final_xml_for_spatial_element\n end", "def create\n doc = Nokogiri::XML(request.body.read)\n cvNode = doc.xpath('elwak/checklisten_vorlage')\n cv = ChecklistenVorlage.new({\n objekt_id: cvNode.xpath('objekt_id').text.to_s, \n bezeichner: cvNode.xpath('bezeichner').text.to_s, \n version: cvNode.xpath('version').text.to_s.to_i, \n inaktiv: cvNode.xpath('inaktiv').text.to_s.to_bool \n })\n cv.save\n\n cvNode.xpath('checklisten_eintrags/checklisten_eintrag').each do |ceNode|\n ce = ChecklistenEintrag.new({\n checklisten_vorlage_id: cv.id,\n bezeichner: ceNode.xpath('bezeichner').text.to_s,\n was: ceNode.xpath('was').text.to_s,\n wann: ceNode.xpath('wann').text.to_s,\n typ: ceNode.xpath('typ').text.to_s.to_i,\n position: ceNode.xpath('position').text.to_s.to_i\n })\n ce.save\n end\n\n respond_to do |format|\n format.xml {render :xml => '<?xml version=\"1.0\" encoding=\"UTF-8\"?><success />'}\n end\n end", "def scrape_task(elem)\n # Initialize\n task = Task.new\n\n # Scrape task data\n begin\n task.title = scrape_css(elem, \"h3.eventTitle a\")\n\n # Scrape price\n value = scrape_css(elem, \"span.taskPriceEstimate span.value\")\n return \"\" if value.nil?\n unless value.empty?\n value = value.tr!(\"$\", \"\").split(\" - \") # Remove $ chars, Split by '-'\n task.min_price = value.first.to_i\n task.max_price = value.last.to_i\n task.avg_price = (task.min_price + task.max_price) / 2\n end\n rescue Exception => ex\n puts \"[ERROR] - #{ex.message}\"\n end\n\n return task\nend", "def parse_process_xml (xml)\n\n elt = REXML::Document.new(xml).root\n elt = elt.owfe_first_elt_child 'paused'\n\n {\n :paused => (elt.text.downcase == 'true')\n }\n end", "def parse\n parser = REXML::Parsers::SAX2Parser.new @stream \n parser.listen( :start_element ) do |uri, localname, qname, attributes|\n case qname\n when \"CougaarEvents\"\n @node = attributes['Node']\n @experiment = attributes['experiment']\n #puts \" Node: #{@node} Experiment: #{@experiment}\"\n @started = true\n when \"CougaarEvent\" \n @current = CougaarEvent.new\n @current.node = @node\n @current.data = \"\"\n @current.experiment = @experiment\n @current.event_type = attributes['type']\n @current.cluster_identifier = attributes['clusterIdentifier']\n @current.component = attributes['component']\n else\n @current.data << \"<#{qname}\"\n attributes.each do |key, value| \n @current.data << \" #{key} = \\\"#{value}\\\"\"\n end\n @current.data << \" >\"\n end\n end\n parser.listen( :end_element ) do |uri, localname, qname|\n case qname\n when \"CougaarEvents\"\n @node = nil\n @started = false\n when \"CougaarEvent\"\n @current.data = [@current.data].pack(\"m\")\n @listener.call(@current)\n @current = nil\n else\n @current.data << \"</#{qname}>\"\n end\n end\n parser.listen( :characters ) do | text |\n @current.data << text if @current\n end\n parser.listen( :cdata ) do | text |\n @current.data << text if @current\n end\n parser.parse\n end", "def initialize(xml=nil, target=nil, options={}, &block)\n \n @read_at = Time.new\n @noko = nil\n @source_xml = nil\n \n ## Use XML to build object\n from_xml(xml) if xml\n \n ## Use block for further configuration or manual creation\n self.instance_eval(&block) if block\n\n end", "def parse(xml_text)\n xml = XmlSimple.xml_in(xml_text, { 'ForceContent' => true })\n parse_block(xml['block'][0])\n end", "def process_xml\n parser = Parser.new(@bigframe_home)\n @xml = parser.parse_xml\n volume = \"bigframe.datavolume\"\n path_rel = \"bigframe.data.hdfspath.relational\"\n path_graph = \"bigframe.data.hdfspath.graph\"\n path_nested = \"bigframe.data.hdfspath.nested\"\n path_text = \"bigframe.data.hdfspath.text\"\n data_variety = \"bigframe.datavariety\"\n @data_variety = \"\"\n if @data_variety_rel == \"1\"\n @data_variety = @data_variety + \"relational, \"\n end\n if @data_variety_text == \"1\"\n @data_variety = @data_variety + \"nested, \"\n end\n if @data_variety_graph == \"1\"\n @data_variety = @data_variety + \"graph\"\n end\n if @data_variety[-2] == \",\"\n @data_variety = @data_variety[0..-3]\n end\n @xml[volume] = @data_volume\n @xml[path_rel] = @data_output + \"/\" + @xml[path_rel]\n @xml[path_graph] = @data_output + \"/\" + @xml[path_graph] \n @xml[path_nested] = @data_output + \"/\" + @xml[path_nested]\n @xml[path_text] = @data_output + \"/\" + @xml[path_text]\n @xml[data_variety] = @data_variety\n parser.build_xml(@xml)\n end", "def load_xml(str)\r\n @xml = REXML::Document.new(str.to_s)\r\n xml_to_instance\r\n self\r\n end", "def load!(xml)\n root = Nokogiri::XML(xml).root\n try(root.xpath(\"//network\")) do |network|\n try(network.xpath(\"name\")) { |result| self.name = result.text }\n try(network.xpath(\"uuid\")) { |result| self.uuid = result.text }\n try(network.xpath(\"bridge\")) { |result| self.bridge = Bridge.new(result) }\n try(network.xpath(\"ip\")) { |result| self.ip = IP.new(result) }\n end\n end", "def parse(xml)\n\n document = Nokogiri::XML(xml)\n entries = document.xpath(@xpath)\n @results.concat(entries.to_a)\n\n {:entries => entries, :nextpage => atomlink(document)}\n end", "def initialize(xmldoc)\n @xmldoc = xmldoc\n @output = {}\n end", "def factory(element_xml)\n OpenNebula::BackupJob.new(element_xml, @client)\n end", "def initialize(xml)\n #puts \"________________________________________\"\n #puts xml\n #puts \"________________________________________\"\n @doc = Nokogiri::XML(xml)\n parse_response\n end", "def build\n nodes << element_klass.new\n\n yield(nodes.last) if block_given?\n\n nodes.last\n end", "def parse filename\n doc = Document.new(File.new(filename))\n elements = doc.elements\n # Let each entity definition do it's own lower level parsing\n self.entities.each do |e|\n @instances[e.name] = e.parse(self, elements)\n end\n # Let each relationship definition do it's own lower level parsing\n self.relationships.each do |r|\n r.parse(self, @instances)\n end\n end", "def edit_with_nokogiri\n doc = Nokogiri.XML(read)\n yield doc if block_given?\n self.content = doc.to_xml\n save\n end", "def evaluate\n # First up validations\n @validations.each do |validate|\n next if validate.call\n return @xml\n end\n # Those passed, so next up is actual operations\n @operations.each do |operation|\n operation.call\n end\n return @xml\n end", "def from_xml(xml)\n b = xml.at(\"//xmlns:bibitem|//xmlns:bibdata\")\n r = mn2relaton_parser(xml.root.name)\n r.from_xml(b.to_xml)\n end", "def apply_xml(n)\n\t\tsuper(n)\n\n\t\t#First, set project\n\t\tp = n.at_xpath(\"xmlns:project\")\n\t\t# We're not always going to have a project! And this *doesn't* mean that this project is demoted\n\t\tif p\n\t\t\tconditional_set(:singleton, \t\t\tp.at_xpath(\"xmlns:singleton\"))\t\t\t\t\t{ |e| e.inner_html == \"true\" }\n\t\t\tconditional_set(:review_interval, p.at_xpath(\"xmlns:review-interval\") ) \t{ |e| Rubyfocus::ReviewPeriod.from_string(e.inner_html) }\n\t\t\tconditional_set(:last_review, \t\tp.at_xpath(\"xmlns:last-review\"))\t\t\t\t{ |e| Time.safely_parse e.inner_html }\n\t\t\tconditional_set(:status,\t\t\t\t\tp.at_xpath(\"xmlns:status\"))\t\t\t\t\t\t\t{ |e| e.inner_html.to_sym }\t\t\t\t\t\t\t\n\t\tend\n\tend", "def build_xml\n builder = Nokogiri::XML::Builder.new do |xml|\n xml.TrackRequest(:xmlns => \"http://fedex.com/ws/track/v5\"){\n add_web_authentication_detail(xml)\n add_client_detail(xml)\n add_version(xml)\n # add_request_timestamp(xml)\n add_track_request(xml)\n }\n end\n builder.doc.root.to_xml\n end", "def insert_vra_work(parms)\n\t node = Hydra::VRAWork.image_template({:title => parms[:title]}).root()\n\t nodeset = self.find_by_terms(:vra)\n unless nodeset.nil?\n\t\tself.ng_xml.root.add_child(node)\n self.content = self.ng_xml.to_s\n end\n return node\n end", "def scrape\n\t\turl = 'http://www.wsj.com/xml/rss/3_7455.xml'\n open(url) do |rss|\n \tfeed = RSS::Parser.parse(rss, false)\n puts \" \"\n puts \"*********************************\"\n \tputs \"Title: #{feed.channel.title}\"\n puts \"--------------------------------\"\n feed.items.each do |item|\n tags = tag_article(item.title.to_s)\n \tarticle = Article.new(title: item.title.to_s, \n summary: item.description.to_s.gsub(/\\\"/,''), \n link: item.link, \n date: item.pubDate.to_s.gsub(/,/,''),\n tag_list: tags, \n source: \"Wall Street Journal\")\n article.save\n end\n end\n end", "def process_xml\n @doc.css(\"Details\").children.each do |ir8arecord|\n data_map = {}\n\n # IR8ARecord --> ESubmissionSDSC --> IR8AST\n\n ir8arecord.child.child.children.each do |data|\n data_map[data.name] = data.content\n end\n\n @xml_map << data_map\n end\n\n @xml_map\n\n end", "def parse_xml(filename)\n @parser = Parser.new :pregenerated => filename\n @parser.parse\n end", "def new\n @work = Work.new\n end", "def parse(body)\n new Nokogiri body\n end", "def create_trial_sites_from_xml(trial_xml)\n sites = []\n trial_xml.xpath(\"//location\").each do |site|\n status = site.at(\"status\").text if site.at(\"status\")\n country = site.at(\"country\").text if site.at(\"country\")\n if status == \"Recruiting\" && (country == \"United States\" || country == \"Canada\")\n new_site = Site.new\n new_site.name = site.at(\"name\").text if site.at(\"name\")\n new_site.city = site.at(\"city\").text if site.at(\"city\")\n new_site.state = site.at(\"state\").text if site.at(\"state\")\n new_site.zip = site.at(\"zip\").text if site.at(\"zip\")\n new_site.country = country\n new_site.status = status\n new_site.contact_name = site.at(\"contact/last_name\").text if site.at(\"contact/last_name\")\n new_site.contact_phone = site.at(\"contact/phone\").text if site.at(\"contact/phone\")\n new_site.contact_phone_ext = site.at(\"contact/phone_ext\").text if site.at(\"contact/phone_ext\")\n new_site.contact_email = site.at(\"contact/email\").text if site.at(\"contact/email\")\n new_site.investigator_name = site.at(\"investigator/last_name\").text if site.at(\"investigator/last_name\")\n new_site.investigator_role = site.at(\"investigator/role\").text if site.at(\"investigator/role\")\n lat_long = find_lat_long({ zip: new_site.zip, city: new_site.city, state: new_site.state, country: new_site.country })\n new_site.latitude = lat_long[0]\n new_site.longitude = lat_long[1]\n new_site.save\n sites << new_site\n end\n end\n sites\nend", "def process(content, context, *args)\n document = Nokogiri::XML(content)\n Processor.process(document, context, *args).to_xml(indent: 0, save_with: 0)\n end", "def run\n if (@opt_schema) then\n file = File.new(\"/home/jmll/src/IPv6Suite/Etc/netconf.xsd\")\n else\n file = File.new(\"/home/jmll/src/IPv6Suite/Etc/HMIPv6Network-schema.xml\")\n end\n\n# doc = Document.new(string)\n @doc = Document.new(file)\n\n ###Pretty dumb you need to specify exactly which elements you want to listen to.\n\n# @parser = Parsers::SAX2Parser.new(File.new(file.path))\n# @parser.listen( %w{ xs:element xs:sequence xs:complexType xs:simpleType xs:attributeGroup xs:enumeration xs:attribute } ) do |uri, localname, qname, attrs|\n# next if localname =~ /annotation/\n# puts \"ln is #{localname}\"\n# #puts \"qname is #{qname}\"\n# #puts \"attrs is #{attrs}\"\n# end\n# @parser.parse\n\n parseSchema if @opt_schema\n parseSchemaInstance if not @opt_schema\n end", "def parse\n logger.debug \"Reading stoage file from: #{self.file.path}\"\n if self.status != 'finished'\n last_parsed_line = self.last_parsed_line\n # make_options\n begin\n # Match the proper parser and build options\n case self.file_type\n when \"1\"\n @parser = Wms::Input::Filetype1\n else\n raise \"Undefined storage type #{file_type}\"\n end\n # when \"wifilocation\"\n # @parser = Wms::Input::AndroidWifiLocation\n # when \"sensor\"\n # @parser = Wms::Input::AndroidSensor\n # when \"audio\"\n # raise \"Not Supported yet storage type #{file_type}\"\n # else\n # raise \"Undefined storage type #{file_type}\"\n # end\n\n @processor = @parser.new\n options = make_options\n @processor.register(options=options)\n\n @processor.run do |data|\n begin\n create_event data\n \n rescue Exception => e\n logger.error \"ERROR #{self.class.name}: #{e} for #{data}\"\n end\n last_parsed_line += 1\n end\n\n \n self.last_parsed_line = last_parsed_line\n self.status = \"finished\"\n self.save\n \n rescue Exception => e\n logger.error \"ERROR: [#{e}]\"\n self.last_parsed_line = last_parsed_line\n self.status = \"error\"\n self.save\n end # end begin\n \n end #end if self.status != 'finished'\n\n\n \n \n end", "def initialize(xml)\n @doc = Nokogiri::XML(xml)\n parse_response\n end", "def initialize(xml)\n @doc = Nokogiri::XML(xml)\n parse_response\n end", "def fill_out_work(work)\n work.title = self.title\n\n if self.bib_number.present?\n work.build_external_id(category: \"bib\", value: self.bib_number)\n end\n if self.accession_number.present?\n work.build_external_id(category: \"accn\", value: self.accession_number)\n end\n if self.museum_object_id.present?\n work.build_external_id(category: \"object\", value: self.museum_object_id)\n end\n if self.box.present? || self.folder.present?\n work.physical_container = {box: self.box.presence, folder: self.folder.presence}\n end\n if self.dimensions.present?\n work.extent = self.dimensions\n end\n\n if self.collecting_area == \"archives\"\n work.department = \"Archives\"\n elsif self.collecting_area == \"rare_books\" || self.collecting_area == \"modern_library\"\n work.department = \"Library\"\n elsif self.collecting_area == \"museum\"\n work.department = \"Museum\"\n end\n\n end", "def generate_xml\n\t\n\t\tbuilder = Nokogiri::XML::Builder.new do |xml|\n \t\t\txml.randomGeneratedData {\n \t\t\txml.parameters(nbStations: @inputs.nb_stations, nbDemands: @inputs.nb_demands)\n xml.stations {\n @list_stations.each do |s|\n\t\t\t\t\t\t\txml.station(\n\t\t\t\t\t\t\t\tid: s.id, \n\t\t\t\t\t\t\t\txPos: s.xPos, \n\t\t\t\t\t\t\t\tyPos: s.yPos,\n\t\t\t\t\t\t\t\tmaxSize: s.maxSize\n\t\t\t\t\t\t\t)\n end\n }\n \t\t\t\txml.demands {\n @list_demands.each do |d|\n \t\t\t\t\t\txml.demand(\n\t\t\t\t\t\t\t id: d.id,\n\t\t\t\t\t\t\t\tidsOrigin: d.sOrigin.id, \n\t\t\t\t\t\t\t\tidsDestination: d.sDestination.id, \n\t\t\t\t\t\t\t\tnbDemand: d.nbDemand,\n\t\t\t\t\t\t\t\tdepartureTime: d.departureTime_TS,\n\t\t\t\t\t\t\t\tarrivalTime: d.arrivalTime_TS\n \t\t\t\t\t\t)\n end\n \t\t\t\t}\n \t\t\t}\n\t\tend\n\t\t\n\t\treturn builder.to_xml\n\tend", "def createProgramXMLSection( houseElements )\n loc = \"HouseFile\"\n houseElements[loc].add_element(\"Program\")\n\n loc = \"HouseFile/Program\"\n houseElements[loc].attributes[\"class\"] = \"ca.nrcan.gc.OEE.ERS.ErsProgram\"\n houseElements[loc].add_element(\"Labels\")\n\n loc = \"HouseFile/Program/Labels\"\n houseElements[loc].attributes[\"xmlns:xsi\"] = \"http://www.w3.org/2001/XMLSchema-instance\"\n houseElements[loc].attributes[\"xmlns:xsd\"] = \"http://www.w3.org/2001/XMLSchema\"\n houseElements[loc].add_element(\"English\")\n loc = \"HouseFile/Program/Labels/English\"\n houseElements[loc].add_text(\"EnerGuide Rating System\")\n loc = \"HouseFile/Program/Labels\"\n houseElements[loc].add_element(\"French\")\n loc = \"HouseFile/Program/Labels/French\"\n houseElements[loc].add_text(\"Système de cote ÉnerGuide\")\n\n loc = \"HouseFile/Program\"\n houseElements[loc].add_element(\"Version\")\n loc = \"HouseFile/Program/Version\"\n houseElements[loc].attributes[\"xmlns:xsi\"] = \"http://www.w3.org/2001/XMLSchema-instance\"\n houseElements[loc].attributes[\"xmlns:xsd\"] = \"http://www.w3.org/2001/XMLSchema\"\n houseElements[loc].attributes[\"major\"] = \"15\"\n houseElements[loc].attributes[\"minor\"] = \"1\"\n houseElements[loc].attributes[\"build\"] = \"19\"\n houseElements[loc].add_element(\"Labels\")\n loc = \"HouseFile/Program/Version/Labels\"\n houseElements[loc].add_element(\"English\")\n loc = \"HouseFile/Program/Labels/English\"\n houseElements[loc].add_text(\"v15.1b19\")\n loc = \"HouseFile/Program/Version/Labels\"\n houseElements[loc].add_element(\"French\")\n loc = \"HouseFile/Program/Labels/French\"\n houseElements[loc].add_text(\"v15.1b19\")\n\n loc = \"HouseFile/Program\"\n houseElements[loc].add_element(\"SdkVersion\")\n loc = \"HouseFile/Program/SdkVersion\"\n houseElements[loc].attributes[\"xmlns:xsi\"] = \"http://www.w3.org/2001/XMLSchema-instance\"\n houseElements[loc].attributes[\"xmlns:xsd\"] = \"http://www.w3.org/2001/XMLSchema\"\n houseElements[loc].attributes[\"major\"] = \"1\"\n houseElements[loc].attributes[\"minor\"] = \"11\"\n houseElements[loc].add_element(\"Labels\")\n loc = \"HouseFile/Program/SdkVersion/Labels\"\n houseElements[loc].add_element(\"English\")\n loc = \"HouseFile/Program/Labels/English\"\n houseElements[loc].add_text(\"v1.11\")\n loc = \"HouseFile/Program/SdkVersion/Labels\"\n houseElements[loc].add_element(\"French\")\n loc = \"HouseFile/Program/Labels/French\"\n houseElements[loc].add_text(\"v1.11\")\n\n loc = \"HouseFile/Program\"\n houseElements[loc].add_element(\"Options\")\n loc = \"HouseFile/Program/Options\"\n houseElements[loc].attributes[\"xmlns:xsi\"] = \"http://www.w3.org/2001/XMLSchema-instance\"\n houseElements[loc].attributes[\"xmlns:xsd\"] = \"http://www.w3.org/2001/XMLSchema\"\n houseElements[loc].add_element(\"Main\")\n loc = \"HouseFile/Program/Options/Main\"\n houseElements[loc].attributes[\"applyHouseholdOperatingConditions\"] = \"false\"\n houseElements[loc].attributes[\"applyReducedOperatingConditions\"] = \"false\"\n houseElements[loc].attributes[\"atypicalElectricalLoads\"] = \"false\"\n houseElements[loc].attributes[\"waterConservation\"] = \"false\"\n houseElements[loc].attributes[\"referenceHouse\"] = \"false\"\n houseElements[loc].add_element(\"Vermiculite\")\n loc = \"HouseFile/Program/Options/Main/Vermiculite\"\n houseElements[loc].attributes[\"code\"] = \"1\"\n houseElements[loc].add_element(\"English\")\n loc = \"HouseFile/Program/Options/Main/Vermiculite/English\"\n houseElements[loc].add_text(\"Unknown\")\n loc = \"HouseFile/Program/Options/Main/Vermiculite\"\n houseElements[loc].add_element(\"French\")\n loc = \"HouseFile/Program/Options/Main/Vermiculite/French\"\n houseElements[loc].add_text(\"Inconnu\")\n loc = \"HouseFile/Program/Options\"\n houseElements[loc].add_element(\"RURComments\")\n loc = \"HouseFile/Program/Options/RURComments\"\n houseElements[loc].attributes[\"xml:space\"] = \"preserve\"\n\n loc = \"HouseFile/Program\"\n houseElements[loc].add_element(\"Results\")\n loc = \"HouseFile/Program/Results\"\n houseElements[loc].attributes[\"xmlns:xsi\"] = \"http://www.w3.org/2001/XMLSchema-instance\"\n houseElements[loc].attributes[\"xmlns:xsd\"] = \"http://www.w3.org/2001/XMLSchema\"\n houseElements[loc].add_element(\"Tsv\")\n houseElements[loc].add_element(\"Ers\")\n houseElements[loc].add_element(\"RefHse\")\n\nend" ]
[ "0.5928454", "0.5889597", "0.5782293", "0.57218707", "0.5679979", "0.5646381", "0.5618511", "0.5566267", "0.5561271", "0.55488926", "0.5523513", "0.5500408", "0.5479861", "0.54796576", "0.54609215", "0.5425286", "0.5416991", "0.5415916", "0.5390891", "0.53864044", "0.5359866", "0.53527516", "0.53439444", "0.5332903", "0.53207123", "0.5319704", "0.53129363", "0.529934", "0.5293755", "0.52814436", "0.5274156", "0.5273546", "0.5260227", "0.52407175", "0.52389795", "0.52338904", "0.5225002", "0.5220729", "0.5193432", "0.51920784", "0.51530194", "0.5132038", "0.512084", "0.51051724", "0.51047206", "0.5102405", "0.51021624", "0.5095194", "0.5090088", "0.5082491", "0.50635636", "0.50632256", "0.50546056", "0.5044442", "0.50420445", "0.50414866", "0.50308764", "0.5028572", "0.50285524", "0.5022494", "0.5016193", "0.50032383", "0.5000406", "0.4996556", "0.49964163", "0.49956617", "0.49927083", "0.49922004", "0.49903455", "0.49793187", "0.49790415", "0.49727914", "0.49712834", "0.49688601", "0.4965367", "0.49630922", "0.49599218", "0.49554974", "0.4951685", "0.49455282", "0.49395308", "0.4938694", "0.49364913", "0.49332777", "0.49331525", "0.49280632", "0.49263167", "0.49205482", "0.49164745", "0.4916256", "0.49149647", "0.4914469", "0.49066982", "0.49032706", "0.49020502", "0.4898513", "0.4898513", "0.48961473", "0.4894493", "0.4892484" ]
0.7075035
0
FileSets can include any metadata listed in BasicMetadata file
def file_record(work_attributes) file_set = FileSet.new file_attributes = Hash.new # Singularize non-enumerable attributes work_attributes.each do |k,v| if file_set.attributes.keys.member?(k.to_s) if !file_set.attributes[k.to_s].respond_to?(:each) && work_attributes[k].respond_to?(:each) file_attributes[k] = v.first else file_attributes[k] = v end end end file_attributes[:visibility] = work_attributes['visibility'] unless work_attributes['embargo_release_date'].blank? file_attributes[:embargo_release_date] = work_attributes['embargo_release_date'] file_attributes[:visibility_during_embargo] = work_attributes['visibility_during_embargo'] file_attributes[:visibility_after_embargo] = work_attributes['visibility_after_embargo'] end file_attributes end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def metadata_file; end", "def metadata_file; end", "def load_workset( filename )\n\n md_filename = ''\n asset_files = []\n File.open( filename, 'r').each do |line|\n if /^metadata : /.match( line )\n md_filename = /^metadata : (.*)$/.match( line ).captures[ 0 ]\n end\n\n if /^asset : /.match( line )\n asset_files << /^asset : (.*)$/.match( line ).captures[ 0 ]\n end\n end\n\n return md_filename, asset_files\n end", "def metadata_file\n study_files.any_of(\n { file_type: 'Metadata' },\n { file_type: 'AnnData', 'ann_data_file_info.has_metadata' => true }\n ).first\n end", "def file_sets_missing_metadata\n FileSet.all.select do |fs|\n fs.original_file && fs.original_file.file_size == []\n end\n end", "def metadata_files\n return @metadata_files unless @metadata_files.nil?\n @metadata_files = MetadataFile.all\n @existing_files, @new_files = [], []\n @metadata_files.each do |f|\n if f.cached?\n @existing_files << f\n else\n @new_files << f\n end\n end\n end", "def file_set_append\n # Append the array of file metadata values to any FileSets with new FileNodes being appended\n parent.file_metadata += file_nodes\n file_nodes\n end", "def metadata_file\n [site.regenerator.metadata_file]\n end", "def file_set?(resource)\n resource.respond_to?(:file_metadata) && !resource.respond_to?(:member_ids)\n end", "def read_metadata; end", "def update_fileset_metadata(work, attrs)\n work.ordered_members.to_a.each_with_index do |member, i|\n builder = FileSetBuilder.new(member, user, attrs[i])\n builder.run\n end\n end", "def find_files(file_set:)\n if file_set.respond_to?(:file_ids)\n return [] unless file_set.file_ids.present?\n query_service.custom_queries.find_many_file_metadata_by_ids(ids: file_set.file_ids)\n else\n raise ::Valkyrie::Persistence::ObjectNotFoundError,\n \"#{file_set.internal_resource} is not a `Hydra::FileSet` implementer\"\n end\n end", "def find_files(file_set:)\n if file_set.respond_to?(:file_ids)\n return [] if file_set.file_ids.blank?\n query_service.custom_queries.find_many_file_metadata_by_ids(ids: file_set.file_ids)\n else\n raise ::Valkyrie::Persistence::ObjectNotFoundError,\n \"#{file_set.internal_resource} is not a `Hydra::FileSet` implementer\"\n end\n end", "def metadata_group(upload_group)\n upload_group.each_with_object({}) do |upload, obj|\n obj[upload.filename] = metadata.for(upload.filename)\n end\n end", "def file_sets\n @iss_file.file_sets.select {|fs| fs.components.include? name }\n end", "def metadata; end", "def metadata; end", "def metadata; end", "def metadata; end", "def metadata; end", "def metadata; end", "def metadata; end", "def external_file_attributes; end", "def metadata(*args)\n opts = args.extract_options!\n args.each do |name|\n self.add_metadata(name, opts)\n end\n end", "def object_filesets_for_export(object_files, include_files = true)\n %w[metadata text].inject([]) do |ret, fileset_type|\n next ret if object_files[fileset_type.to_sym].blank?\n object_fileset = {\n created_at: create_date,\n updated_at: modified_date,\n file_set_of: { ark_id: pid },\n file_set_type: fileset_type,\n file_name_base: \"#{pid}_#{fileset_type}\",\n metastreams: {\n administrative: { access_edit_group: rightsMetadata.access(2).machine.group },\n workflow: {\n ingest_origin: ingest_origin_for_workflow,\n processing_state: workflowMetadata.item_status.state[0] == 'published' ? 'complete' : 'derivatives'\n }.compact\n }\n }\n exemplary_ids = []\n relationships.each_statement do |statement|\n if statement.predicate =~ /isExemplaryImageOf/\n exemplary_ids << statement.object.to_s.gsub(/info:fedora\\//,'')\n end\n end\n unless exemplary_ids.blank?\n object_fileset[:exemplary_image_of] = []\n exemplary_ids.uniq.each do |pid|\n object_fileset[:exemplary_image_of] << { ark_id: pid }\n end\n end\n object_fileset[:files] = object_files[fileset_type.to_sym] if include_files\n ret << { file_set: object_fileset }\n end\n end", "def apply_file_metadata(params)\n uploaded_file_ids = params[\"uploaded_files\"]\n return if uploaded_file_ids.nil?\n uploaded_file_ids.each do |uploaded_file_id|\n uploaded_file = find_or_create_uploaded_file(uploaded_file_id)\n next if uploaded_file.pcdm_use == \"primary\"\n apply_metadata_to_uploaded_file(uploaded_file, params)\n end\n params[\"etd\"].delete(\"supplemental_file_metadata\")\n params # return the params after processing, for ease of testing\n end", "def existing_files\n metadata_files if @existing_files.nil?\n @existing_files\n end", "def load_file_metadata(file, *fallback_keys)\n path = File.expand_path(file)\n\n keys = if Gem::Requirement.create(\">= #{BASELINE_VERSION}\").satisfied_by?(Gem::Version.new(@version))\n # gather available metadata keys from file if '-m' option is supported\n @sh.run_command(@bin.to_path, '-m', path).split($/)\n elsif fallback_keys.count > 0\n # else use fallback keys (if any)\n fallback_keys.map!(&:to_s)\n warn \"MultiMarkdown version #{@version} does not support the '-m' option.\"\n warn \"Only the following metadata will be queried:#{list_join(*fallback_keys)}\"\n fallback_keys\n end\n keys.each.with_object({}) do |key, data| data[key] = @sh.run_command(@bin.to_path, '-e', key, path) end\n end", "def extract_metadata; end", "def external_metadata_file?\n false\n end", "def metadata(filepath)\n metadata = {}\n metadata.merge!(author(filepath))\n metadata.merge!(title(filepath))\n metadata.merge!(serie(filepath))\n metadata\n end", "def metadata=(_); end", "def attributes_for_file_sets(env)\n visibility_attributes =\n FileSetVisibilityAttributeBuilder\n .new(work: env.curation_concern)\n .build\n\n env.attributes.merge!(visibility_attributes)\n\n env.attributes.except!(:embargo_release_date) unless\n env.curation_concern.files_embargoed\n\n true\n end", "def find_metadata(*args)\n results = []\n @filesets.each do |volid, fileset|\n results += fileset.find_metadata(*args)\n end\n return results\n end", "def internal_file_attributes; end", "def file_sets\n @file_sets ||= begin\n geo_concern.geo_file_set_presenters\n end\n end", "def file_set\n @file_set ||= begin\n members = resource_decorator.geo_members\n members.first.decorate unless members.empty?\n end\n end", "def load_metadata\n begin\n load RAILS_ROOT + '/app/metadata/' + self.name.to_s.underscore + '.rb'\n rescue MissingSourceFile\n end\n end", "def metadata_file_set_field?(key)\n field = metadata_field(key)\n return field[:object] != :monograph if field.present?\n false\n end", "def metadata\n metadata = {}\n @file.data.each { |key, value| metadata[key.to_sym] = value }\n\n metadata[:type] = @file.class.name.split('::')[1].downcase\n metadata[:url] = @file.url\n\n metadata[:slug] = slug\n\n metadata[:posted_at] = @file.date.to_time.to_i if @file.respond_to? :date\n metadata[:tags] = tags\n\n metadata\n end", "def representative_file\n file_key = metadata.keys.find { |k| k.to_s =~ /(representative_)?files?/i }\n return [] if file_key.nil?\n\n metadata.fetch(file_key, [])\n end", "def masterfile_keys\n ['gtin', 'tranno']\n end", "def create_metadata(work, file_set_params = {})\n file_set.apply_depositor_metadata(user)\n now = CurationConcerns::TimeService.time_in_utc\n file_set.date_uploaded = now\n file_set.date_modified = now\n file_set.creator = [user.user_key]\n\n interpret_visibility file_set_params if assign_visibility?(file_set_params)\n attach_file_to_work(work, file_set, file_set_params) if work\n yield(file_set) if block_given?\n end", "def applicable_files; end", "def metadata\n return @metadata if @metadata\n return nil unless value\n value.each do |source|\n begin\n if data = Puppet::FileServing::Metadata.indirection.find(source)\n @metadata = data\n @metadata.source = source\n break\n end\n rescue => detail\n fail detail, \"Could not retrieve file metadata for #{source}: #{detail}\"\n end\n end\n fail \"Could not retrieve information from environment #{Puppet[:environment]} source(s) #{value.join(\", \")}\" unless @metadata\n @metadata\n end", "def compile_metadata\n each do |cookbook_name, cookbook|\n compiled_metadata = cookbook.compile_metadata\n if compiled_metadata\n cookbook.all_files << compiled_metadata\n cookbook.cookbook_manifest.send(:generate_manifest)\n end\n end\n end", "def set_metadata( file_list, tag_hash)\n file_list = [*file_list] # make sure file_list is an array\n file_list.each do |file_name|\n if File.exist?(file_name) \n ok = TagLib::FileRef.open(file_name) do |f|\n tag = f.tag\n tag_hash.each do |tag_name, value|\n\n # make sure that the tag_nam (hash key) is a string and then add = to it\n if tag_name.class != String\n tag_name = tag_name.to_s\n end\n tag_name += \"=\"\n\n if tag.respond_to?(tag_name)\n tag.send(tag_name, value)\n else\n puts \"can't modify tag #{tag_name}\"\n end\n end\n f.save\n end\n if ok == false then\n puts \"uh-oh. There was a problem saving/opening #{f}, it's tags were not modified.\"\n end\n else\n puts \"file #{file_name} does not exist, so its tags were not updated.\"\n end\n end\n end", "def file_sets_for(work)\n Hyrax.custom_queries.find_child_file_sets(resource: work)\n end", "def metadata_file\n @metadata_file ||= site.in_source_dir(\".jekyll-metadata\")\n end", "def metadata\n return @metadata if @metadata\n return nil unless value\n #debug 'fragment get metadata from source'\n value.each do |source|\n begin\n if data = Puppet::FileServing::Metadata.indirection.find(source, :environment => resource.catalog.environment)\n @metadata = data\n @metadata.source = source\n break\n end\n rescue => detail\n fail detail, \"Could not retrieve file metadata for #{source}: #{detail}\"\n end\n end\n fail \"Could not retrieve information from environment #{resource.catalog.environment} source(s) #{value.join(\", \")}\" unless @metadata\n @metadata\n end", "def special_files\n @special_files ||= Set.new\n end", "def file_set\n @file_set ||= resource_decorator.geo_members&.first\n end", "def linkMetadataToResults(metas)\n\n # Go through metadata\n # m - has all metadata combined\n m = {} \n metas.each do |t|\n # Skip metadata from old blobs\n if t.metadata_blob_id != nil && t.devfile_blob_id != t.metadata_blob_id\n next\n end\n \n # n - has metadata of one file \n n = {}\n \n store = m[t.devfile_id]\n \n # Is there already data for this devfile_id\n if store == nil\n # No data for this devfile yet, create it\n n.merge!({t.metadatatype => t.metadata_value})\n \n # Add metadata of this file to combined metadata\n m.merge!({t.devfile_id => n })\n\n else\n block = store[t.metadatatype]\n\n # Is there already this metadatatype\n if block == nil\n # Create the new metadatatype for this file\n store.merge!({t.metadatatype => t.metadata_value})\n elsif t.metadatatype == \"tag\" or t.metadatatype == \"context_hash\"\n # Add new metadatatype for this file\n store.merge!({t.metadatatype => block + \", \" + t.metadata_value})\n end\n \n # Add metadata of this file to combined metadata\n m.merge!({t.devfile_id => store }) \n end\n end \n \n \n \n \n # link metadata to right result, with hash\n @results.each do |r|\n mdata = m[r.devfile_id.to_i]\n if mdata != nil\n #puts \"r: #{r.devfile_file_id.to_s}\"\n @metadatas.merge!({r.devfile_id.to_i => mdata})\n end\n end\n \n \n\n \n \n end", "def addMetadata(filename, metadatatype, metadatavalue)\n begin\n \n if @fileMetadata.has_key?(filename)\n @fileMetadata[filename] = @fileMetadata[filename].to_s + \"&&&\" + metadatatype.downcase + \":\" + metadatavalue.downcase\n else\n @fileMetadata[filename] = metadatatype.downcase + \":\" + metadatavalue.downcase\n end\n \n rescue Exception => e\n puts \"Error: #{e.to_s}\"\n puts \" -- line: #{e.backtrace[0].to_s}\"\n raise Exception.new(\"Could not add metadata to a new file!\")\n end\n end", "def new_files\n metadata_files if @existing_files.nil?\n @new_files\n end", "def metadata\n @metadata ||= lambda { read_metadata }.call\n end", "def metadata\n @metadata ||= lambda { read_metadata }.call\n end", "def metadata?\n true\n end", "def test_each_file_returns_data\n files = NutrientDataSet::META_DATA.keys\n files.each do |name|\n parser = data[\"nutr_def\"]\n row = parser.take(1)\n \n assert !row.empty?, \"Expected data for #{name} to exist.\"\n end\n end", "def run\n admin_set\n return unless errors.empty?\n metadata_files.each { |file| parse_metadata(file) }\n end", "def file_set\n @file_set ||= begin\n member_id = resource_decorator.thumbnail_id.try(:first)\n return nil unless member_id\n members = resource_decorator.geo_members.select { |m| m.id == member_id }\n members.first.decorate unless members.empty?\n end\n end", "def load_metadata\n ret = tar.seek('metadata.yml') do |entry|\n YAML.load(entry.read)\n end\n fail 'metadata.yml not found' unless ret\n @metadata = ret\n ret\n end", "def initialize metadata = nil, files = nil\n @metadata = metadata || Metadata.new\n @files = files || []\n end", "def add_fileset\n\n # grab the parameters\n work_id = params[:work]\n file_id = params[:file]\n label = params[:label]\n\n # validate them\n if work_id.blank? == false && file_id.blank? == false && label.blank? == false\n work = get_the_work( work_id )\n if work.nil? == false\n filename = APIV1FilesetsController.cache_contents( file_id )\n if filename.blank? == false\n fileset = ::FileSet.new\n fileset.title << label\n file_actor = ::CurationConcerns::Actors::FileSetActor.new( fileset, @api_user )\n file_actor.create_metadata( work )\n file_actor.create_content( File.open( filename ) )\n fileset.visibility = Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC\n fileset.save!\n\n # audit the information\n #audit_log( \"File #{label} for work id #{work_id} (#{work.identifier}) added by #{User.cid_from_email( @api_user.email)}\" )\n WorkAudit.audit( work_id, User.cid_from_email( @api_user.email), \"File #{File.basename( filename )}/#{label} added\" )\n\n render_standard_response( :ok )\n else\n render_standard_response( :not_found, 'File not found' )\n end\n else\n render_standard_response( :not_found, 'Work not found' )\n end\n else\n render_standard_response( :unauthorized, 'Missing work identifier or file identifier or file label' )\n end\n\n end", "def initialize(name, metadata = {})\n super\n @files = {}\n end", "def load_metadata(groups)\n nameset = groups.values.flatten.uniq\n basenames = nameset.map { |n| File.basename(n) }\n names = basenames.join(' ')\n raw = JSON.parse(%x(brew info --json=v1 #{names}))\n\n raw.inject({}) do |named, entry|\n named[entry['full_name']] = entry\n named\n end\nend", "def get_metadata_file album\n Albatross::ThrowIf.is_nil? album, \"album\"\n \"storage/dropbox/#{album}.yml\"\nend", "def update_metadata(file)\n metadata = MetadataEngine.new(file)\n\n # Special renaming case for misc files that do not need the tracklist\n if metadata.filepath.get_type == \"misc\"\n metadata.tags.artist = metadata.filepath.artist\n metadata.tags.year = metadata.filepath.year\n metadata.tags.album = metadata.filepath.album\n metadata.tags.cd = metadata.filepath.cd\n metadata.tags.index = metadata.filepath.index\n metadata.tags.title = metadata.filepath.title\n metadata.tags.save\n return\n end\n\n unless metadata.tracklist.has_tracklist?\n puts \"No .tracklist found for #{file}, generating it now.\"\n %x[generate-tracklist #{file.shellescape}]\n metadata = MetadataEngine.new(file)\n end\n\n # Update tags to reflect what's in the tracklist\n metadata.tags.artist = metadata.tracklist.artist\n metadata.tags.year = metadata.tracklist.year\n metadata.tags.album = metadata.tracklist.album\n metadata.tags.cd = metadata.tracklist.cd\n metadata.tags.index = metadata.tracklist.index\n metadata.tags.title = metadata.tracklist.title\n metadata.tags.type = metadata.tracklist.type\n metadata.tags.save\n\n # Update filepath to rename files based on new metadata\n metadata.filepath.artist = metadata.tracklist.artist\n metadata.filepath.year = metadata.tracklist.year\n metadata.filepath.album = metadata.tracklist.album\n metadata.filepath.cd = metadata.tracklist.cd\n metadata.filepath.index = metadata.tracklist.index\n metadata.filepath.title = metadata.tracklist.title\n metadata.filepath.save\n end", "def metadata_info\n @metadata = Chef::Cookbook::Metadata.new\n @metadata.from_file(File.join(@opts[:path], 'metadata.rb'))\n end", "def add_metadata(meta={})\n @local_metadata.deep_merge!(meta.dup)\n end", "def export_metadata_only\n File.foreach(File.join(@export_dir, @pidlist)) do |line|\n begin\n short_pid = strip_pid(line.strip)\n item = GenericAsset.find(line.strip)\n rem_graph = remediate(@remediation, item.descMetadata.graph)\n bag = BagIt::Bag.new(File.join(@bags_dir, short_pid))\n export_profile(item, rem_graph, short_pid)\n export_metadata(item, rem_graph, short_pid)\n export_workflow_metadata_profile(item, short_pid)\n bag_finisher(bag)\n rescue StandardError => e\n message = \"Error #{e.message}:#{e.backtrace.join(\"\\n\")}\"\n puts message if @verbose\n @logger.error(message)\n end\n end\n end", "def files; end", "def files; end", "def files; end", "def files; end", "def files; end", "def files; end", "def metadata\n if config.metadata.include?(:all)\n [:pid, :date, :time, :file]\n else\n config.metadata\n end\n end", "def metadata\n if config.metadata.include?(:all)\n [:pid, :date, :time, :file]\n else\n config.metadata\n end\n end", "def metadata\n result = store.metadata_for_path(path).dup\n\n file_meta = store.metadata_for_file(source_file).dup\n result.deep_merge!(file_meta)\n\n local_meta = @local_metadata.dup\n result.deep_merge!(local_meta)\n\n result\n end", "def metadata(options: DEFAULT_OPTIONS)\n output = %x(exiftool #{options} -json #{file.path.shellescape})\n json = JSON.parse(output).first\n json = json.except(\"SourceFile\")\n ExifTool::Metadata.new(json.with_indifferent_access)\n end", "def special_files=(files)\n @special_files = Set.new(files)\n end", "def files\n file_sets.map{|fs| fs.files }.flatten\n end", "def metadata\n return @metadata unless @metadata.nil?\n\n @metadata = Chef::Cookbook::Metadata.new\n\n metadata_filenames.each do |metadata_file|\n case metadata_file\n when /\\.rb$/\n apply_ruby_metadata(metadata_file)\n when uploaded_cookbook_version_file\n apply_json_cookbook_version_metadata(metadata_file)\n when /\\.json$/\n apply_json_metadata(metadata_file)\n else\n raise \"Invalid metadata file: #{metadata_file} for cookbook: #{cookbook_version}\"\n end\n end\n\n @metadata\n\n # Rescue errors so that users can upload cookbooks via `knife cookbook\n # upload` even if some cookbooks in their chef-repo have errors in\n # their metadata. We only rescue StandardError because you have to be\n # doing something *really* terrible to raise an exception that inherits\n # directly from Exception in your metadata.rb file.\n rescue StandardError => e\n @metadata_error = e\n @metadata\n end", "def metadata_path\n File.join(Rake.original_dir, 'metadata.rb')\nend", "def files_set\n if settings.fs_created + 12 < Time.now\n settings.fs = FuzzySet.new(repo.files)\n settings.fs_created = Time.now\n end\n settings.fs\n end", "def write_metadata; end", "def write_metadata(variable_set: nil)\n @data_file << variable_set.keys if @data_lib.csv_opt[:headers]\n end", "def create_file_set(import_url: nil, label: nil)\n file_set = FileSet.new(import_url: import_url, label: label)\n\n file_set.apply_depositor_metadata(user)\n now = CurationConcerns::TimeService.time_in_utc\n file_set.date_uploaded = now\n file_set.date_modified = now\n file_set.creator = [user.user_key]\n\n visibility_params = {\n visbility: work.visibility,\n embargo_release_date: work.embargo_release_date,\n lease_expiration_date: work.lease_expiration_date\n }.compact\n if visibility_params.present?\n CurationConcerns::Actors::ActorStack.new(file_set, user, [CurationConcerns::Actors::InterpretVisibilityActor]).create(visibility_params)\n end\n\n # We have a weird hard to reproduce bug involving\n # NoMethodError: undefined method 'update' for nil:NilClass at\n # hydra-access-controls-10.4.0/app/models/hydra/access_control.rb:31 :in 'block in permissions_attributes=``\n #\n # Can't reproduce on demand, not sure what's going on, but hoping that maybe\n # saving the file_set _before_ trying to set permissions will be helpful.\n file_set.save!\n\n work_permissions = work.permissions.map(&:to_hash)\n if work_permissions.present?\n file_set.permissions_attributes = work_permissions\n # no additional save seems necessary after doing permissions_attributes=, seems to do it's own save of what's\n # needed...\n end\n\n return file_set\n end", "def write_metadata(variable_set: nil)\n end", "def update_metadata\n file_attributes = ::FileSetEditForm.model_attributes(attributes)\n actor.update_metadata(file_attributes)\n end", "def metadata?\n true\n end", "def file_metadata_present?\n @file_metadata_present = !!file_metadata_before_type_cast.present? if @file_metadata_present.nil?\n end", "def read_metadata\n raise NotImplementedError.new 'This is only a function body for documentation'\n end", "def metadata_monograph_field?(key)\n field = metadata_field(key)\n return field[:object] != :file_set if field.present?\n false\n end", "def metadata_ingest_files\n return if params[:metadata_ingest_files].blank?\n params[:metadata_ingest_files].map do |metadata|\n metadata = JSON.parse(metadata, symbolize_names: true)\n file = Valkyrie::StorageAdapter.find_by(id: metadata[:id])\n PendingUpload.new(\n id: SecureRandom.uuid,\n storage_adapter_id: file.id,\n created_at: Time.current,\n file_name: metadata[:filename],\n type: metadata[:type]\n )\n rescue\n nil\n end.compact\n end", "def ensure_metadata_as_expected!\n expected_metadata_rb = <<~E\n name 'local-cookbook'\n maintainer ''\n maintainer_email ''\n license ''\n description 'Installs/Configures local-cookbook'\n long_description 'Installs/Configures local-cookbook'\n version '2.3.4'\n\n E\n expect(IO.read(metadata_path)).to eq(expected_metadata_rb)\n end", "def existing_files; end", "def file_set(file_expression='lib/**/*.rb', label=:default)\n log \"file sets before: #{@file_sets}\"\n log \"file set label #{label}\"\n new_style = Style.new\n\n yield new_style if block_given?\n\n @file_sets[label] = FileSet.new(file_expression, new_style)\n log \"file sets after: #{@file_sets}\"\n end", "def files\n @files=get_endpoint('extra').keys\n end", "def filesets_for_export(include_files = true)\n filesets = []\n has_ereader_files = false\n # get file-level filesets (image, document, video, etc); remove ereader (do 'em separately)\n all_files = Bplmodels::Finder.getFiles(pid)\n\n ereader_files = all_files.delete(:ereader) || []\n\n ## all_files.delete(:images) # uncomment for easier testing of IA objects\n # Make all non ereader files part of a \"lazy\" eumerator see Enumerator::Lazy at https://ruby-doc.org/core-2.6.8/Enumerator/Lazy.html\n # Note all_files.values.reduce(:+) will flatten the values in the all_files hash into a single array\n filesets = filesets_for_files_lazy(all_files.values.reduce(:+), include_files)\n # get EReader filesets and combine, make EPub the 'primary'\n if ereader_files.present?\n has_ereader_files = true\n ereader_fileset_for_export = nil\n if include_files\n ereader_filesets = filesets_for_files(ereader_files, include_files)\n ereader_filesets.each_with_index do |er_fileset, index|\n if er_fileset[:file_set][:files][0][:content_type] == 'application/epub+zip'\n ereader_fileset_for_export = er_fileset\n ereader_filesets.delete_at(index)\n end\n end\n ereader_filesets.each do |er_fileset|\n er_fileset[:file_set][:files].each do |er_file|\n next unless er_file[:file_type].match?(/ebook_access/)\n\n ereader_fileset_for_export[:file_set][:files] << er_file\n end\n end\n else\n ereader_files = ereader_files.select { |erf| erf[\"mime_type_tesim\"].include?(\"application/epub+zip\") }\n if ereader_files.present?\n ereader_fileset_obj = Bplmodels::File.find(ereader_files.first['id'])\n ereader_fileset_for_export = ereader_fileset_obj.export_data_for_curator_api(include_files)\n end\n end\n\n # have to modify keys of ebook_access_mobi and ebook_access_daisy files to use epub pid\n # NOTE on moving this up from below\n # Instead of reiterating through all of the fileset objects to check for the ereader object we just added...\n # modify the one we are adding before putting it into the filesets enum\n if ereader_fileset_for_export.present?\n pid_for_key = ereader_fileset_for_export.dig(:file_set, :ark_id)\n ereader_fileset_for_export[:file_set][:files].each do |file|\n if file[:file_type] == 'ebook_access_daisy' || file[:file_type] == 'ebook_access_mobi'\n key_parts = file[:key].split('/')\n key_parts[1] = pid_for_key if key_parts[1].match?(/[\\w-]*:[0-9a-z]*/)\n file[:key] = key_parts.join('/')\n end\n end\n end\n # NOTE since filesets is a Enumerator::Lazy object the << operator does not work anymore\n # Instead you have to wrap the object into a Enumerator subtype(Array in this case) and add(+) it\n # This will create an Enumerator::Chain object\n filesets = filesets + Array.wrap(ereader_fileset_for_export)\n end\n\n # if has_ereader_files\n # filesets.each do |fs|\n # fileset = fs[:file_set]\n # next unless fileset[:file_set_type] == 'ereader'\n #\n # pid_for_key = fileset[:ark_id]\n # fileset[:files].each do |file|\n # if file[:file_type] == 'ebook_access_daisy' || file[:file_type] == 'ebook_access_mobi'\n # key_parts = file[:key].split('/')\n # key_parts[1] = pid_for_key if key_parts[1].match?(/[\\w-]*:[0-9a-z]*/)\n # file[:key] = key_parts.join('/')\n # end\n # end\n # end\n # end\n # get the object-level filesets (metadata, plainText, etc)\n object_filesets = object_filesets_for_export(object_filestreams_for_export)\n filesets + object_filesets\n end" ]
[ "0.71350425", "0.71350425", "0.67456824", "0.66652495", "0.6634314", "0.649845", "0.6472493", "0.62322074", "0.62176937", "0.6192708", "0.6182669", "0.6163496", "0.6144549", "0.6090247", "0.60851675", "0.6083046", "0.6083046", "0.6083046", "0.6083046", "0.6083046", "0.6083046", "0.6083046", "0.6071023", "0.60140723", "0.6006411", "0.599947", "0.59600824", "0.5954154", "0.5953415", "0.5937562", "0.5932158", "0.59176236", "0.59162927", "0.5914711", "0.58915997", "0.5871825", "0.586477", "0.5860877", "0.5849104", "0.5837806", "0.58231676", "0.58096594", "0.5792381", "0.57894415", "0.5781824", "0.57665545", "0.57412076", "0.57248145", "0.57126725", "0.57065004", "0.5701312", "0.5696292", "0.5695249", "0.56874007", "0.56725645", "0.56613755", "0.56613755", "0.566136", "0.56607294", "0.56473935", "0.56186336", "0.5615509", "0.56155086", "0.5611639", "0.561056", "0.56039935", "0.5587295", "0.5585275", "0.5584972", "0.5579302", "0.55783683", "0.5570036", "0.5570036", "0.5570036", "0.5570036", "0.5570036", "0.5570036", "0.5569479", "0.5569479", "0.5569045", "0.5552574", "0.5541806", "0.55379987", "0.55354303", "0.55334145", "0.5528379", "0.5527467", "0.5525384", "0.5518238", "0.5516493", "0.55097836", "0.5488653", "0.54861605", "0.5481441", "0.5478919", "0.5475043", "0.54736406", "0.5473088", "0.547154", "0.5464301", "0.54606414" ]
0.0
-1
This is potentially bad a find and update for every oplog....
def update_optime(timestamp) # track what's been written with this - write optime to the fs, perhaps periodically. @log.debug("Optime: #{timestamp}") begin @_mongoClient.db("local").collection("oplog.tracker").update({}, {'timestamp' => timestamp}, {:upsert => true}) rescue @log.error("Unable to update optime: #{timestamp}") raise end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update ; end", "def update\n# read the first 2 lines - it should be enough\n# lsvob starts with \"Tag: \\BARABOOM\"\n# both lsreplica and lsepoch start with \"For VOB replica \"\\BARABOOM\":\"\n# the second line in lsreplica is \"replica \"name\"\"\n# the second line in lsepoch is \"Oplog IDs for row...\" or \"Actual oplog IDs for...\"\n# sometimes lsepcoh has multiple lines in the beginning with \"For VOB replica...\"\n parsed_line = Hash[ :vob => \"Tag: \",\n :lsepoch => \"For VOB replica \",\n :replica => \"replica \",\n :epoch => \"Oplog IDs for row \",\n :epoch_actual => \"Actual oplog IDs for \"]\n\n if params[:lslog].size > 0\n _line1 = params[:lslog].gets\n _line2 = params[:lslog].gets\n params[:lslog].rewind\n if !(_line1.nil? || _line2.nil?)\n if _line1.match(parsed_line[:vob].to_s)\n Site.lsvob_scan(params)\n elsif _line2.match(parsed_line[:epoch].to_s) || \n _line2.match(parsed_line[:epoch_actual].to_s) || \n _line2.match(parsed_line[:lsepoch].to_s)\n Site.lsepoch_scan(params)\n elsif _line2.match(parsed_line[:replica].to_s)\n Site.lsreplica_scan(params)\n else\n # error message\n flash[:notice] = \"INVALID FORMAT! - check the input file!\"\n end\n else\n # error message\n flash[:notice] = \"INVALID FORMAT! - check the input file!\"\n end\n end\n super\n end", "def update_solr(oplog_doc_entries, do_timestamp_commit = false)\n # This method has a special treatment on a sharded setup. Every insert and remove\n # operations are checked to confirm if they exists by asking mongos. This is used\n # to differentiate an actual delete/insert operation from a delete/insert during\n # chunk migrations. There are also a couple of reasons for not using the changelog\n # or chunks collections for this purpose:\n #\n # 1. Implementing the check on mongos is relatively easy and the correctness is also\n # easy to reason about.\n # 2. The bookkeeping for the ranges add extra complexity to the code.\n # 3. There is no reliable way of relating the timestamp used in the changelog to\n # the oplog and reason out which operations in the oplog are part of a migration.\n # And worse of all, there is no easy way to detect accidental deletions.\n # 4. The range info is only available for the shard keys. Since the normal oplog\n # entry only contains the _id, there will be no way to find out if the document\n # falls within the range if _id field is not sharded.\n\n update_list = {}\n timestamp = nil\n\n oplog_doc_entries.each do |oplog_entry|\n namespace = oplog_entry[\"ns\"]\n doc = oplog_entry[\"o\"]\n timestamp = oplog_entry[\"ts\"]\n\n case oplog_entry[\"op\"]\n when \"i\" then\n if @is_sharded then\n id = oplog_entry[\"o\"][\"_id\"]\n db_name, coll_name = get_db_and_coll_from_ns(namespace)\n\n # Check if document exists in the mongos. If it does, it implies that this insert\n # operation is part of a chunk migration.\n cursor = @db_connection[db_name][coll_name].find({ \"_id\" => id })\n count = retry_until_ok { cursor.count }\n next unless count.zero?\n end\n\n @logger.info \"#{@name}: adding #{doc.inspect}\"\n @solr.add(prepare_solr_doc(doc, namespace, timestamp))\n retry_until_ok { @config_writer.update_timestamp(namespace, timestamp) }\n\n when \"u\" then\n # Batch the documents that needs a new update to minimize DB roundtrips.\n # The reason for querying the DB is because there is no update operation for Solr\n # (and also no way to modify a field), only replacing an existing entry with a new\n # one. Since the oplog only contains the diff operation, we need to fetch the \n # latest content from the DB.\n to_update = update_list[namespace] ||= Set.new\n to_update << oplog_entry[\"o2\"][\"_id\"]\n\n when \"d\" then\n # Remove entry in the update_list to avoid it from magically reappearing (from Solr\n # point of view) after deletion.\n to_update = update_list[namespace] ||= Set.new\n id = oplog_entry[\"o\"][\"_id\"]\n\n if @is_sharded then\n db_name, coll_name = get_db_and_coll_from_ns(namespace)\n\n # Check if document exists in the mongos. If it does, it implies that this delete\n # operation is part of a chunk migration.\n cursor = @db_connection[db_name][coll_name].find({ \"_id\" => id })\n count = retry_until_ok { cursor.count }\n next unless count.zero?\n end\n\n to_update.delete(id)\n\n @logger.info \"#{@name}: marked as deleted: #{doc.inspect}\"\n new_doc = prepare_solr_doc({ \"_id\" => id }, namespace, timestamp)\n new_doc[SOLR_DELETED_FIELD] = true\n @solr.add(new_doc)\n\n retry_until_ok { @config_writer.update_timestamp(namespace, timestamp) }\n\n when \"n\" then\n # NOOP: do nothing\n\n else\n @logger.error \"#{@name}: Unrecognized operation in oplog entry: #{oplog_entry.inspect}\"\n end\n end\n\n update_list.each do |namespace, id_list|\n database, collection = get_db_and_coll_from_ns(namespace)\n\n retry_until_ok do\n to_update = @db_connection.db(database).collection(collection).\n find({\"_id\" => {\"$in\" => id_list.to_a}})\n\n to_update.each do |doc|\n @logger.info \"#{@name}: updating #{doc.inspect}\"\n @solr.add(prepare_solr_doc(doc, namespace, timestamp))\n # Use the last timestamp from oplog_doc_entries.\n retry_until_ok { @config_writer.update_timestamp(namespace, timestamp) }\n\n # Remove from the set so there will be less documents to update\n # when an exception occurs and this block is executed again\n id_list.delete doc[\"_id\"]\n end\n end\n end\n\n @solr.commit\n if do_timestamp_commit then\n retry_until_ok { @config_writer.update_commit_timestamp(timestamp) }\n end\n end", "def record_updates\n unless filter\n dirstate = @repo.dirstate\n @actions.each do |action|\n action.record(dirstate, action)\n end\n useful_parent_1 = branch_merge ? @local_parent.node : @remote.node\n useful_parent_2 = branch_merge ? @remote.node : Updating::NULL_ID\n \n dirstate.parents = [useful_parent_1, useful_parent_2]\n if !branch_merge && !fast_forward?\n dirstate.branch = @target_changeset.branch\n end\n\n @repo.run_hook :update, :parent1 => useful_parent_1, :parent2 => useful_parent_2 #, :error => stats[3]\n dirstate.write\n end\n end", "def reopen_logs; 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 orm_patches_applied=(_arg0); end", "def update() end", "def orm_patches_applied; end", "def updated_data; end", "def save_journal(operation, changes = {})\r\n# return unless session[:save_journal]\r\n if operation == :delete\r\n @record.attributes.each {|k,v| changes[k] = v}\r\n# elsif operation == :new\r\n# changes = {}\r\n end\r\n#\r\n if (operation != :update) or changes.size > 0\r\n# determine site_id\r\n site_id = @record.site_id if @record.respond_to?('site_id')\r\n site_id = dc_get_site._id if site_id.nil? and dc_get_site\r\n DcJournal.create(site_id: site_id,\r\n operation: operation,\r\n user_id: session[:user_id],\r\n tables: params[:table],\r\n ids: params[:ids],\r\n doc_id: params[:id],\r\n ip: request.remote_ip,\r\n time: Time.now,\r\n diff: changes.to_json)\r\n end\r\nend", "def save_docs(docs, o = {})\n return 0 if !docs || docs.size == 0\n saved_count = 0\n docs = filter_existing_docs(docs) if @src.itype != 'file' && !o[:force]\n return 0 if !docs || docs.size == 0\n docs_db = Item.find_by_dids(docs.map{|d|d[:did]}).map_hash{|d|[d[:did],d]}\n debug \"[save_docs] #{docs_db.size}/#{docs.size} docs found from db\"\n docs.each do |doc|\n #debug \"[save_docs] Processing #{doc[:did]}\"\n next if @src.o[:insert_only] && docs_db[doc[:did]]\n doc_db = docs_db[doc[:did]] || Item.new\n next if doc_db.modified_flag || !doc_db.changed_content?(doc)\n begin\n #type = (doc[:itype] =~ /query/)? 'Query' : 'Document'\n doc_db.update_attributes(doc.merge(:source_id=>@src.id))\n #debug \"[save_docs] filter : #{@src.filter.inspect}\"\n if @src.filter && @src.filter.size > 0 && doc_db.validate_by_condition(@src.filter)\n info \"[collect] Document #{doc_db.did} filtered out!\"\n doc_db.destroy\n else\n doc[:metadata][:tag_list].split(\",\").each{|e|doc_db.create_and_link(e, 'tag','t')} unless doc[:metadata][:tag_list].blank?\n doc_db.create_and_link(doc[:metadata][:query], 'query','q') if doc[:metadata][:query]\n #doc_db.add_tags(doc[:metadata][:tag_list], \"s\") unless doc[:metadata][:tag_list].blank?\n doc_db.process_all\n saved_count += 1\n doc_db.save\n end\n rescue Exception => e\n error \"[save_docs] \"+[e.inspect,e.backtrace].join(\"\\n\")\n end\n end\n #puts \"[save_docs] saved_count = #{saved_count}\"\n saved_count\n end", "def operations; end", "def operations; end", "def set_doe_util_changes\n\n # there is no bldg_id column for sca projects\n buildings = self.school_buildings\n\n buildings_ids_array = buildings.map {|b| b['bldg_id']}.uniq\n\n doe_significant_utilization_changes = CeqrData::DoeSignificantUtilizationChanges.version(\n data_package.table_for(\"doe_significant_utilization_changes\")\n ).doe_util_changes_matching_with_building_ids(buildings_ids_array)\n\n self.doe_util_changes = doe_significant_utilization_changes.map do |d|\n {\n url: d[:url],\n title: d[:title],\n org_id: d[:org_id],\n bldg_id: d[:bldg_id],\n vote_date: d[:vote_date],\n at_scale_year: d[:at_scale_year],\n at_scale_enroll: d[:at_scale_enroll],\n bldg_id_additional: d[:bldg_id_additional]\n }\n end\nend", "def findOperationUsages(operation, opType)\n operationArray = $opHash[opType + operation.operationElement]\n operationArray.each { \n |ids| \n if(ids != operation.operationId)\n $nodos[$nodos.find_index {|item| item.operationId == ids}].saidas.push($nodos[$nodos.find_index {|item| item.operationId == operation.operationId}])\n $nodos[$nodos.find_index {|item| item.operationId == operation.operationId}].entradas.push($nodos[$nodos.find_index {|item| item.operationId == ids}])\n end\n }\nend", "def visit_Arel_Nodes_UpdateStatement o, collector\n collector.request_type = Net::HTTP::Patch\n\n collector.table = o.relation.name\n collector.operation = :update\n\n # collector.id = o.wheres.first.children.first.right\n if !o.wheres.empty?\n collector.where = o.wheres.map { |x| visit(x, collector) }.inject([]) { |c, w|\n w.is_a?(Array) ? c += w : c << w\n }\n end\n\n if collector.where.size != 1 && collector.where.first.size != 1 && !collector.where.first['id']\n raise 'Upsupported'\n end\n\n collector.where = collector.where.first\n\n if o.values\n collector.updates = {}\n\n o.values.map { |x| visit(x, collector) }.each do |value|\n value.each do |key, v|\n if key.is_a?(Hash)\n add_to_bottom_of_hash_or_array(key, v)\n collector.updates.deep_merge!(key) { |k, v1, v2|\n if (v1.is_a?(Array) && v2.is_a?(Array))\n v2.each_with_index do |v2k, i|\n if v1[i].nil?\n v1[i] = v2[i]\n else\n v1[i].deep_merge!(v2[i]) unless v2[i].nil?\n end\n end\n v1\n else\n v2\n end\n }\n else\n collector.updates[key] = v\n end\n end\n end\n end\n\n collector\n end", "def test_node_change_log3\r\n Model.node_changes_to_log([:evidence, :doesnotexist])\r\n @mymodel = Model.new(1, \"rubylicious\") \r\n node_list = @mymodel.node_list \r\n\r\n node1 = node_list.add_node('autonum', 'node one', NODE);\r\n perfind2 = node_list.add_node('autonum', 'pi two', PERFIND); \r\n process3 = node_list.add_node('autonum', 'process three', PROCESS);\r\n process4 = node_list.add_node('autonum', 'process four', PROCESS); \r\n \r\n perfind2.evidence = 0.12\r\n process3.evidence = 0.34 \r\n process4.evidence = 0.56 \r\n \r\n i = 0\r\n while(ar = @mymodel.consume_next_node_change)\r\n assert_equal([0.12,0.12], ar[0].send(ar[1][0])) if ar[0] == perfind2\r\n assert_equal([0.34,0.34], ar[0].send(ar[1][0])) if ar[0] == process3 \r\n assert_equal([0.56,0.56], ar[0].send(ar[1][0])) if ar[0] == process4\r\n i += 1\r\n end\r\n \r\n assert_equal(3, i, 'Incorrect number of node changes were logged')\r\n end", "def update!(**args)\n @mysql_log_position = args[:mysql_log_position] if args.key?(:mysql_log_position)\n end", "def outdated; end", "def logall(user)\n self.changes.each do |key, value|\n if key != \"updated_at\" then\n name = self.class.name + \" #{key}\"\n \n logthis(user, name, self.id, value[0], value[1])\n end\n end\n end", "def log=(log); end", "def upgrade_app_explain; \"Check for updates to Hobix.\"; end", "def log_update\n (glossary_terms + observations).each do |object|\n object.log(:log_image_updated, name: log_name, touch: false)\n end\n end", "def apply_diff_op_ins(tree, data, mode)\n ret = { :status => false }\n\n # insert new key into a Hash\n if data['key']\n\n ### WORKAROUND\n # Insert action created from hintings can't properly\n # distinguish between insert into Array and Hash and\n # set path/key properly. We double check if we don't\n # try to insert into actual Array and if yes, we\n # update the diff structure and retry operation.\n # rubocop:disable Style/SoleNestedConditional\n if data['extra'] && data['extra']['hintings']\n if tree.is_a?(Hash) && tree[data['key']].is_a?(Array)\n data['path'] << data['key']\n data['key'] = nil\n\n raise OneCfg::Config::Exception::PatchRetryOperation\n end\n end\n # rubocop:enable Style/SoleNestedConditional\n\n if tree.is_a? Hash\n if tree.key?(data['key'])\n dc = OneCfg::Config::Utils.deep_compare(\n tree[data['key']],\n data['value'],\n @strict\n )\n\n if !dc && mode.include?(:replace)\n ret[:status] = true\n ret[:mode] = :replace\n ret[:old] = tree[data['key']]\n tree[data['key']] = data['value']\n end\n else\n tree[data['key']] = data['value']\n ret[:status] = true\n end\n elsif mode.include?(:skip)\n ret[:mode] = :skip\n else\n raise OneCfg::Config::Exception::PatchExpectedHash,\n tree.class\n end\n\n # insert new Array elemented by index\n elsif @strict && data['extra'] && data['extra']['index']\n idx = data['extra']['index']\n\n if tree.is_a? Array\n # If element already exists (manually added by user),\n # we won't touch it and e.g., fix the index. But,\n # it might break the indexes and expected values\n # there and application must be forced.\n if !OneCfg::Config::Utils.deep_include?(tree,\n data['value'],\n @strict)\n tree_idx_value = tree[idx]\n\n # if we find on idx expected data, insert by idx\n if OneCfg::Config::Utils.deep_compare(tree_idx_value,\n data['old'],\n @strict)\n\n # Proposed idx could be after the end of array\n # and we could be easily comparing nils. Better\n # check and only append if index is outside.\n if idx <= tree.length\n tree.insert(idx, data['value'])\n else\n tree.push(data['value'])\n end\n\n ret[:status] = true\n\n elsif mode.include?(:force)\n ret[:status] = true\n ret[:mode] = :force\n\n # On diff proposed index (idx) we expected some\n # value (data['old']), but it is not there anymore.\n # We try to guess new index by searching the array\n # for the element with expected old content. If we\n # find the element, we place new item on that index\n # instead of the diff proposed index.\n guess_idx = OneCfg::Config::Utils.deep_index(\n tree,\n data['old'],\n @strict\n )\n\n # TODO: this automagic placement should be done\n # based on 2 values (before / after), not just\n # 1 (old).\n # we tolerate only +/- 1 guessed index difference\n if !guess_idx.nil? && (guess_idx - idx).abs <= 1\n tree.insert(guess_idx, data['value'])\n # rubocop:disable Layout/CommentIndentation\n # rubocop:disable Layout/LineLength\n # OneCfg::LOG.debug(\"Guessed placement (#{guess_idx} instead of #{idx})\")\n # rubocop:enable Layout/CommentIndentation\n # rubocop:enable Layout/LineLength\n\n # try to place on same index as proposed\n # by diff if it's still inside range of Array\n elsif idx <= tree.length\n tree.insert(idx, data['value'])\n\n # otherwise, append at the end\n else\n tree.push(data['value'])\n end\n\n # We probably shouldn't allow skipping now on this\n # error, as the context placement is currently very\n # lame and will allow too many changes not to be\n # applied due to out poor implementation.\n # ---\n # elsif mode.include?(:skip)\n # ret[:mode] = :skip\n\n else\n raise OneCfg::Config::Exception::PatchValueNotFound,\n data['old']\n end\n end\n elsif mode.include?(:skip)\n ret[:mode] = :skip\n else\n raise OneCfg::Config::Exception::PatchExpectedArray,\n tree.class\n end\n\n # simply append Array element\n else\n if tree.is_a? Array\n # append only if element doesn't exist already\n unless OneCfg::Config::Utils.deep_include?(tree,\n data['value'],\n @strict)\n tree.push(data['value'])\n ret[:status] = true\n end\n elsif mode.include?(:skip)\n ret[:mode] = :skip\n else\n raise OneCfg::Config::Exception::PatchExpectedArray,\n tree.class\n end\n end\n\n ret\n end", "def deep_update(ope, concat = false)\n super\n cmt\n end", "def test_node_change_log2\r\n Model.node_changes_to_log([:evidence])\r\n @mymodel = Model.new(1, \"rubylicious\") \r\n node_list = @mymodel.node_list \r\n\r\n node1 = node_list.add_node('autonum', 'node one', NODE);\r\n perfind2 = node_list.add_node('autonum', 'pi two', PERFIND); \r\n process3 = node_list.add_node('autonum', 'process three', PROCESS);\r\n process4 = node_list.add_node('autonum', 'process four', PROCESS); \r\n \r\n perfind2.evidence = 0.12\r\n process3.evidence = 0.34 \r\n process4.evidence = 0.56 \r\n \r\n i = 0\r\n while(ar = @mymodel.consume_next_node_change)\r\n assert_equal([0.12,0.12], ar[0].send(ar[1][0])) if ar[0] == perfind2\r\n assert_equal([0.34,0.34], ar[0].send(ar[1][0])) if ar[0] == process3 \r\n assert_equal([0.56,0.56], ar[0].send(ar[1][0])) if ar[0] == process4\r\n i += 1\r\n end\r\n \r\n assert_equal(3, i, 'Incorrect number of node changes were logged')\r\n \r\n end", "def update;end", "def grit_update\n grit_repo = Repo.new(self.aq_repository.path)\n new_commits_count = grit_repo.commit_count(self.name) - self.commits.count\n count = 0\n while (count < new_commits_count)\n commits = grit_repo.commits(self.name, 10, count)\n commits.each do |c|\n if not self.commits.find_by_sha(c.id)\n a_commit = AqCommit.new(:sha => c.id,\n :log => c.message,\n :author_name => c.author.name,\n :created_at => c.committed_date,\n :committed_time => c.committed_date,\n :repository => self.aq_repository)\n c.diffs.each do |diff|\n begin\n a_file = AqFile.find_by_path(diff.b_path, :conditions => [\"aq_branch_id = ?\", self.id])\n rescue\n a_file = nil\n end\n if !a_file\n a_file = AqFile.new(:name => diff.b_path.split(\"/\").last, :path => diff.b_path)\n a_file.branch = self\n end\n self.files << a_file if !a_file.branch\n self.aq_repository.files << a_file if !a_file.repository\n a_commit.aq_files << a_file\n end\n a_commit.author = self.aq_repository.owner\n self.commits << a_commit\n self.save\n end\n end\n diff_c = new_commits_count - count\n if (diff_c > 10)\n count += 10\n else\n count += diff_c\n end\n end\n if self.aq_repository.owner.nil?\n the_user = User.our_current_user.login || \"error: cant get user login\"\n else\n the_user = self.aq_repository.owner.login\n end\n aq_logger(Settings.logs.scm, \"User #{the_user}, Branch : #{self.name}, #{count} commits treated.\")\n end", "def db_fix_merged_at(db, client, issues, org, repo)\n issues.each do |item|\n if(item.pull_request)\n # sqlite queries much cheaper than github requests, so protect from unnecessary github requests\n countRow = db[\"SELECT COUNT(id) FROM pull_requests WHERE org=? AND repo=? AND pr_number=? AND merged_at IS NOT NULL\", org, \"#{repo}\", item.number.to_s]\n count = countRow.first[:count]\n if(count == 0)\n pr=client.pull_request( \"#{org}/#{repo}\", item.number )\n if(pr.merged_at)\n db_update_pull_request(db, pr, org, repo)\n end\n end\n end\n end\n end", "def update\n\t\t# Left empty intentionally.\n\tend", "def update; end", "def update!(**args)\n @log_admin_read_actions = args[:log_admin_read_actions] if args.key?(:log_admin_read_actions)\n @log_data_read_actions = args[:log_data_read_actions] if args.key?(:log_data_read_actions)\n @log_data_write_actions = args[:log_data_write_actions] if args.key?(:log_data_write_actions)\n @project = args[:project] if args.key?(:project)\n end", "def operation; end", "def sosti(attuale, nuovo, pippo)\n=begin rdoc\nEsegue l'update di una serie di record, sostituendo in ciascuno di essi, per un campo predefinito,\nche al momento è l'attribute c14_idaliquotaiva della tabella, anch'essa predefinita (lbooks),\nil valore che i record contengono (vecchio), con un diverso valore (nuovo).\nLa procedura avviene in due fasi: nella prima vengono estratti i record che contengono il valore\nnuovo nel campo predefinito. nella seonda viene applicato al risultato il metodo update_all\nScrive alcune informazioni sul log, che è rappresentato dalla variabile pippo\n=end\n commento1 = \"Esegue la sostituzione del campo c14_idaliquotaiva in lbooks \"\n commento2 = \"per tutti i record contenenti il valore #{attuale} con il valore #{nuovo}.\" \n puts commento1\n puts commento2\n pippo.scriviRiga(commento1)\n pippo.scriviRiga(commento2)\n \n #\n rDaToccare = Lbook.where( c14_idaliquotaiva: attuale)\n quanti = rDaToccare.size\n if quanti > 0\n quante = rDaToccare.update_all( c14_idaliquotaiva: nuovo)\n riga = \"n.ro sostituzioni da #{attuale} a #{nuovo} eseguite: #{quante} su #{quanti}\"\n puts riga\n pippo.scriviRiga(riga)\n else \n riga = \"nessun record presente con c14_idaliquotaiva = #{attuale}\" \n puts riga \n pippo.scriviRiga(riga)\n end #if quanti > 0 \nend", "def prepare_update_statement(o)\n if o.offset || has_group_by_and_having?(o) ||\n has_join_sources?(o) && has_limit_or_offset_or_orders?(o)\n super\n else\n o\n end\n end", "def edit_action_explain; \"Edit weblog's configuration\"; end", "def test_node_change_log1\r\n @mymodel = Model.new(1, \"rubylicious\") \r\n node_list = @mymodel.node_list\r\n\r\n node1 = node_list.add_node('autonum', 'node one', NODE);\r\n perfind2 = node_list.add_node('autonum', 'pi two', PERFIND); \r\n process3 = node_list.add_node('autonum', 'process three', PROCESS);\r\n process4 = node_list.add_node('autonum', 'process four', PROCESS); \r\n\r\n process3.evidence = [0.2, 0.3]\r\n process4.evidence = [0.54, 0.777]\r\n \r\n assert(@mymodel.consume_next_node_change.nil?)\r\n end", "def updated_data\n\tend", "def root_updates\n @root_update_operations\n end", "def updateEdOrgs(dbName)\n @db = @conn[dbName]\n @edorg_collection = @db[EDORG_COLLECTION]\n nupdated = 0\n @edorg_collection.find.each do |row|\n did_update = 0\n if row[TYPE_FIELD] != TYPE_VALUE_EDORG\n @edorg_collection.update({\"_id\" => row[\"_id\"]},{\"$set\" => {TYPE_FIELD => TYPE_VALUE_EDORG}})\n did_update = 1\n end\n body = row[BODY_FIELD]\n unless body[PARENT_REF_FIELD].nil?\n parent_refs = [ body[PARENT_REF_FIELD] ]\n @edorg_collection.update({\"_id\" => row[\"_id\"]},{\"$set\" => {BODY_FIELD+\".\"+PARENT_REF_FIELD => parent_refs}})\n did_update = 2\n end\n nupdated += 1 if did_update > 0\n end\n puts \"Updated \" + nupdated.to_s + \" document(s)\"\nend", "def fix_collection(db, coll_name, fixtype)\n case fixtype\n when :spuriousM\n db.collection('__METADATA__').remove('_id' => coll_name)\n when :INIT\n db.collection(coll_name).drop\n db.collection('__METADATA__').remove('_id' => coll_name)\n when :APPEND\n metadata = db.collection('__METADATA__').find_one('_id' => coll_name)\n bad_vcfs = metadata['last_inconsistency_reason'][1]\n\n first_bad_vcf = metadata['vcfs'].index(bad_vcfs[0])\n if first_bad_vcf == nil\n raise \"the metadata state is incoherent\"\n end\n bad_samples = []\n metadata['samples'].each do |s| \n if s['vcfid'] >= first_bad_vcf\n bad_samples << s['name']\n end\n end\n\n number_of_good_samples = metadata['samples'].length - bad_samples.length\n number_of_good_vcfs = metadata['vcfs'].length - bad_vcfs.length\n\n update_operation = {\n '$push' => {\n 'IDs' => {'$each' => [], '$slice'=> number_of_good_vcfs},\n 'QUALs' => {'$each' => [], '$slice'=> number_of_good_vcfs}, \n 'FILTERs' => {'$each' => [], '$slice'=> number_of_good_vcfs},\n 'INFOs' => {'$each' => [], '$slice'=> number_of_good_vcfs},\n 'samples' => {'$each' => [], '$slice'=> number_of_good_samples}\n }\n }\n\n db.collection(coll_name).update({}, update_operation, {:multi => true})\n\n metadata_update_operation = {\n '$set' => {'consistent' => true}, \n '$push' => {\n 'vcfs' => {'$each' => [], '$slice' => number_of_good_vcfs},\n 'headers' => {'$each' => [], '$slice' => number_of_good_vcfs},\n 'samples' => {'$each' => [], '$slice'=> number_of_good_samples}\n },\n }\n db.collection('__METADATA__').update({'_id' => coll_name}, metadata_update_operation)\n else\n raise \"unknown error state, fix_collection() doesn't know what to do\"\n end\n end", "def replace_update_me\n end", "def execute_update!( activerecord_class )\n collector = @row_collectors[ activerecord_class.table_name ]\n process_text_log << \"Updating #{ activerecord_class.name }...\\r\\n\"\n sql_diff_text_log << \"\\r\\n-- Updates for #{ activerecord_class.name }:\\r\\n\"\n is_ok = true\n begin\n collector.non_duplicates_rows.each do |row|\n sql_attributes = {}\n if row.respond_to?(:swimmer_id) # Correct the swimmer_id link:\n row.swimmer_id = @master_swimmer.id\n sql_attributes['swimmer_id'] = @master_swimmer.id\n end\n # Correct the badge link, when included in the matrix:\n if row.respond_to?(:badge_id) && @dup_badge_matrix_ids.has_key?( row.badge_id )\n row.badge_id = @dup_badge_matrix_ids[ row.badge_id ]\n sql_attributes['badge_id'] = row.badge_id\n end\n\n if row.invalid? # Check validation:\n msg = \"\\r\\n\\r\\n-- *** Swimmer Merge: validation ERROR during #{ row.class.name } update!\\r\\n\" <<\n \"- row..............: #{ row.inspect }\\r\\n\" <<\n \"- sql_attributes...: #{ sql_attributes.inspect }\\r\\n\" <<\n \"\\r\\n- ERROR............: #{ ValidationErrorTools.recursive_error_for( row ) }\\r\\n\"\n# DEBUG\n puts msg\n process_text_log << msg\n end\n row.save!\n # Build-up SQL-diff:\n if sql_attributes.size > 0 # (false = no additional comment)\n sql_diff_text_log << to_sql_update( row, false, sql_attributes, \"\\r\\n\" )\n end\n end\n rescue\n process_text_log << \"\\r\\n\\r\\n*** Swimmer Merge: exception caught!\\r\\n\"\n process_text_log << \"*** Phase '#{ activerecord_class.name } UPDATE': #{ $!.to_s }\\r\\n\" if $!\n process_text_log << sql_diff_text_log\n is_ok = false\n end\n is_ok\n end", "def reindex_everything(repo, query = '')\n i = 0\n repo.search(query) do |object|\n next if object.pid.start_with?('fedora-system:')\n i += 1\n next if i < start_at\n puts \"I: #{i}\"\n begin\n @solr_conn.add index_digital_object(object)\n rescue Rubydora::FedoraInvalidRequest => e\n puts \"ERROR #{e}\"\n end\n @solr_conn.commit(softCommit: true) if i % 100 == 0\n end\n @solr_conn.commit\nend", "def updateEdOrgs(dbName)\n @db = @conn[dbName]\n @edorg_collection = @db[EDORG_COLLECTION]\n nupdated = 0\n @edorg_collection.find.each do |row|\n did_update = 0\n body = row[BODY_FIELD]\n\n if body[PARENT_REF_FIELD].nil?\n newParent = []\n else\n newParent = body[PARENT_REF_FIELD].flatten(1)\n end\n\n # Add LEA ref to parents if not there\n if body.has_key?(LEA_REF_FIELD)\n leaRef = body[LEA_REF_FIELD]\n if !leaRef.nil?\n if !newParent.include?(leaRef)\n puts \"Moving LEA ref '\" + leaRef + \"' to parent(s) for edorg '\" + row[\"_id\"] + \"'\"\n newParent.push(leaRef)\n else\n puts \"Removing old \" + LEA_REF_FIELD + \" from edorg '\" + row[\"_id\"] + \"'\"\n end\n end\n end\n\n # If parent ref was completely absent and have no LEA to add, leave it be\n next if body[PARENT_REF_FIELD].nil? and newParent.empty?\n \n if body[PARENT_REF_FIELD] != newParent\n puts \"Edorg '\" + row[\"_id\"] + \"': replacing '\" + body[PARENT_REF_FIELD].to_s() + \"' with '\" + newParent.to_s() + \"'\"\n @edorg_collection.update({\"_id\" => row[\"_id\"]},{\"$set\" => {BODY_FIELD + \".\" + PARENT_REF_FIELD => newParent}})\n nupdated += 1\n end\n\n # Remove the lea ref field\n if body.has_key?(LEA_REF_FIELD)\n @edorg_collection.update({\"_id\" => row[\"_id\"]},{\"$unset\" => {BODY_FIELD + \".\" + LEA_REF_FIELD => 1}})\n end\n\n\n end\n puts \"Updated \" + nupdated.to_s + \" document(s)\"\nend", "def save_journal(operation, changes = {})\r\n if operation == :delete\r\n @record.attributes.each { |k, v| changes[k] = v }\r\n end\r\n changes.except!('created_at', 'updated_at', 'created_by', 'updated_by')\r\n\r\n if (operation != :update) || changes.size > 0\r\n # determine site_id\r\n site_id = @record.site_id if @record && @record.respond_to?('site_id')\r\n site_id = dc_get_site._id if site_id.nil? && dc_get_site\r\n\r\n DcJournal.create(site_id: site_id,\r\n operation: operation,\r\n user_id: session[:user_id],\r\n tables: params[:table],\r\n ids: params[:ids],\r\n doc_id: params[:id],\r\n ip: request.remote_ip,\r\n time: Time.now,\r\n diff: changes.to_json)\r\n end\r\nend", "def offences_by; end", "def update_es_index\n \n if self.respond_to? :op_success\n \n if self.op_success.nil?\n \n es_update\n else\n \n es_update if self.op_success == true\n end\n else\n \n es_update\n end\n \n end", "def update_operations_metrics(save_asset = true)\n\n Rails.logger.info \"Updating the recorded operations metrics for asset = #{object_key}\"\n # nothing to do for now\n\n end", "def update\n \n end", "def run\nwriteop,readop=0\n writelag=`mongo --eval \"printjson(replSetGetStatus.members.optimeDate[primary])\"`\n\nwritelag.each_line do |line|\n writeop=line if line.match /^[0-9]*/\nend\n readop=`mongo --eval \"printjson(replSetGetStatus.members.optimeDate[Secondary member])\"`\n\nreadlag.each_line do |line|\n readop=line if line.match /^[0-9]*/\nend\n repllag=writeop.to_i-readop.to_i\n\n message \"#{repllag} Replication Lag\"\n warning if repllag > config[:warn] \n critical if repllag > config[:crit] \n ok\n end", "def secure_change_in_logs(checksum, this_change) \n log = @filename.to_s + Logger::DELIMITER\n log += @version.to_s + Logger::DELIMITER\n log += checksum + Logger::DELIMITER\n log += this_change.username.to_s + Logger::DELIMITER\n log += this_change.position.node.to_s + Logger::DELIMITER \n log += this_change.position.offset.to_s + Logger::DELIMITER\n\n if this_change.is_a? Insertion\n log += \"insertion\" + Logger::DELIMITER\n log += this_change.content + Logger::DELIMITER\n elsif this_change.is_a? Deletion\n log += \"deletion\" + Logger::DELIMITER\n log += this_change.direction + Logger::DELIMITER\n log += this_change.length.to_s + Logger::DELIMITER\n end\n\n # invoke the logger function to log this to the log file\n # it will add the lsn automatically\n Application.logger.recovery log\n end", "def private; end", "def dirty; end", "def computeResourceUpdate(app_id, run_id, rid)\n resources = nutella.f.persist.get_run_mongo_object_store(app_id, run_id, 'resources')\n\n resource = resources[rid]\n\n if resource != nil\n if resource['proximity'] != nil\n if resource['proximity']['rid'] != nil\n baseStation = resources[resource['proximity']['rid']]\n\n if baseStation != nil && baseStation['continuous'] != nil\n resource['proximity']['continuous'] = baseStation['continuous']\n\n # Update basic station\n computeResourceUpdate(app_id, run_id, resource['proximity']['rid'])\n end\n\n if baseStation != nil && baseStation['discrete'] != nil\n resource['proximity']['discrete'] = baseStation['discrete']\n end\n end\n end\n\n resources[rid] = resource\n\n=begin\n if resource['continuous'] != nil\n counter = 0 # Number of proximity beacons tracked from this station\n for r in $resources.keys()\n resource2 = $resources[r]\n if resource2['proximity'] != nil && resource2['proximity']['rid'] == resource['rid']\n counter += 1\n resource2['proximity']['continuous'] = resource['continuous']\n $resources[r] = resource2\n publishResourceUpdate(resource2)\n end\n end\n puts counter\n resource['number_resources'] = counter\n end\n=end\n\n # Translate discrete coordinate\n if resource['discrete'] != nil\n resource['discrete'] = translateDiscreteCoordinates(app_id, run_id, resource['discrete'])\n end\n\n # Send update\n publishResourceUpdate(app_id, run_id, resource)\n\n end\nend", "def update_aggregator(new_obj,params)\n return false\n end", "def update_aggregator(new_obj,params)\n return false\n end", "def update_aggregator(new_obj,params)\n return false\n end", "def clean_update_log\n \t\tif ::Update.count > 50\n\t \tbatch = ::Update.limit(25).order('created_at ASC')\n\t \tbatch.destroy_all\n\t end\n \tend", "def parse_operation\n case operation\n when 'indexes', 'columns' then nil # not under developer control\n when 'load' then 'find'\n when 'destroy', 'find', 'save', 'create', 'exists' then operation\n when 'update' then 'save'\n else\n if model == 'Join'\n operation\n end\n end\n end", "def update!(**args)\n @cdoc_build_info = args[:cdoc_build_info] if args.key?(:cdoc_build_info)\n @content_protected = args[:content_protected] if args.key?(:content_protected)\n @convert_to_roboted_reason = args[:convert_to_roboted_reason] if args.key?(:convert_to_roboted_reason)\n @crawl_status = args[:crawl_status] if args.key?(:crawl_status)\n @demotion_tags = args[:demotion_tags] if args.key?(:demotion_tags)\n @error_type = args[:error_type] if args.key?(:error_type)\n @freshdocs_corpora = args[:freshdocs_corpora] if args.key?(:freshdocs_corpora)\n @hostid = args[:hostid] if args.key?(:hostid)\n @ie_identifier = args[:ie_identifier] if args.key?(:ie_identifier)\n @image_indexing_info = args[:image_indexing_info] if args.key?(:image_indexing_info)\n @indexing_ts = args[:indexing_ts] if args.key?(:indexing_ts)\n @no_longer_canonical_timestamp = args[:no_longer_canonical_timestamp] if args.key?(:no_longer_canonical_timestamp)\n @normalized_click_score = args[:normalized_click_score] if args.key?(:normalized_click_score)\n @raw_navboost = args[:raw_navboost] if args.key?(:raw_navboost)\n @row_timestamp = args[:row_timestamp] if args.key?(:row_timestamp)\n @selection_tier_rank = args[:selection_tier_rank] if args.key?(:selection_tier_rank)\n @tracing_id = args[:tracing_id] if args.key?(:tracing_id)\n @url_changerate = args[:url_changerate] if args.key?(:url_changerate)\n @url_history = args[:url_history] if args.key?(:url_history)\n @url_pattern_signals = args[:url_pattern_signals] if args.key?(:url_pattern_signals)\n @video_indexing_info = args[:video_indexing_info] if args.key?(:video_indexing_info)\n end", "def update!(**args)\n @log_name = args[:log_name] if args.key?(:log_name)\n @resource = args[:resource] if args.key?(:resource)\n @proto_payload = args[:proto_payload] if args.key?(:proto_payload)\n @text_payload = args[:text_payload] if args.key?(:text_payload)\n @json_payload = args[:json_payload] if args.key?(:json_payload)\n @timestamp = args[:timestamp] if args.key?(:timestamp)\n @severity = args[:severity] if args.key?(:severity)\n @insert_id = args[:insert_id] if args.key?(:insert_id)\n @http_request = args[:http_request] if args.key?(:http_request)\n @labels = args[:labels] if args.key?(:labels)\n @operation = args[:operation] if args.key?(:operation)\n end", "def mongrel\n \n fileSize=File.stat(MONGREL_LOG_PATH).size \n range=0\n while true\n if File.stat(MONGREL_LOG_PATH).size>fileSize.to_i\n range=(File.stat(MONGREL_LOG_PATH).size.to_f/fileSize.to_f).to_f unless fileSize==0\n puts \"File size is increased by #{range ? range : fileSize}\"\n \n fileSize=File.stat(MONGREL_LOG_PATH).size\n if range.to_f>0.5\n #update database with warning messsage\n puts \"update database with warning messsage\"\n else\n #update database with info message\n puts \"update database with info message\"\n end\n range=0.0\n else\n puts \"File size is stable\"\n end\n sleep(5)\n end\n end", "def handleAssocChanges(postNum, pub, ids, oapID, assocChanges)\n\n # Collate the records by old OAP ID\n fromOAPs = Hash.new { |h,k| h[k] = Set.new }\n assocChanges.each { |campusID, fromOAP, toOAP| fromOAPs[fromOAP] << campusID }\n\n # Figure out which old OAP IDs will end up abandoned, and which are being disassociated\n abandoned = []\n fromOAPs.each { |fromOAP, campusIDs|\n existing = Set.new(db_execute(\"SELECT campus_id FROM ids WHERE oap_id = ?\", fromOAP).map { |row| row[0] })\n if (existing - campusIDs).empty?\n abandoned << fromOAP\n end\n }\n\n disassoc = assocChanges.map{ |campusID, fromOAP, toOAP| toOAP ? nil : fromOAP }.compact\n\n # Ensure that all IDs being abandoned or disassociated haven't been worked on by the users\n errs = []\n (abandoned+disassoc).each { |fromOAP|\n pubs = db_execute(\"SELECT pub_id FROM pubs WHERE oap_id = ?\", fromOAP).map { |row| row[0] }\n pubs.each { |pubID|\n n = db_get_first_value(\"SELECT count(*) FROM eschol_equiv WHERE pub_id = ?\", pubID)\n if n > 0\n errs << \"An eschol_equiv record is associated with publication #{pubID.inspect}, OAP #{fromOAP.inspect}.\"\n end\n n = $arkDb.get_first_value(\"SELECT count(*) FROM arks WHERE source = ? AND external_id = ?\", \"elements\", pubID)\n if n > 0\n errs << \"A file was deposited to eschol for publication #{pubID.inspect}, OAP #{fromOAP.inspect}.\"\n end\n }\n }\n\n if !errs.empty?\n puts \"Warning: The following association change will *not* be performed because of potential problems.\"\n assocChanges.each { |campusID, fromOAP, toOAP|\n if toOAP\n puts \" Change: Campus item #{campusID} switching from oapID #{fromOAP.inspect} to #{toOAP.inspect}.\"\n else\n puts \" Change: Campus item #{campusID} leaving oapID #{fromOAP.inspect}.\"\n end\n }\n errs.each { |err|\n puts \" Potential problem: #{err}\"\n }\n return false\n end\n\n puts \"Note: The following association change appears to be OK, going ahead.\"\n if !abandoned.empty?\n puts \" Abandoned IDs: #{abandoned.inspect}\"\n end\n assocChanges.each { |campusID, fromOAP, toOAP|\n if toOAP\n puts \" Change: Campus item #{campusID} switching from oapID #{fromOAP.inspect} to #{toOAP.inspect}.\"\n else\n puts \" Change: Campus item #{campusID} leaving oapID #{fromOAP.inspect}.\"\n end\n }\n\n # Drop the old OAP record in Elements\n abandoned.each { |fromOAP|\n puts \" Deleting abandoned record #{fromOAP.inspect}.\"\n if $testMode\n puts \" (test mode: not deleting old OAP item)\"\n next\n end\n uri = URI(\"#{$elementsAPI}/publication/records/c-inst-1/#{CGI.escape(fromOAP)}\")\n req = Net::HTTP::Delete.new(uri)\n req.basic_auth $apiCred[0], $apiCred[1]\n (1..10).each { |tryNumber|\n\n $transLog.write(\"\\n---------------------------------------------------------------\\n\")\n $transLog.write(\"\\nDELETE #{uri}\\n\")\n $transLog.flush\n\n res = $elementsAPIConn.request(req)\n\n # Log the response\n $transLog.write(\"Response:\\n\")\n $transLog.write(\"#{res} code=#{res.code} message=#{res.message.inspect}\\n\")\n $transLog.write(\"#{res.body}\\n\")\n\n # HTTPConflict and HTTPGatewayTimeOut happen occasionally, and are likely transitory\n if res.is_a?(Net::HTTPConflict) || res.is_a?(Net::HTTPGatewayTimeOut)\n puts \" Note: failed due to #{res} (likely a transitory concurrency issue).\"\n if tryNumber < 20\n puts \" Will retry after a 30-second pause.\"\n sleep 30\n next\n else\n puts \" Out of retries. Aborting.\"\n end \n end\n\n # Fail if the DELETE failed\n res.is_a?(Net::HTTPSuccess) or raise(\"Error: delete failed: #{res}\")\n }\n }\n\n # Make the changes in our database\n assocChanges.each { |campusID, fromOAP, toOAP|\n if toOAP\n db_execute(\"INSERT OR REPLACE INTO ids (campus_id, oap_id) VALUES (?, ?)\", [campusID, toOAP])\n else\n db_execute(\"DELETE FROM ids WHERE campus_id = ? AND oap_id = ?\", [campusID, fromOAP])\n end\n }\n abandoned.each { |fromOAP|\n db_execute(\"DELETE FROM ids WHERE oap_id = ?\", fromOAP)\n db_execute(\"DELETE FROM pubs WHERE oap_id = ?\", fromOAP)\n db_execute(\"DELETE FROM oap_hashes WHERE oap_id = ?\", fromOAP)\n db_execute(\"DELETE FROM oap_flags WHERE oap_id = ?\", fromOAP)\n }\n\n # All done, and ready to proceed with import.\n return true\n\nend", "def update\n #\n # NO-OP\n #\n end", "def alter(m_wfid, m_error, m_action, msg, tracker)\n\n case tracker['msg'].delete('_alter')\n when 'merge' then msg.merge!(tracker['msg'])\n #else ...\n end\n end", "def update(...)\n end", "def find_updates(match)\n find = proc do |node|\n if node.text?\n formatted_text = node.text.strip\n unless formatted_text.empty?\n res = formatted_text.match?(\n /\\d{1} (ALTERAÇÃO|ALTERAÇÕES)$/i\n )\n next formatted_text if res\n end\n end\n nil\n end\n\n depth_search(match, find)\n end", "def autoflush_log; end", "def autoflush_log; end", "def snapshots_redact_sql_queries; end", "def verifyLastOperation(operationType, node)\n if(!$oldOperation.nil?)\n if ($oldOperation.operationElement.eql? node.operationElement and $oldOperation.operation.eql? operationType and $oldOperation.operationId != node.operationId)\n $failed = true\n end\n end\nend", "def update\n \n end", "def update\n\n end", "def handle_duplicate_logs\n all_non_current_user_dup_user_extended_details_ids = []\n\n # Fetch all user_extended_details corresponding to current user_extended_details1_id\n all_non_current_user_dup_user_extended_details_ids += UserKycDuplicationLog.using_client_shard(client: @client).\n non_deleted.where(\n user_extended_details1_id: @user_kyc_detail.user_extended_detail_id, status: GlobalConstant::UserKycDuplicationLog.active_status).pluck(:user_extended_details2_id)\n\n # Fetch all user_extended_details corresponding to current user_extended_details2_id\n all_non_current_user_dup_user_extended_details_ids += UserKycDuplicationLog.using_client_shard(client: @client).\n non_deleted.where(\n user_extended_details2_id: @user_kyc_detail.user_extended_detail_id, status: GlobalConstant::UserKycDuplicationLog.active_status).pluck(:user_extended_details1_id)\n\n # Initiailize\n active_dup_user_extended_details_ids, inactive_dup_user_extended_details_ids, user_ids = [], [], []\n # Fetch active, inactive user_extended_details_ids\n UserKycDuplicationLog.using_client_shard(client: @client).non_deleted.\n where(\n \"user_extended_details1_id IN (?) OR user_extended_details2_id IN (?)\",\n all_non_current_user_dup_user_extended_details_ids,\n all_non_current_user_dup_user_extended_details_ids\n )\n .select(:id, :user1_id, :user2_id, :user_extended_details1_id, :user_extended_details2_id, :status).all.each do |ukdl|\n\n next if (ukdl.user_extended_details1_id == @user_kyc_detail.user_extended_detail_id) ||\n (ukdl.user_extended_details2_id == @user_kyc_detail.user_extended_detail_id)\n\n if ukdl.status == GlobalConstant::UserKycDuplicationLog.active_status\n active_dup_user_extended_details_ids << ukdl.user_extended_details1_id\n active_dup_user_extended_details_ids << ukdl.user_extended_details2_id\n else\n inactive_dup_user_extended_details_ids << ukdl.user_extended_details1_id\n inactive_dup_user_extended_details_ids << ukdl.user_extended_details2_id\n end\n user_ids << ukdl.user1_id\n user_ids << ukdl.user2_id\n end if all_non_current_user_dup_user_extended_details_ids.present?\n\n active_dup_user_extended_details_ids.uniq!\n inactive_dup_user_extended_details_ids.uniq!\n user_ids.uniq!\n\n active_dup_user_extended_details_ids = active_dup_user_extended_details_ids & all_non_current_user_dup_user_extended_details_ids\n inactive_dup_user_extended_details_ids = inactive_dup_user_extended_details_ids & all_non_current_user_dup_user_extended_details_ids\n\n\n inactive_dup_user_extended_details_ids -= active_dup_user_extended_details_ids\n # Mark inactive user_extended_details_ids as was_kyc_duplicate_status\n # Active user_kyc_details will already be is_kyc_duplicate_status\n if inactive_dup_user_extended_details_ids.present?\n UserKycDetail.using_client_shard(client: @client).active_kyc.where(user_extended_detail_id: inactive_dup_user_extended_details_ids).\n update_all(kyc_duplicate_status: GlobalConstant::UserKycDetail.was_kyc_duplicate_status,\n updated_at: Time.now.to_s(:db))\n end\n\n never_dup_user_extended_details_ids = (all_non_current_user_dup_user_extended_details_ids - active_dup_user_extended_details_ids - inactive_dup_user_extended_details_ids)\n # Mark missing dup_user_extended_details_ids as never_kyc_duplicate_status\n if never_dup_user_extended_details_ids.present?\n UserKycDetail.using_client_shard(client: @client).where(user_extended_detail_id: never_dup_user_extended_details_ids).\n update_all(kyc_duplicate_status: GlobalConstant::UserKycDetail.never_kyc_duplicate_status, updated_at: Time.now.to_s(:db))\n end\n\n # Delete all entries corresponding to all_non_current_user_dup_user_extended_details_ids\n UserKycDuplicationLog.using_client_shard(client: @client).where(\"user_extended_details1_id = ? OR user_extended_details2_id = ?\",\n @user_kyc_detail.user_extended_detail_id, @user_kyc_detail.user_extended_detail_id).delete_all\n\n # Mark current user as unprocessed\n @user_kyc_detail.kyc_duplicate_status = GlobalConstant::UserKycDetail.unprocessed_kyc_duplicate_status\n @user_kyc_detail.save!\n # Perform Check duplicates again for current user id\n r = AdminManagement::Kyc::CheckDuplicates.new({client: @client, user_id: @user_kyc_detail.user_id}).perform\n return r unless r.success?\n\n UserKycDetail.using_client_shard(client: @client).bulk_flush(user_ids)\n\n success\n end", "def date() updated; end", "def update\n # Not generally used\n end", "def update\n # Not generally used\n end", "def process_document(line, table, id, ids)\r\n if params[:do_update] == '1' \r\n doc = dc_find_document(table, id, ids)\r\n# document found. Update it and return\r\n if doc\r\n doc.update( update_json(ActiveSupport::JSON.decode(line), true) )\r\n msg = dc_check_model(doc)\r\n return (msg ? \" ERROR! #{msg}\" : \" UPDATE. OK.\")\r\n end\r\n end\r\n# document will be added to collection \r\n if ids.to_s.size > 5\r\n#TODO Add embedded document\r\n \" NOT SUPPORTED YET!\"\r\n else\r\n doc = table.classify.constantize.new( update_json(ActiveSupport::JSON.decode(line)) )\r\n doc.save\r\n end\r\n msg = dc_check_model(doc)\r\n msg ? \" ERROR! #{msg}\" : \" NEW. OK.\" \r\nend", "def after_update(record)\n contents = to_sql_update(record)\n to_logfile(contents)\n end", "def quantify_edits\n\t\[email protected]_with_index do |changeset, index|\n\t\t\tthis_user = changeset['properties']['user']\n\t\t\t\n\t\t\t@users[this_user] ||= 0\n\t\t\t@users[this_user] += 1\n\n\t\t\tif (index%10000).zero?\n\t\t\t\tprint \"#{index}..\"\n\t\t\tend\n\t\tend\n\tend", "def snapshots_redact_sql_queries=(_arg0); end", "def modified?; end", "def rollout(percent_to_update)\n\n# load 'data.csv' and 'finalstage.csv' to separate hashes so that regardless of\n# the input field order the required output format can be achieved\n\n #\n # -Get all the old stuff and all the new stuff to combine together\n #\n csv_data = CSV.read 'update-data-regen.csv';\n headers = csv_data.shift;\n rhash = csv_data.map { |row| Hash[*headers.zip(row).flatten] };\n\n csv_data = CSV.read 'original-data.csv';\n headers = csv_data.shift;\n rhash_old = csv_data.map { |row| Hash[*headers.zip(row).flatten] };\n\n number_of_records = (rhash.count() * (percent_to_update.to_f()/100)).floor()\n rhash_new = {}\n ids_hash = {}\n\n #\n # -Add the new stuff\n # -Fix those labels\n #\n number_of_records.times do |index|\n ids_hash[rhash[index][\"id\"]] = \"\";\n rhash_new[index] = rhash[index]\n end\n\n rhash_new.each_with_index do |record,index|\n record = record.pop\n rollout_label = \"\"\n\n if(record['label'])\n labels = record['label'].split\n labels.each do |label|\n rollout_label += ((ids_hash[label]) ? label : @revxref[label]) + \" \"\n end\n end\n rhash_new[index]['label'] = rollout_label\n\n target = rhash_new[index]\n\n if target['options']\n code = target['code']\n opts = target['options']\n code.gsub! /(^\\w*?);/, '\\1tmp;'\n code.gsub! /\\((\\w*?)\\)/, '(\\1tmp)'\n code.gsub!(/=(\\w*?)(&|$)/, '=\\1tmp\\2')\n opts.gsub! /\\((\\w*?)\\)/, '(\\1tmp)'\n else\n target['code'].gsub! /$/, 'tmp'\n end\n\n end\n\n #\n # -Chop off what we just did and now the old array has to be fixed\n # -Fix the labels and add the fixed records to the new hash\n #\n to_delete = rhash_old.shift(number_of_records)\n\n rhash_old.each_index do |index|\n record = rhash_old[index]\n rollout_label = \"\"\n\n if(record['label'])\n labels = record['label'].split\n labels.each do |label|\n rollout_label += ((ids_hash[@xref[label]]) ? @xref[label] : label) + \" \"\n end\n end\n rhash_old[index]['label'] = rollout_label\n rhash_new[rhash_new.count+1] = rhash_old[index]\n end\n\n #\n # -Remove problematic data - ie 'code', 'options', etc from obsolete records\n # -Update path of obsolete records to place them in 'TODELETE' section\n #\n\n to_delete.each_index do |td|\n # -to update the 'code' and 'options' data I'll have to parse and update\n # this: see <to_delete-notes.txt>\n target = to_delete[td]\n\n if target['options']\n code = target['code']\n opts = target['options']\n code.gsub! /(^\\w*?);/, '\\1old;'\n code.gsub! /\\((\\w*?)\\)/, '(\\1old)'\n code.gsub!(/=(\\w*?)(&|$)/, '=\\1old\\2')\n opts.gsub! /\\((\\w*?)\\)/, '(\\1old)'\n else\n target['code'].gsub! /$/, 'old'\n end\n\n target['path'] = 'TODELETE'\n\n # then put the processed original data record back into the output array\n rhash_new[rhash_new.count+1] = target\n end\n#\n###############################################################################\n# TODO - need to pick out the rollout redirects, which ones?\n# TODO - prepare the pictures for upload - should I preserve the original images\n# for the TODELETE set? Original data doesn't have images, does it?\n###############################################################################\n#\n #binding.pry\n\n #\n # -Output to csv file\n # - but first specify the exact fields and field order for the output\n #\n\n keys = \"id code abstract sale-price product-url headline isbn orderable\n google-base-product-type options ship-weight page-title taxable\n availability description family price merchant-category condition\n path gift-certificate label manufacturer-part-number caption keywords\n brand upc name inset icon additional-image-1 additional-image-2\n additional-image-3 image download leaf\".split\n\n rollout_csv = CSV.open('rollout_data.csv', 'wb')\n # keys = rhash_new.first[1].keys\n rollout_csv << keys\n rhash_new.each do |record|\n\n row = []\n keys.each do |key|\n row.push record[1][key]\n end\n rollout_csv << row\n end\n rollout_csv.close\nend", "def core_data_dumper\n ### CAUTION !!! DUMPS DATA !!! ###\n\n # cores = Core.where(alt_source: \"CRM\")\n # cores.each do |core|\n # core.update_attributes(indexer_date: nil, staffer_date: nil, whois_date: nil, staff_pf_sts: nil, loc_pf_sts: nil, inventory_indexer_status: nil, staff_link: nil, staff_text: nil, location_link: nil, location_text: nil, staffer_sts: nil, template: nil)\n # end\n\n end", "def create_or_update_previous_runs!; end", "def create_or_update_previous_runs!; end", "def mte_prepare_updating; send_request_to_mite(\"update\"); end", "def log_changes(location,description,observation=nil,author=nil,description_patch=nil,\n former_type_ids=[],former_location=nil)\n c = Change.new\n c.location = location\n c.description = description\n c.remote_ip = request.headers['CF-Connecting-IP'] || request.remote_ip \n c.user = current_user if user_signed_in?\n c.observation = observation\n c.description_patch = description_patch\n c.former_type_ids = former_type_ids\n c.former_location = former_location\n # adding an observation\n if author.nil? and not observation.nil?\n c.author = observation.author\n # adding a location\n elsif author.nil? and observation.nil? and description == \"added\"\n c.author = location.author\n # editing a location\n elsif not author.nil?\n c.author = author\n end\n c.save\n end", "def update_document_tags(doc)\n idx = fetch_index(doc.repo)\n return nil if (! idx)\n # no way to check if doc exists in index! just call replace (add/del)\n idx.replace(doc)\n # FIXME: update cached list of known tags, if cached\n end", "def update \n end", "def update_ig_retentions\n IgRetention.update_all('operator_aptour_id = id_ope')\n end", "def add_weblog_explain; \"Adds a pre-existing hobix weblog to your list.\"; end" ]
[ "0.55723226", "0.55404735", "0.5522223", "0.54790014", "0.5458692", "0.54485846", "0.54485846", "0.54485846", "0.54485846", "0.54485846", "0.54485846", "0.54485846", "0.54485846", "0.5441119", "0.5396982", "0.5390092", "0.5335071", "0.52499294", "0.5243563", "0.5231356", "0.5231356", "0.5222689", "0.5217766", "0.5170594", "0.51366436", "0.5135804", "0.5132964", "0.51101583", "0.51088005", "0.5106809", "0.5104213", "0.50827724", "0.5072031", "0.507158", "0.50706077", "0.50671893", "0.5061057", "0.50475", "0.5044729", "0.50357646", "0.5035611", "0.5032727", "0.50311553", "0.5027638", "0.50226414", "0.50224894", "0.50209624", "0.50193924", "0.5017047", "0.5015687", "0.50112724", "0.49934155", "0.4990508", "0.49837294", "0.49728516", "0.495914", "0.4954212", "0.4942141", "0.49240583", "0.49100056", "0.49049106", "0.490123", "0.49006948", "0.48995963", "0.48995963", "0.48995963", "0.48949674", "0.48882928", "0.4885332", "0.48685235", "0.4858667", "0.48506212", "0.48471525", "0.4845549", "0.4836218", "0.48337013", "0.4829281", "0.4829281", "0.48245633", "0.48244873", "0.48225215", "0.48211405", "0.48193502", "0.4814778", "0.48143655", "0.48143655", "0.48114794", "0.48113003", "0.48102465", "0.48091966", "0.4801546", "0.47998655", "0.47940508", "0.47910064", "0.47910064", "0.4788448", "0.47856945", "0.47855467", "0.47807646", "0.4777351", "0.47735685" ]
0.0
-1
To change the redisBinary system property for running the test, use argLine option from surefire plugin: $ mvn DargLine="DredisBinary=`which redisserver`" Punittest clean \ verify
def run_with_config_file(configPath=nil) if configPath.class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:runWithConfigFile, [Java::java.lang.String.java_class]).call(configPath),::VertxRedisson::RedisProcess) end raise ArgumentError, "Invalid arguments when calling run_with_config_file(configPath)" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def startup_test_redis\n `redis-server #{TEST_DIR_BASE}/redis-test.conf`\n Resque.redis = 'localhost:9736'\nend", "def initialize\n @redis = MockRedis.new( :url => ENV[\"REDISTOGO_URL\"] ) # later, that env variable will be filled.\n end", "def fake_redis!\n @@redis = Redis.new(host: ENV['REDIS_HOST'])\n end", "def testCommandLineVersion\n executeSlave( [ '--version' ] )\n end", "def spin_up_redis(redis_port, redis_path, dbname)\n @process = ChildProcess.build(File.expand_path(\"~/bin/redis-server\"), \"-\")\n @process.duplex = true\n @process.start\n at_exit { @process.send(:send_kill) if [email protected]? }\n @process.io.stdin.puts config(redis_port, redis_path, dbname)\n @process.io.stdin.close\n end", "def redis\n ::RSpec.configure do |config|\n config.add_setting :redis\n config.redis = Rails.redis if defined?(Rails.redis)\n config.add_setting :flush_redis_proc\n config.flush_redis_proc = ->(*) { Array.wrap(config.redis).each(&:flushdb) }\n config.before(flush_redis: true) { instance_exec(&config.flush_redis_proc) }\n config.after(:suite) { instance_exec(&config.flush_redis_proc) }\n end\n end", "def set_up_redis(base)\n base.class_eval do\n before do\n stub_const(\"Lita::REDIS_NAMESPACE\", \"lita.test\")\n keys = Lita.redis.keys(\"*\")\n Lita.redis.del(keys) unless keys.empty?\n end\n end\n end", "def testCommandLineVersionShort\n executeSlave( [ '-v' ] )\n end", "def create_redis_init\n redis_init_script = <<'_REDIS_INIT_SCRIPT_'\n#!/usr/bin/env bash\n### BEGIN INIT INFO\n# Provides: redis-server\n# Required-Start: $syslog\n# Required-Stop: $syslog\n# Should-Start: $local_fs\n# Should-Stop: $local_fs\n# Default-Start: 2 3 4 5\n# Default-Stop: 0 1 6\n# Short-Description: redis-server - Persistent key-value db\n# Description: redis-server - Persistent key-value db\n### END INIT INFO\n#\n# Author: Wayne E. Seguin <[email protected]>\n# License: The same licence as Redis, New BSD\n# http://www.opensource.org/licenses/bsd-license.php\n#\n\n# Source the system config file, if it exists.\nif [[ -s /etc/conf.d/redis ]] ; then\n source /etc/conf.d/redis\nfi\n\n# Default config variables that have not been set.\nport=\"${port:-6379}\"\nprefix=\"${prefix:-/opt/rhoconnect}\"\nredis=\"${prefix}/bin/redis-server\"\nredis_cli=\"${prefix}/bin/redis-cli\"\npidfile=\"${pidfile:-/var/run/redis.pid}\"\nconfig=\"${config:-/opt/rhoconnect/etc/redis.conf}\"\nuser=\"${user:-root}\"\n#prefix=\"${prefix:-/usr/local}\"\n#config=\"${config:-/usr/local/etc/redis.conf}\"\n#pidfile=\"${pidfile:-/var/run/redis/redis.pid}\"\n#config=\"${config:-/etc/redis/redis.conf}\"\n#user=\"${user:-redis}\"\n\n# If the redis-cli file is not found, terminate the script.\ntest -x $redis_cli || exit 0\n\n#\n# Set the running $pid value based on $pidfile.\n#\nif [[ -s \"$pidfile\" ]] ; then\n pid=$(cat $pidfile)\nelse\n rm -f $pidfile\nfi\n\n# In case there was pidfile corruption...\nif [[ \"Linux\" = \"$(uname)\" ]] ; then\n # /proc does not exist on say, Darwin\n if [[ ! -z \"${pid}\" ]] && [[ ! -x \"/proc/${pid}\" ]] ;then\n pid=\"$(ps auxww | grep [r]edis | grep \"$config\" | grep -v 'grep' | awk '{print $2}')\"\n elif [[ -z \"${pid}\" ]] ; then\n pid=\"$(ps auxww | grep [r]edis | grep \"$config\" | grep -v 'grep' | awk '{print $2}')\"\n fi\nelse\n if [[ -z \"${pid}\" ]] ; then\n pid=\"$(ps auxww | grep [r]edis | grep \"$config\" | grep -v 'grep' | awk '{print $2}')\"\n fi\nfi\n\n#\n# Start redis using redis-server as user 'redis'.\n#\nredis_start() {\n if [[ -f $pidfile ]] ; then\n echo \"$pidfile exists, redis-server is either already running or crashed.\"\n exit 1\n elif [[ ! -z \"$pid\" ]] ; then\n echo -e \"\\nRedis is already running with configuration '$config'.\"\n echo \"$pid\" > $pidfile # Ensure pidfile exists with the pid.\n else\n echo \"Starting Redis server...\"\n su $user -c \"$redis $config\"\n exit 0\n fi\n}\n\n#\n# Stop redis using redis-cli SHUTDOWN.\n#\nredis_stop() {\n echo -n \"Stopping redis server on port ${port} ... \"\n \"$redis_cli\" -p ${port} SHUTDOWN\n\n # Keep user informed while server shuts down.\n echo \"Waiting for the redis server to shutdown \"\n\n if [[ \"Linux\" = \"$(uname)\" ]] ; then\n if [[ \"${pid}\" = \"\" ]] ; then\n echo \"redis server is not running.\"\n # Clear out the old pidfile if available\n rm -f $pidfile\n exit 1\n fi\n while [[ -x /proc/${pid} ]] ; do\n echo -n '.' ; sleep 1\n done\n else # Darwin, etc ...\n while [[ ! -z \"$(ps auxww | grep [r]edis | grep \"$config\" | grep -v grep | awk '{print $2}')\" ]] ; do\n echo -n '.' ; sleep 1\n done\n fi\n\n # Clear out the old pidfile.\n rm -f $pidfile\n\n # Notify user of successful completion.\n echo -e \"redis server stopped.\"\n exit 0\n}\n\nredis_usage() {\n echo -e \"Usage: $0 {start,stop,restart,status}\"\n exit 1\n}\n\nredis_status() {\n \"$redis_cli\" -p ${port} INFO > /dev/null 2>&1\n info=$?\n if (( $info )) ; then\n echo \"Redis server not running\";\n else\n echo \"Redis server running\";\n fi\n exit $info\n}\n\n#\n# CLI logic.\n#\ncase \"$1\" in\n start) redis_start ;;\n stop) redis_stop ;;\n restart)\n $0 stop\n $0 start\n ;;\n status) redis_status ;;\n *) redis_usage ;;\nesac\n_REDIS_INIT_SCRIPT_\n\n redisInit=\"/etc/init.d/redis\"\n File.open(redisInit, 'w') { |f| f << redis_init_script }\n\n # Make the init script executable\n `chmod +x #{redisInit}`\n # Set run levels\n if @dist == 'debian'\n `update-rc.d -f redis defaults` \n else\n `/sbin/chkconfig redis on`\n # `/sbin/chkconfig --list redis`\n end\n\n redis_init_script\nend", "def redis_command\n if redis.empty?\n # Default to old method of connecting to redis\n # for users that haven't updated their configuration\n %W(env -i redis-cli)\n else\n redis['database'] ||= 0\n redis['host'] ||= '127.0.0.1'\n redis['port'] ||= '6379'\n if redis.has_key?(\"socket\")\n %W(#{redis['bin']} -s #{redis['socket']} -n #{redis['database']})\n else\n if redis.has_key?(\"pass\")\n %W(#{redis['bin']} -h #{redis['host']} -p #{redis['port']} -n #{redis['database']} -a #{redis['pass']})\n else\n %W(#{redis['bin']} -h #{redis['host']} -p #{redis['port']} -n #{redis['database']})\n end\n end\n end\n end", "def test(command)\n run(command, :test => true)\n end", "def build_unit_test_execution_cmd(test_configuration)\n if test_configuration[:docker]\n test_configuration[:run_tests_command] = 'npm run test:docker'\n else\n test_configuration[:run_tests_command] = 'npm test'\n end\n end", "def test_using_switches_argument\n run_test_with switches: [\"--proxy-server=#{PROXY}\"]\n end", "def retest\n spawn_cmd \"ctest --test-dir #{@build_dir} #{'-VV' if verbose?} #{@jobflag} --rerun-failed --output-on-failure\"\n end", "def test_command(args='')\n File.join(File.expand_path(File.dirname(__FILE__)),'command_for_tests.sh') + ' ' + args\n end", "def check_for_redis(args)\n uri = URI.parse(args[:redis])\n $redis = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)\n begin\n $redis.ping\n true\n rescue\n help_now!(\"######### WARNING: Redis needs to be running. #########\")\n false\n end\nend", "def test\n cmd = \"rackup #{@test_config}\" \n puts \"=> #{cmd} -p 5000 -E test -o 127.0.0.1\"\n system(cmd)\nend", "def initialize(redis)\n @redis = redis\n @load_path = RedisScripts.load_path\n end", "def test_setup\n flags = %w(-s -f 500 -u 100 -g 200 -l foo.log) + [\"-p\", @prefix, @default_filename]\n IO.popen([@binary] + flags, \"r+\") {|f| f.close_write; f.close_read}\n assert_equal(0, $?.exitstatus, \"#{@binary} exited non-zero when testing flags\")\n end", "def redis\n return @redis if @redis\n self.redis = ENV['RELATED_REDIS_URL'] || ENV['REDIS_URL'] || 'localhost:6379'\n self.redis\n end", "def cmd_test(test, rvm=false)\n cmd_if %{[ #{test} ]}, rvm\nend", "def init_queue_redis(hash)\n puts \"init_queue_redis: \" + @all_test_files_to_run.length().to_s + \" tests\"\n num = KnapsackPro::Config::Env.redis_get_num\n puts num\n @redis.rpush(hash, @all_test_files_to_run)\n @redis.rpush(hash, Array.new(@ci_node_total * num) { |i| \"0\" })\n @redis.expire(hash, KnapsackPro::Config::Env.redis_expire)\n end", "def cli\n config = api.get_config_vars(app).body\n matches = config.keys & [options[:name] || REDIS_PROVIDERS].flatten\n\n case matches.length\n when 0 then error 'No redis add-on found'\n when 1 then\n uri = URI.parse(config[matches.first])\n exec \"redis-cli -h #{uri.host} -p #{uri.port} -a #{uri.password} #{args.join(\" \")}\"\n else error <<-ERROR\n More than one redis add-on found, please specify one with:\n heroku redis:cli\n ERROR\n end\n end", "def redis(new: false)\n params = {}\n params.merge!(url: ENV['REDIS_URL']) if ENV.key?('REDIS_URL')\n params.merge!(path: ENV['REDIS_PATH']) if ENV.key?('REDIS_PATH')\n\n if new\n Redis.new(**params)\n else\n @redis ||= Redis.new(**params)\n end\n end", "def build_dcp_test_execution_cmd(test_configuration)\n run_tests_command = ''\n run_tests_command += \" --config #{test_configuration[:config]}\" if test_configuration[:config]\n run_tests_command += \" --base-url=#{test_configuration[:base_url]}\" if test_configuration[:base_url]\n test_configuration[:run_tests_command] = \"bundle exec dcp-checker#{run_tests_command}\"\n end", "def mock_rpm(mock_config, srpm, mockfile)\n cmd_args = \" #{srpm}\"\n mock_artifact(mock_config, cmd_args, mockfile)\nend", "def run_cmd\n @run_cmd ||= local_suite_files.empty? ? nil : \"#{sudo}#{jr_bin} test\"\n end", "def wix_run binary, arguments\n Rake.sh \"\\\"#{wix_path binary}\\\" #{arguments}\"\n end", "def testMissingSlave\n executeProcess(\n [\n '--masterticket', '123'\n ],\n :Error => WEACE::MissingVariableError\n )\n end", "def test_rubyopt\n with_fixture 'environment' do\n with_env \"RUBYOPT\" => \"-rtime\" do\n assert system(\"ruby\", ocra, \"environment.rb\", *DefaultArgs)\n assert system(\"environment.exe\")\n env = Marshal.load(File.open(\"environment\", \"rb\") { |f| f.read })\n assert_equal \"-rtime\", env['RUBYOPT']\n end\n end\n end", "def test_command_checks_for_binaries_each_time\n provider = newprovider\n\n provider.commands :testing => \"/no/such/path\"\n\n provider.stubs(:which).returns \"/no/such/path\"\n\n provider.command(:testing)\n assert_equal(\"/no/such/path\", provider.command(:testing), \"Did not return correct binary path\")\n end", "def testSlaveProductWithoutAsArg\n executeInstall(['--install', 'SlaveProduct', '--product', 'DummyProduct', '--as'],\n :Repository => 'Dummy/SlaveClientInstalled',\n :AddRegressionSlaveAdapters => true,\n :Error => OptionParser::MissingArgument\n ) do |iError|\n assert_equal(nil, $Variables[:ComponentInstall])\n end\n end", "def initialize\n @redis = Redis.new(host: 'redis', port: 6379)\n end", "def setup_auto_test\n ENV['RSPEC'] = 'true' # allows autotest to discover rspec\n ENV['AUTOTEST'] = 'true' # allows autotest to run w/ color on linux\n# $:.push(File.join(File.dirname(__FILE__), 'spec'))\n system((RUBY_PLATFORM =~ /mswin|mingw/ ? 'autotest.bat' : 'autotest'), *ARGV) ||\n $stderr.puts('Unable to find autotest. Please install ZenTest or fix your PATH') && false\nend", "def run_eunit_all\n cmd = \"./rebar eunit skip_deps=true\"\n puts \"Executing #{cmd}\"\n puts `#{cmd}`\n if $? == 0\n Growl.notify_ok \"eunit: all tests passed.\"\n else\n Growl.notify_error \"eunit: tests failed.\"\n end\nend", "def build_e2e_test_execution_cmd(test_configuration)\n run_tests_command = ''\n # bind environment variable for base url to be used in e2e base config.\n Kernel.abort('Please specify a base url. For example --base-url=http://foo.com') if test_configuration[:base_url].nil?\n bind_environment_variable('RHD_BASE_URL', test_configuration[:base_url])\n bind_environment_variable('RHD_TEST_CONFIG', 'docker') if test_configuration[:docker]\n bind_environment_variable('RHD_TEST_CONFIG', 'browserstack') if test_configuration[:browserstack]\n bind_environment_variable('RHD_TEST_PROFILE', test_configuration[:profile]) if test_configuration[:profile]\n bind_environment_variable('RHD_CHIMP_TAGS', test_configuration[:cucumber_tags]) if test_configuration[:cucumber_tags]\n\n run_tests_command += \"--baseUrl=#{test_configuration[:base_url]}\"\n if test_configuration[:docker]\n # for running tests inside of docker\n test_configuration[:browser_count] = 1 if test_configuration[:browser_count].nil?\n test_configuration[:run_tests_command] = \"npm test -- #{run_tests_command}\"\n else\n # run tests via a local browser\n test_configuration[:run_tests_command] = \"cd #{@test_dir}/e2e && npm test -- #{run_tests_command}\"\n end\n end", "def start_rerun(test_run)\n\n end", "def build_blc_test_execution_cmd(test_configuration)\n run_tests_command = ''\n run_tests_command += \" -c #{test_configuration[:config]}\" if test_configuration[:config]\n run_tests_command += \" -u #{test_configuration[:base_url]}\" if test_configuration[:base_url]\n run_tests_command += \" -s #{test_configuration[:single_url]}\" if test_configuration[:single_url]\n run_tests_command += ' --ignore-internal' if test_configuration[:ignore_internal]\n run_tests_command += ' --ignore-external' if test_configuration[:ignore_external]\n run_tests_command += ' --ignore-ssl' if test_configuration[:ignore_ssl]\n run_tests_command += ' -v' if test_configuration[:verbose]\n test_configuration[:run_tests_command] = \"bundle exec blinkr#{run_tests_command}\"\n end", "def build_blc_test_execution_cmd(test_configuration)\n run_tests_command = ''\n run_tests_command += \" -c #{test_configuration[:config]}\" if test_configuration[:config]\n run_tests_command += \" -u #{test_configuration[:base_url]}\" if test_configuration[:base_url]\n run_tests_command += \" -s #{test_configuration[:single_url]}\" if test_configuration[:single_url]\n run_tests_command += ' --ignore-internal' if test_configuration[:ignore_internal]\n run_tests_command += ' --ignore-external' if test_configuration[:ignore_external]\n run_tests_command += ' --ignore-ssl' if test_configuration[:ignore_ssl]\n run_tests_command += ' -v' if test_configuration[:verbose]\n test_configuration[:run_tests_command] = \"bundle exec blinkr#{run_tests_command}\"\n end", "def testBuildProcessCmdDependency\n setRepository('DeliverablesProcessDependency') do |iRepoDir|\n runFSCMS(['Build', '--', '--target', 'TestType/TestID2/0.1/TestDeliverable'])\n lBuiltFileName = \"#{iRepoDir}/TestType/TestID1/0.1/Deliverables/TestDeliverable/BuiltFile\"\n assert(File.exists?(lBuiltFileName))\n File.open(lBuiltFileName, 'r') do |iFile|\n assert_equal($FSCMSTest_RepositoryToolsDir, iFile.read)\n end\n lBuiltFileName = \"#{iRepoDir}/TestType/TestID2/0.1/Deliverables/TestDeliverable/BuiltFile\"\n assert(File.exists?(lBuiltFileName))\n File.open(lBuiltFileName, 'r') do |iFile|\n assert_equal([\n $FSCMSTest_RepositoryToolsDir,\n \"#{iRepoDir}/TestType/TestID1/0.1/Deliverables/TestDeliverable\"\n ], iFile.read.split(\"\\n\"))\n end\n end\n end", "def testSlaveProductWithoutProductArg\n executeInstall(['--install', 'SlaveProduct', '--as', 'RegProduct', '--product'],\n :Repository => 'Dummy/SlaveClientInstalled',\n :AddRegressionSlaveAdapters => true,\n :Error => OptionParser::MissingArgument\n ) do |iError|\n assert_equal(nil, $Variables[:ComponentInstall])\n end\n end", "def redis=(server)\n @redis = nil\n @redis_config = server\n end", "def setup\n # wipe and recreate .test directory \n Dir.chdir(@@start_dir)\n if File.exist?('.test')\n FileUtils.rm_rf('.test')\n end\n \n # NOTE: I don't think we want to kill .repository in pwd from running test\n if File.exist?('.repository')\n FileUtils.rm_rf('.repository')\n end\n Dir.mkdir('.test')\n Dir.chdir('.test')\n end", "def redis=(arg)\n if arg.is_a? Redis\n @redis = arg\n else\n @redis = Redis.new(arg)\n end\n end", "def redis=(arg)\n if arg.is_a? Redis\n @redis = arg\n else\n @redis = Redis.new(arg)\n end\n end", "def test_bookkeeping\n assert_equal 1, RunLengthEncoding::VERSION\n end", "def make_test_cmd multi = false # :nodoc:\n framework = SUPPORTED_TEST_FRAMEWORKS[testlib]\n raise \"unsupported test framework #{testlib}\" unless framework\n\n tests = [\"rubygems\", framework] +\n test_globs.map { |g| Dir.glob(g) }.flatten\n tests.map! {|f| %(require \"#{f}\")}\n\n cmd = \"#{Hoe::RUBY_FLAGS} -e '#{tests.join(\"; \")}' #{FILTER}\"\n\n if multi then\n ENV['EXCLUDED_VERSIONS'] = multiruby_skip.join \":\"\n cmd = \"-S multiruby #{cmd}\"\n end\n\n cmd\n end", "def execute_tests(args = [])\n test_configuration = @run_tests_options.parse_command_line(args)\n\n if test_configuration[:docker]\n run_tests_in_docker(test_configuration)\n else\n run_tests_from_command_line(test_configuration)\n end\n end", "def install\n bin.install \"testscript\"\n end", "def test_bin\n Dir.chdir(File.expand_path(__dir__))\n assert_command('../bin/chuckle url_file.txt')\n end", "def testNominalWithRN\n setupTest do |iTasksFileName, iTicketsFileName|\n $Context[:OS_ExecAnswers] = [\n # svn co => success\n [ 0, '' ],\n # deliver => success, generating files\n [ 0, '', @@Generator_SingleDummyGemWithRN ]\n ]\n executeProcess(\n [\n '--user', 'ReleaseUser',\n '--branch', 'BranchName',\n '--comment', 'ReleaseComment',\n '--version', '0.0.1.20100317',\n '--tasksfile', iTasksFileName,\n '--ticketsfile', iTicketsFileName,\n '--svnco', 'MySVNRep',\n '--deliver', 'deliver %{DeliverablesDir}'\n ]\n ) do |iError, iSlaveActions|\n checkCallsMatch(\n [\n [ 'query', 'svn co MySVNRep' ],\n [ 'query', /^deliver .*$/ ]\n ],\n $Variables[:OS_Exec]\n )\n assert_equal( @@CommonSlaveActions.merge(\n {\n Tools::FilesManager => {\n Actions::File_Upload => [\n [ WEACE::Master::TransferFile.new(\"#{$Variables[:DeliverableDir]}/Releases/All/Gem/DummyGem.gem\"), 'All', 'Gem', 'BranchName', '0.0.1.20100317', 'ReleaseUser', 'ReleaseComment' ]\n ],\n Actions::File_UploadReleaseNote => [\n [ WEACE::Master::TransferFile.new(\"#{$Variables[:DeliverableDir]}/ReleaseNotes/DummyGemReleaseNote.html\"), 'html', 'BranchName', '0.0.1.20100317', 'ReleaseUser', 'ReleaseComment' ]\n ]\n }\n } ),\n iSlaveActions\n )\n end\n end\n end", "def testBuildProcessParameterDependency\n setRepository('DeliverablesProcessDependency') do |iRepoDir|\n runFSCMS(['Build', '--', '--target', 'TestType/TestID2/0.3/TestDeliverable'])\n lBuiltFileName = \"#{iRepoDir}/TestType/TestID1/0.1/Deliverables/TestDeliverable/BuiltFile\"\n assert(File.exists?(lBuiltFileName))\n File.open(lBuiltFileName, 'r') do |iFile|\n assert_equal($FSCMSTest_RepositoryToolsDir, iFile.read)\n end\n lBuiltFileName = \"#{iRepoDir}/TestType/TestID2/0.3/Deliverables/TestDeliverable/BuiltFile\"\n assert(File.exists?(lBuiltFileName))\n File.open(lBuiltFileName, 'r') do |iFile|\n assert_equal([\n $FSCMSTest_RepositoryToolsDir,\n \"#{iRepoDir}/TestType/TestID1/0.1/Deliverables/TestDeliverable\"\n ], iFile.read.split(\"\\n\"))\n end\n end\n end", "def sub_test\n shell(test_script, source_dir)\n end", "def config(redis_port, redis_path, dbname)\n <<-CONFIG\n daemonize no\n port #{redis_port || find_available_port}\n dbfilename #{dbname}.db\n dir #{redis_path}\n appendonly no\n save 3600 1000\n CONFIG\n end", "def setup_script_execution\n Dir.glob(File.join(RIGHT_LINK_SPEC_HELPER_TEMP_PATH, '__TestScript*')).should be_empty\n Dir.glob(File.join(RIGHT_LINK_SPEC_HELPER_TEMP_PATH, '[0-9]*')).should be_empty\n InstanceConfiguration.const_set(:CACHE_PATH, File.join(RIGHT_LINK_SPEC_HELPER_TEMP_PATH, 'cache'))\n end", "def test_bad_rubinius_deps\n check_deps_fail BadRubiniusBall unless `/usr/bin/which rbx`.chomp.empty?\n end", "def runner(environment = \"test\")\n # A workaround so that ChefSpec can work with Chef environments (from https://github.com/acrmp/chefspec/issues/54)\n\n @runner ||= ChefSpec::ChefRunner.new do |node|\n # Delete the above line and uncomment the two below if you want to load dependent cookbooks\n #cookbook_paths = %W(#{File.expand_path(\"..\", Dir.pwd)} #{File.expand_path(Dir.pwd)}/cookbooks)\n #@runner ||= ChefSpec::ChefRunner.new({cookbook_path: cookbook_paths}) do |node|\n env = Chef::Environment.new\n env.name environment\n\n node.stub(:chef_environment).and_return env.name\n Chef::Environment.stub(:load).and_return env\n end\nend", "def test\n puts 'Running reagan_test.yml defined tests:'\n # check to see if a reagan_test.yml file exists\n if File.exist?(File.join(Config.settings['jenkins']['workspace_dir'], 'cookbooks', @cookbook, 'reagan_test.yml'))\n\n # load the reagan config file\n reagan_def = YAML.load_file(File.join(Config.settings['jenkins']['workspace_dir'], 'cookbooks', @cookbook, 'reagan_test.yml'))\n\n # change into the cookbook dir so rake tests run locally\n Dir.chdir(File.join(Config.settings['jenkins']['workspace_dir'], 'cookbooks', @cookbook))\n\n status = true\n reagan_def['tests'].each do |test|\n puts \" reagan_test.yml test: '#{test}'\"\n result = system test\n status = false if result == false\n end\n puts status ? 'PASS: reagan_test.yml test was successful' : 'FAIL: reagan_test.yml test was NOT successful'.indent.to_red\n status\n else\n puts 'SKIP: No reagan_test.yml file found in the cookbook path. Skipping test'.indent\n status\n end\n end", "def redis\n @redis ||= if @redis_config.nil? || @redis_config.kind_of?(String)\n url = URI(@redis_config || \"redis://127.0.0.1:6379/0\")\n\n Updater.check_schema(Redis.new({\n :host => url.host,\n :port => url.port,\n :db => url.path[1..-1],\n :password => url.password\n }))\n else\n Updater.check_schema(@redis_config)\n end\n end", "def testMissingMaster\n executeProcess(\n [\n '--slaveticket', '456'\n ],\n :Error => WEACE::MissingVariableError\n )\n end", "def test_system_proxy_add\n proxy = OpenShift::FrontendProxyServer.new \n\n proxy.expects(:shellCmd).with(equals('openshift-port-proxy-cfg setproxy 3000 \"127.0.0.1:1000\"')).once\n proxy.system_proxy_set({:proxy_port => 3000, :addr => '127.0.0.1:1000'})\n\n proxy.expects(:shellCmd)\n .with(equals('openshift-port-proxy-cfg setproxy 3000 \"127.0.0.1:1000\" 3001 \"127.0.0.1:1001\" 3002 \"127.0.0.1:1002\"'))\n .once\n\n proxy.system_proxy_set(\n {:proxy_port => 3000, :addr => '127.0.0.1:1000'},\n {:proxy_port => 3001, :addr => '127.0.0.1:1001'},\n {:proxy_port => 3002, :addr => '127.0.0.1:1002'}\n )\n end", "def drb_launch_tests(drb_runner, test_scripts, test_scripts_names, test_names)\n cmdline = []\n\n Dir.chdir(IntelliJ::WORK_DIR) if IntelliJ::WORK_DIR\n\n IntelliJ::parse_launcher_string(IntelliJ::RUBY_INTERPRETER_CMDLINE, cmdline)\n\n # drb runner\n cmdline << drb_runner\n\n if drb_runner.end_with?('spring')\n test_name_pattern = get_test_name_pattern(test_names)\n\n rails = Gem.loaded_specs['rails']\n\n version = rails ? rails.version : Gem::Version.new(IntelliJ::RAILS_VERSION || 0)\n\n if version && version >= Gem::Version.new('4')\n cmdline << 'rake'\n cmdline << 'test'\n\n ARGV.each { |arg|\n cmdline << arg\n }\n\n test_script_pattern = test_scripts_names.empty? ? \"**/*_test.rb\": test_scripts_names.join(\",\")\n cmdline << \"TEST=#{IntelliJ::FOLDER_PATH}/{#{test_script_pattern}}\"\n cmdline << \"TESTOPTS=#{test_name_pattern}\" unless test_names.empty?\n else\n cmdline << 'testunit'\n\n ARGV.each { |arg|\n cmdline << arg\n }\n\n cmdline << test_name_pattern\n\n cmdline.concat(test_scripts)\n end\n\n else\n if drb_runner.end_with?('zeus')\n cmdline << 'test'\n else\n load_path = cmdline.find_all {|param|\n (!param.nil?) && param.start_with?('-I')\n }\n cmdline.concat load_path\n end\n\n ARGV.each { |arg|\n cmdline << arg\n }\n\n # tests to launch\n cmdline.concat(test_scripts)\n end\n\n puts 'Command line: '\n p cmdline\n\n require 'rubygems'\n require 'rake'\n\n result = sh(*cmdline) do |ok, res|\n unless ok\n puts \"Exit code: #{res.exitstatus}\"\n end\n end\n puts result\nend", "def test\n return\n # TODO\n # skips test framework, but we can probably just bastardize the options in the same way as with :skip_bundle\n # either make `test` build the actual directories etc., or use a script\n # either way, this method is stupid.\n end", "def test\n return\n # TODO\n # skips test framework, but we can probably just bastardize the options in the same way as with :skip_bundle\n # either make `test` build the actual directories etc., or use a script\n # either way, this method is stupid.\n end", "def test_it_works_with_remote_automation\n Rake.cd TEST_APP\n\n github_url = 'https://github.com'\n user_and_reponame = \"ParamagicDev/#{GITHUB_REPO_NAME}/tree/#{BRANCH}\"\n\n file = 'bridgetown.automation.rb'\n\n url = \"#{github_url}/#{user_and_reponame}/#{file}\"\n\n Rake.sh('bundle exec bridgetown new . --force ')\n Rake.sh(\"bridgetown apply #{url}\")\n\n run_assertions\n end", "def testNominal\n setupTest do |iTasksFileName, iTicketsFileName|\n $Context[:OS_ExecAnswers] = [\n # svn co => success\n [ 0, '' ],\n # deliver => success, generating files\n [ 0, '', @@Generator_SingleDummyGem ]\n ]\n executeProcess(\n [\n '--user', 'ReleaseUser',\n '--branch', 'BranchName',\n '--comment', 'ReleaseComment',\n '--version', '0.0.1.20100317',\n '--tasksfile', iTasksFileName,\n '--ticketsfile', iTicketsFileName,\n '--svnco', 'MySVNRep',\n '--deliver', 'deliver %{DeliverablesDir}'\n ]\n ) do |iError, iSlaveActions|\n checkCallsMatch(\n [\n [ 'query', 'svn co MySVNRep' ],\n [ 'query', /^deliver .*$/ ]\n ],\n $Variables[:OS_Exec]\n )\n assert_equal( @@CommonSlaveActions.merge(\n {\n Tools::FilesManager => {\n Actions::File_Upload => [\n [ WEACE::Master::TransferFile.new(\"#{$Variables[:DeliverableDir]}/Releases/All/Gem/DummyGem.gem\"), 'All', 'Gem', 'BranchName', '0.0.1.20100317', 'ReleaseUser', 'ReleaseComment' ]\n ]\n }\n } ),\n iSlaveActions\n )\n end\n end\n end", "def redis\n redis_master_source = @config.redis_server =~ /^\\S+\\:\\d+$/ ? \"server_string\" : \"master_file\"\n _eigenclass_.class_eval <<-EVALS, __FILE__, __LINE__\n def redis\n redis_master_from_#{redis_master_source}\n end\n EVALS\n redis\n end", "def run_tests\n system(\"bundle exec rspec #{rspec_arguments.join(' ')}\")\n end", "def shell_run\n success = ruby('rubytest', *config.to_shellwords)\n exit -1 unless success\n end", "def re_run_basic_smoke_test\n beaker = \"bundle exec beaker --debug --root-keys --repo-proxy\"\n beaker += \" --preserve-hosts always\"\n beaker += \" --type aio\"\n beaker += \" --helper acceptance/lib/helper.rb\"\n beaker += \" --options-file #{BEAKER_OPTIONS_FILE}\"\n beaker += \" --load-path acceptance/lib\"\n beaker += \" --config acceptance/scripts/hosts.cfg\"\n beaker += \" --keyfile ~/.ssh/id_rsa-acceptance\"\n beaker += \" --tests acceptance/suites/tests/00_smoke\"\n\n sh beaker\nend", "def generate_redis_connection!\n redis_options ? Redis.new(**redis_options) : Redis.current\n end", "def redis=(redis)\n @redis = redis\n end", "def setup_server\n ENV[\"RAILS_ENV\"] = \"test\"\n require \"rails\"\n fork do\n exec \"cd test/rails#{Rails::VERSION::MAJOR}_dummy && COVERBAND_TEST=test bundle exec rackup config.ru -p 9999 --pid /tmp/testrack.pid\"\n end\n end", "def testSlaveProductWithoutAs\n executeInstall(['--install', 'SlaveProduct', '--product', 'DummyProduct'],\n :Repository => 'Dummy/SlaveClientInstalled',\n :AddRegressionSlaveAdapters => true,\n :Error => WEACEInstall::CommandLineError\n ) do |iError|\n assert_equal(nil, $Variables[:ComponentInstall])\n end\n end", "def redis\n @redis ||= begin\n redis = Redis.new(config.redis)\n Redis::Namespace.new(REDIS_NAMESPACE, redis: redis).tap do |client|\n begin\n client.ping\n rescue Redis::BaseError => e\n if Lita.test_mode?\n raise RedisError, I18n.t(\"lita.redis.test_mode_exception\", message: e.message)\n else\n Lita.logger.fatal I18n.t(\n \"lita.redis.exception\",\n message: e.message,\n backtrace: e.backtrace.join(\"\\n\")\n )\n abort\n end\n end\n end\n end\n end", "def run_test(test_data, pin_config, pin_output)\n command = %Q|\"#{pin_config[:binary]}\" -t \"#{pin_config[:tool_binary]}\"| +\n %Q| -o \"#{pin_output}\" | +\n pin_config[:tool_args].map { |arg| %Q|\"#{arg}\"| }.join(' ') + ' -- ' +\n %Q|\"#{test_data['binary']}\" | +\n test_data['args'].map { |arg| %Q|\"#{arg}\"| }.join(' ')\n command += %Q| < \"#{test_data['stdin']}\"| if test_data['stdin']\n \n Dir.chdir(test_data['directory'] || pin_config[:temp_dir]) do\n puts command + \"\\n\"\n Kernel.system command\n end\nend", "def testRunActionToolConfigParam\n executeSlave(\n [\n '--user', 'DummyUser',\n '--tool', 'DummyTool',\n '--action', 'DummyAction'\n ],\n :AddRegressionActions => true,\n :Repository => 'Dummy/SlaveActionActive'\n ) do |iError|\n assert_equal(\n {\n :PersonalizedToolAttr => 'PersonalizedToolValue'\n },\n $Variables[:DummyAction_ToolConfig]\n )\n end\n end", "def testResumeSlaveClientQueue\n initTestCase do\n executeMaster( [ '--send' ],\n :Repository => 'Dummy/MasterServerInstalledWithDummySender',\n :AddRegressionProcesses => true,\n :AddRegressionSenders => true,\n :AddSlaveClientQueues => {\n {\n :Type => 'DummySender',\n :Tools => [\n Tools::All\n ]\n } => [\n [ 'DummyUser1',\n {\n 'DummyTool1' => {\n 'DummyAction1' => [\n []\n ]\n }\n }\n ]\n ]\n }\n ) do |iError|\n assert_equal( [\n [ 'sendMessage', [ 'DummyUser1', {\n 'DummyTool1' => {\n 'DummyAction1' => [\n []\n ]\n }\n } ]\n ]\n ],\n $Variables[:DummySenderCalls]\n )\n assert_equal([], getSlaveClientQueue)\n end\n end\n end", "def testRunActionProductConfigParam\n executeSlave(\n [\n '--user', 'DummyUser',\n '--tool', 'DummyTool',\n '--action', 'DummyAction'\n ],\n :AddRegressionActions => true,\n :Repository => 'Dummy/SlaveActionActive'\n ) do |iError|\n assert_equal(\n {\n :PersonalizedProductAttr => 'PersonalizedProductValue'\n },\n $Variables[:DummyAction_ProductConfig]\n )\n end\n end", "def testRunActionWithoutTool\n executeSlave(\n [\n '--user', 'DummyUser',\n '--action', 'DummyAction'\n ],\n :AddRegressionActions => true,\n :Error => WEACE::Slave::Client::CommandLineError\n )\n end", "def redis=(server)\n if server.is_a? String\n if server =~ /redis\\:\\/\\//\n @redis = Redis.connect(:url => server, :thread_safe => true)\n else\n host, port, db = server.split(':')\n @redis = Redis.new(:host => host, :port => port,\n :thread_safe => true, :db => db)\n end\n else\n @redis = server\n end\n end", "def test_set_key_if_it_exists\n # Given\n refute @redis.exists( @key )\n\n # When\n @redis.set @key, @val, xx: true\n\n # Then \n refute @redis.get( @key )\n\n # ...and...\n\n # Given\n @redis.set @key, \"\"\n assert @redis.exists( @key )\n\n # When\n @redis.set @key, @val, xx: true\n\n # Then \n assert_equal @val, @redis.get( @key )\n end", "def testNominalWithSeveralRN\n setupTest do |iTasksFileName, iTicketsFileName|\n $Context[:OS_ExecAnswers] = [\n # svn co => success\n [ 0, '' ],\n # deliver => success, generating files\n [ 0, '', @@Generator_SingleDummyGemWithSeveralRN ]\n ]\n executeProcess(\n [\n '--user', 'ReleaseUser',\n '--branch', 'BranchName',\n '--comment', 'ReleaseComment',\n '--version', '0.0.1.20100317',\n '--tasksfile', iTasksFileName,\n '--ticketsfile', iTicketsFileName,\n '--svnco', 'MySVNRep',\n '--deliver', 'deliver %{DeliverablesDir}'\n ]\n ) do |iError, iSlaveActions|\n checkCallsMatch(\n [\n [ 'query', 'svn co MySVNRep' ],\n [ 'query', /^deliver .*$/ ]\n ],\n $Variables[:OS_Exec]\n )\n assert_equal( @@CommonSlaveActions.merge(\n {\n Tools::FilesManager => {\n Actions::File_Upload => [\n [ WEACE::Master::TransferFile.new(\"#{$Variables[:DeliverableDir]}/Releases/All/Gem/DummyGem.gem\"), 'All', 'Gem', 'BranchName', '0.0.1.20100317', 'ReleaseUser', 'ReleaseComment' ]\n ],\n Actions::File_UploadReleaseNote => [\n [ WEACE::Master::TransferFile.new(\"#{$Variables[:DeliverableDir]}/ReleaseNotes/DummyGemReleaseNote.html\"), 'html', 'BranchName', '0.0.1.20100317', 'ReleaseUser', 'ReleaseComment' ],\n [ WEACE::Master::TransferFile.new(\"#{$Variables[:DeliverableDir]}/ReleaseNotes/DummyGemReleaseNote.txt\"), 'txt', 'BranchName', '0.0.1.20100317', 'ReleaseUser', 'ReleaseComment' ]\n ]\n }\n } ),\n iSlaveActions\n )\n end\n end\n end", "def RunSCRSwitchTest_BinaryExists\n exec_file = Builtins.sformat(\"%1%2\", @chroot_path, @test_binary_exists)\n test_result = FileUtils.Exists(exec_file)\n\n ReportTest(\n # Test progress\n Builtins.sformat(_(\"Checking for binary %1...\"), exec_file),\n test_result\n )\n\n test_result\n end", "def start_robot(args)\n cmd = (RUBY_PLATFORM == 'java') ? \"jruby -S rackup\" : \"rackup\"\n cmd += \" \" + args.join(\" \") if args\n exec(cmd)\nend", "def re_run_test_cmd(test_id)\n \"assert -t #{test_id.gsub(Dir.pwd, \".\")}\"\n end", "def redis\n return @redis if @redis\n self.redis = self.configuration.redis\n self.redis\n end", "def parse_command_line(args)\n test_configuration = {}\n\n option_parser = OptionParser.new do |opts|\n opts.banner = 'Usage: run-tests.rb [options]'\n opts.separator 'Specific options:'\n\n opts.on('--blinkr', 'Execute broken link checks') do |opt|\n test_configuration[:blinkr] = opt\n end\n\n opts.on('--dcp', 'Execute dcp broken link checks') do |opt|\n test_configuration[:dcp] = opt\n end\n\n opts.on('--base-url RHD_BASE_URL', String, 'Run the tests against the specified host e.g http://developers.stage.redhat.com') do |host|\n test_configuration[:base_url] = host\n end\n\n opts.on('-c CONFIG_FILE', 'specify the config.yaml file for broken link checks') do |opt|\n test_configuration[:config] = opt\n end\n\n opts.on('--ignore-internal', \"Ignore internal URL's\") do |opt|\n test_configuration[:ignore_internal] = opt\n end\n\n opts.on('--ignore-external', \"Ignore external URL's\") do |opt|\n test_configuration[:ignore_external] = opt\n end\n\n opts.on('--ignore-ssl', 'Disable SSL certificate checking for staging environments') do |opt|\n test_configuration[:ignore_ssl] = opt\n end\n\n #\n # Options supporting the execution of the tests within Docker\n #\n opts.on('--use-docker', 'Run the specified test type using Docker') do\n test_configuration[:docker] = true\n end\n\n opts.on_tail('-h', '--help', 'Show this message') do\n puts opts\n Kernel.exit(1)\n end\n end\n\n begin\n option_parser.parse!(args)\n rescue OptionParser::InvalidOption => e\n puts e\n option_parser.parse(%w(-h))\n end\n bind_test_type_environment_variable(test_configuration)\n build_test_execution_command(test_configuration)\n test_configuration\n end", "def beaker_tests\n ENV['TESTS'] || ENV['TEST'] || 'tests'\nend", "def install_redis(ips)\n print \"==== Begin install redis on follow server(s). \" + ips.join(', ') + \" ====\\n\"\n ips.each { |ip|\n have_redis_32 = `ssh redis@#{ip} \"stat redis-3.2.11\"`\n if have_redis_32 == \"\"\n # install redis\n print \"Install redis-3.2.11 ...\\n\"\n system \"scp ~/redis-3.2.11.tar.gz redis@#{ip}:.\"\n if $?.to_i != 0\n abort \"Copy redis-3.2.11.tar.gz to remote host failed!\"\n end\n\n system \"ssh redis@#{ip} 'tar -zxf redis-3.2.11.tar.gz && cd redis-3.2.11 && make'\"\n if $?.to_i != 0\n abort \"Build redis-3.2.11 failed!\"\n end\n\n print \"Redis install complete!\\n\"\n else\n print \"Redis-3.2.11 already installed!\\n\"\n end\n }\n\n print \"\\n==== All install completed! ====\\n\\n\"\nend", "def test_env\n TestEngine.install_tasks\n ENV['RAILS_VERSION'] = older_installed_rails\n Rake::Task['test:engine:env'].invoke\n # In case Bundler wants to force a Rails version on us\n ENV['RUBYOPT'] = ENV['RUBYOPT'].sub '-rbundler/setup', '' if ENV.has_key? 'RUBYOPT'\n assert_equal older_installed_rails, `ruby -e \"puts Rails.version\"`.chomp\n end", "def RunSCRSwitchTest_ChrootBinary\n test_result = FileUtils.Exists(@test_chroot_binary)\n\n ReportTest(\n # Test progress\n Builtins.sformat(_(\"Checking for %1 binary...\"), @test_chroot_binary),\n test_result\n )\n\n test_result\n end", "def execute_installation\n #start logging\n set_log_file @options[:log]\n \n download_and_decompress(@options[:prefix], [REDIS_URL, SQLITE3_URL, NGINX_URL])\n \n install_redis if @options[:redis]\n install_sqlite\n configure_nginx @options\n\n install_all_gems\n install_rhoconnect\n \n #remove downloaded tarballs\n cleanup options[:prefix]\n end", "def build_test_execution_command(test_configuration)\n test_configuration[:blinkr] ?\n test_configuration[:run_tests_command] = build_blc_test_execution_cmd(test_configuration) :\n test_configuration[:run_tests_command] = build_dcp_test_execution_cmd(test_configuration)\n end", "def run_tests(workspace, scheme, destination)\n return system(\"xcodebuild -workspace #{workspace} -scheme '#{scheme}' -destination '#{destination}' test\")\nend", "def start_testacular(config, misc_options)\n sh \"testacular start \" +\n \"#{config} \" +\n \"#{(misc_options || '').gsub('+', ',')}\"\nend", "def cli(commandline_arguments)\n CLITest.new(BINARY).run(commandline_arguments)\n end", "def testSlaveProductWithoutProduct\n executeInstall(['--install', 'SlaveProduct', '--as', 'RegProduct'],\n :Repository => 'Dummy/SlaveClientInstalled',\n :AddRegressionSlaveAdapters => true,\n :Error => WEACEInstall::CommandLineError\n ) do |iError|\n assert_equal(nil, $Variables[:ComponentInstall])\n end\n end", "def redis=(server)\n case server\n when String\n host, port, db = server.split(':')\n redis = Redis.new(:host => host, :port => port,\n :thread_safe => true, :db => db)\n @redis = Redis::Namespace.new(:flamingo, :redis => redis)\n when Redis, Redis::Client, Redis::DistRedis\n @redis = Redis::Namespace.new(:flamingo, :redis => server)\n when Redis::Namespace\n @redis = server\n else\n raise \"Invalid redis configuration: #{server.inspect}\"\n end\n Resque.redis = @redis\n end", "def phpunit_command(path, options, logfile)\n super(path, options) do |cmd_parts|\n cmd_parts << \"--log-json #{logfile}\"\n end\n end" ]
[ "0.7124926", "0.62832147", "0.60922754", "0.6001948", "0.58239615", "0.5817418", "0.5758948", "0.56483585", "0.563411", "0.5596748", "0.5572657", "0.5553455", "0.5538716", "0.5485873", "0.5479294", "0.5463666", "0.5406739", "0.5375936", "0.5252816", "0.5234911", "0.5176746", "0.5163817", "0.5151863", "0.5121419", "0.5119283", "0.50649583", "0.5049653", "0.5039558", "0.50374585", "0.50307983", "0.5023515", "0.50186193", "0.50185764", "0.5013623", "0.50088406", "0.49952897", "0.496908", "0.49646235", "0.49646235", "0.4959982", "0.49562308", "0.4948295", "0.49411556", "0.49261227", "0.49261227", "0.49172613", "0.4882358", "0.48759598", "0.48727497", "0.48693407", "0.4857713", "0.48559758", "0.48439547", "0.48408985", "0.4839732", "0.48297536", "0.48245615", "0.48226798", "0.48196945", "0.48172304", "0.4814039", "0.4810395", "0.48040682", "0.48040682", "0.48008108", "0.4797569", "0.47963762", "0.47950566", "0.4783124", "0.47802943", "0.4778981", "0.47777942", "0.4769957", "0.47687554", "0.47594085", "0.4750413", "0.47416976", "0.4741188", "0.47401395", "0.47401357", "0.4734787", "0.4728287", "0.47251785", "0.47190386", "0.4716424", "0.47152835", "0.4712069", "0.47118235", "0.47109878", "0.4708898", "0.47083932", "0.47053647", "0.47030187", "0.46980175", "0.46932197", "0.46848777", "0.46800205", "0.46671483", "0.46625638", "0.46602407" ]
0.48635748
50
Renders the search results partial within +app/views/alchemy/search/_results.html+
def render_search_results(options={}) default_options = { :show_result_count => true, :show_heading => true } render 'alchemy/search/results', :options => default_options.merge(options) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render_search_results(options = {})\n default_options = {\n show_result_count: true,\n show_heading: true,\n }\n render \"alchemy/search/results\", options: default_options.merge(options)\n end", "def results\n get_results(true)\n render :partial => (params[:result_partial] || 'results')\n end", "def search\n engine = BentoSearch.get_engine(params[:engine_id])\n # put it in an iVar mainly for testing purposes.\n @engine = engine\n\n\n unless engine.configuration.allow_routable_results == true\n raise AccessDenied.new(\"engine needs to be registered with :allow_routable_results => true\")\n end\n\n @results = engine.search safe_search_args(engine, params)\n # template name of a partial with 'yield' to use to wrap the results\n @partial_wrapper = @results.display_configuration.lookup!(\"ajax.wrapper_template\")\n\n # partial HTML results\n render \"bento_search/search/search\", :layout => false\n\n end", "def search\n index\n render :index\n end", "def render_search(query)\n @searchresults = []\n blocks = @blocks\n constants = @constants\n blocks['NoSearchResults'] = (@searchresults.length == 0)\n blocks['SearchResults'] = !blocks['NoSearchResults'] # Is this a supported tag?\n blocks['SearchPage'] = true\n constants['SearchQuery'] = query\n constants['URLSafeSearchQuery'] = CGI.escape(query)\n constants['SearchResultCount'] = @searchresults.length\n\n parse(@theme,blocks,constants)\n end", "def results\n respond_to do |format|\n format.html do\n content = get_content('opportunities/results.yml')\n results = Search.new(params, limit: 500).run\n @subscription = SubscriptionForm.new(results).data\n @page = PagePresenter.new(content)\n @results = OpportunitySearchResultsPresenter.new(content, results)\n render layout: 'results'\n end\n format.any(:atom, :xml) do\n results = Search.new(params, limit: 500,\n results_only: true,\n sort: 'updated_at').run\n @query = AtomOpportunityQueryDecorator.new(results, view_context)\n render :index, formats: :atom\n end\n end\n end", "def search\n @page_title = t('titles.search_results')\n @query = params[:query]\n query = @query.to_s.gsub(/[\\/\\\\]/, \" \")\n ferret_results = ThinkingSphinx.search(\n Riddle.escape(query),\n page: params[:page],\n per_page: 10\n )\n # Probably not the best way to do this, strip out Products from the\n # search results unless the status is set to 'show_on_website'. It\n # would be better to filter these out during the ActsAsFerret.find\n # above, but since this is a multi-model search, there doesn't seem\n # to be a way to do SQL filtering on just one of the models being\n # searched.\n @results = []\n ferret_results.each do |r|\n unless (r.is_a?(Product) && !r.show_on_website?(website)) ||\n (r.has_attribute?(:brand_id) && r.brand_id != website.brand_id) ||\n (r.respond_to?(:belongs_to_this_brand?) && !r.belongs_to_this_brand?(website)) ||\n (r.is_a?(Artist) && !r.belongs_to_this_brand?(website))\n @results << r\n end\n end\n render_template\n end", "def search\n\n if params[:query].present?\n\n @result = search_book(params[:query])\n\n\n render :partial => 'searchresult' , :layout => false #,:content_type => :json\n\n end\n\n end", "def search\n render: =>'search'\nend", "def searchResults\n render :layout => false\n end", "def search\n @term = sname = request.query_parameters[\"search\"].to_s.downcase\n @data = search_term(sname)\n render partial: \"shared/search\"\n end", "def search_results\n @page_title = 'Source Search Results'\n pars = params.permit(:name, types: [])\n type_arr = pars[:types] ? pars[:types].map(&:to_sym) : nil\n results = Source.search(pars[:name], type_arr)\n .records\n .order(stories_count: :desc, name: :asc)\n # @results = @results.paginate(page: params[:page])\n # render 'search/results'\n result_display(results)\n end", "def search\n list_results = Search.execute(PikiziLib.clean_string(params[:search_text]))\n render :update do |page| \n page.replace_html(\"current_wish_list\",render(:partial => \"/wishlists/search_results\", \n :locals => {:list_results => list_results}))\n end\n end", "def render_for_search_results(home_search)\n if !home_search \n @renderer = \"WillPaginate::LinkRenderer\"\n render :file => \"games/index.html\", :layout => \"application\"\n else \n @renderer = \"PaginationListLinkRenderer\"\n render :partial => \"games/paginated_game_results\" \n end\n end", "def full_search_table_render(form_input_hash)\n\tprep_html(response_obj(prep_query(form_input_hash)))\nend", "def item_results\n set_item_results_ivars\n render partial: \"items/listing\"\n end", "def index\n if is_legacy_search?()\n Rails.logger.warn(\"Redirected legacy search for #{request.url}\")\n redirect_to \"#{search_url()}?q=#{params[\"querytext\"]}\"\n else\n @presenter = execute_search()\n @presenter.user = current_user\n if @presenter.num_found == 0\n Rails.logger.warn(\"No results were found. Search: #{@presenter.search_qs}\")\n end\n if params[\"format\"] == \"json\"\n render :json => @presenter.results.to_json\n return\n end\n\n if ENV[\"NOTICE_BANNER\"]\n flash[:notice] = ENV[\"NOTICE_BANNER\"]\n end\n\n render \"results\"\n end\n rescue => ex\n backtrace = ex.backtrace.join(\"\\r\\n\")\n Rails.logger.error(\"Could not render search. Exception: #{ex} \\r\\n #{backtrace}\")\n render \"error\", status: 500\n end", "def show\n @search_results = SearchResult.where(search_id: @search.search_id)\n end", "def search\n markup = render_to_string :partial => \"search_lightbox\", :layout => false\n render :json => { :code => 200, :klass => 'success', :markup => markup }.to_json and return\n end", "def results_view\n 'capital_project_search_results_table'\n end", "def find_rebins\n render :inline => %{\n\t\t<% @content_header_caption = \"'find rebins'\"%> \n\n\t\t<%= build_rebin_search_form()%>\n\n\t\t}, :layout => 'content'\n end", "def results_view\n end", "def results\n respond_to do |format|\n if params[:search].present?\n @search = CompatibilitySearchForm.new(search_params)\n @search.user = current_user\n if @search.save\n @compatibility_search = @search.compatibility_search\n format.html\n format.js\n else\n format.html\n format.js\n end\n else\n format.html { redirect_to find_index_path }\n end\n end\n end", "def render(context)\n\n search_results = fetch_search_results(context)\n\n result = []\n context.stack do\n search_results.each do |search_result|\n\n search_result.each do |key, value|\n context[key] = value\n end\n result << render_all(@search_block, context)\n\n end\n end\n\n result\n\n end", "def search\n @q = params[:q]\n @results = Series.external_search(@q)\n\n respond_to do |format|\n format.html # search.html.haml\n format.json { render json: @results.to_json }\n end\n end", "def render_results_collection_tools(wrapping_class: \"search-widgets\", component: Blacklight::Document::ActionsComponent)\n actions = filter_partials(blacklight_config.view_config(document_index_view_type).collection_actions, {}).map { |_k, v| v }\n\n render(component.new(actions: actions, classes: wrapping_class))\n end", "def search\n unless params[:query].blank?\n @listings = custom_search(params[:query])\n #print \"\\n\\n\\n***203 #{@listings}***\\n\\n\\n\"\n @header_type = \"Search for \\\"\" + params[:query] + \"\\\"\"\n \n #will render search.rhtml by default\n else\n browse\n end\n end", "def noSearchResults\n render :layout => false\n end", "def display_search_results(objects)\n objects.limit(results_limit).reduce(String.new) do |string, object|\n string << (tag.tr display_search_results_row(object))\n end\n end", "def find_pallets\n render :inline => %{\n\t\t<% @content_header_caption = \"'find pallets'\"%> \n\n\t\t<%= build_pallet_search_form()%>\n\n\t\t}, :layout => 'content'\n \n end", "def render_search_bar\n render :partial=>'catalog/search_form'\n end", "def search_results\n @term = sname = request.query_parameters[\"search\"].to_s.downcase\n data = search_term(sname)\n @top = []\n @rest = []\n data[:results].each do |type|\n type[:matches].each do |hit|\n if hit[:score] >= 1.0\n @top << hit\n else\n @rest << hit\n end\n end\n end\n @top.sort! { |a, b| b[:score] <=> a[:score] }\n @rest.sort! { |a, b| b[:score] <=> a[:score] }\n render \"site/results\"\n end", "def search_block\n content_tag :div, :id => 'record-search' do\n form_tag records_path, { :method => 'get', :id => 'search' } do\n [\n label_tag(:q, 'Search'),\n search_field_tag('q', nil, :placeholder => 'Search for records'),\n submit_tag('Search', :id => 'submit')\n ].reduce :+\n end # form\n end # div\n end", "def search_results\n search_name = params[\"customer\"]\n @customers = Customer.where(florist_id: session[\"found_florist_id\"]).where(\"name ilike ?\",\"%#{params[\"customer\"]}%\") \n render(:search_results) and return\n end", "def index\n\t\t# Creation of the search object and search do\n if params[:filter]\n params[:by] = \"#{params[:filter][:field]}-#{params[:filter][:way]}\"\n params[:per_page] = \"#{params[:filter][:limit]}\".to_i\n end\n\t\t@search = Search.new(setting_searching_params(:from_params => params))#.advance_search_fields\n\t\t@paginated_objects = @current_objects = @search.do_search\n\t\t# Definition of the template to use to retrieve information\n\t\tif @search.category == 'user' || @search.category == 'workspace'\n\t\t\t@templatee = \"#{@search.category.pluralize}/index\"\n\t\telse\n \t@templatee = \"generic_for_items/index\"\n\t\tend\n\t\t@ajax_url = request.path\n\t\t# Management of the response depending of the request type\n\t\tif !request.xhr?\n\t\t\trespond_to do |format|\n\t \t\t\tformat.html { render :template => \"admin/searches/index.html.erb\" }\n\t\t\t\tformat.xml { render :xml => @paginated_objects }\n\t\t\t\tformat.json { render :json => @paginated_objects }\n\t\t\t\tformat.atom { render :template => \"#{@templatee}.atom.builder\", :layout => false }\n\t\t\tend\n\t\telse\n @no_div = true\n\t\t\trender :partial => @templatee, :layout => false\n\t\tend\n end", "def search_results_ref_num \n query = params[:query].strip if params[:query]\n if query and request.xhr?\n @questions = Admin::Questionbank.find(:all,:order=>'created_at DESC', :conditions => [\"internal_ref_number LIKE ?\", \"%#{query}%\"]) \n render :partial => \"search_results_all\", :layout => false, :locals => {:searchresults => @questions} \n end\n end", "def search\n find_clients\n render_clients\n end", "def supersearch\n @recipes = Recipe.search(params[:ingredient]) \n render :index\n end", "def result_partial\n if params[:q_ds].nil?\n obj = @project\n proj = obj\n unless params[:r_ds].nil?\n obj = obj.miga.dataset(params[:r_ds])\n obj_miga = obj\n end\n else\n obj = QueryDataset.find(params[:q_ds])\n end\n obj_miga ||= obj.miga\n res = obj_miga.result(params[:result])\n render partial: 'shared/result',\n locals: { res: res, key: params[:result].to_sym, obj: obj, proj: proj },\n layout: false\n #rescue\n # head :ok, content_type: 'text/html'\n end", "def index\n @response = search_service.search_results\n\n respond_to do |format|\n format.html { store_preferred_view }\n format.rss { render layout: false }\n format.atom { render layout: false }\n format.json do\n @presenter = Blacklight::JsonPresenter.new(@response,\n blacklight_config)\n end\n additional_response_formats(format)\n document_export_formats(format)\n end\n end", "def search\n # if !user_signed_in?\n # render body: \"<div><h1>Please log in/sign up</h1></div>\"\n # return\n # end\n\n results = create_serach_result(Note.all)\n notes_array = process_notes_array(results)\n\n if results.empty?\n render :body => ['nothing in here']\n else\n render file: 'app/views/notes/search.html.erb', layout: false, locals: {:notes => notes_array}\n end\n end", "def show\n @permitted_params = params.permit(Search::RESULTS_PARAMS +\n Search::SIMPLE_SEARCH_PARAMS)\n @start = [@permitted_params[:start].to_i.abs, MAX_START].min\n @window = window_size\n q = \"%#{@permitted_params[:q]&.downcase}%\"\n @terms = @vocabulary.vocabulary_terms.\n where(\"LOWER(displayed_value) LIKE ? OR LOWER(stored_value) LIKE ?\", q, q).\n order(:displayed_value)\n @count = @terms.count\n @terms = @terms.limit(@window).offset(@start)\n @current_page = ((@start / @window.to_f).ceil + 1 if @window > 0) || 1\n\n if request.xhr?\n render partial: \"terms\"\n else\n render \"show\"\n end\n end", "def init_results_for_search\n # try to find asqs and tags that match search string\n search_string = params[:search].downcase\n @title = \"Search for \\\"#{params[:search]}\\\"\"\n @matched_names = search_asqs_by_column('name', search_string)\n @matched_queries = search_asqs_by_column('query', search_string)\n @matched_tags = Asq.tagged_with(search_string.split(' '), wild: true)\n @matched_creator = Asq.where(created_by: search_string)\n @matched_modifier = Asq.where(modified_by: search_string)\n sort_matched_arrays\n redirect_if_single_result\n end", "def index\n @search = Sunspot.search Generator do\n fulltext params[:query_generator]\n end\n @generators = @search.results\n respond_to do |format|\n format.html\n format.json {render :json => @generators.map(&:attributes) }\n end\nend", "def results_view\n 'general_ledger_account_search_results_table'\n end", "def results\n respond_to do |format|\n if params[:search].present?\n @search = CheckSearchForm.new(search_params)\n @search.user = current_user\n if @search.save\n @check_search = @search.check_search\n format.html\n format.js\n else\n format.html\n format.js\n end\n else\n format.html { redirect_to check_index_path }\n end\n end\n end", "def search\n # Rails automatically renders the corresponding \"search\" view.\n render :layout => false\n end", "def render(views, filter_results)\n @content\n end", "def index\n if can?(:read, Part)\n @parts = Part.ransack(params[:q])\n @searched = false\n @search_results = []\n if params[:q]\n @search_results = @parts.result(:distinct => true)\n @searched = true\n end\n render_template\n else\n redirect_to root_path\n end\n end", "def ar_search_results tags= {}\n if !@query || @query.empty? \n result= controller.ardata.labels[:ask_for_search_terms]\n elsif @search_results && @search_results.total_hits > 0\n\n result= sprintf(controller.ardata.labels[:search_results_summary], \n @search_results.total_hits, @query)\n \n items= @search_results.inject([]) do |elems_array, elem|\n elems_array << content_tag(tags[:item] || :li, ar_transform_search_result(elem))\n end\n\n result= \"#{result}\\n#{content_tag(tags[:items] || :ul, items.join(\"\\n\"))}\"\n else\n result= sprintf(controller.ardata.labels[:search_results_summary], 0, @query)\n end\n \n content_tag(tags[:enclose] || :p, result)\n end", "def result\n case params[:search_type]\n when \"purchaseorders\"\n @class = PurchaseOrder\n @name = \"Purchase Orders\"\n when \"keys\"\n @class = Key\n @name = \"Key Codes\"\n when \"endusers\"\n @class = EndUser\n @name = \"End Users\"\n when \"purchasers\"\n @class = Purchaser\n @name = \"Purchasers\"\n end\n \n @css_class = params[:search_type]\n @search = @class.search(params[:q])\n @list = @search.result\n\n respond_to do |format|\n format.js\n end\n end", "def xhr_search\n endpoint = params[:endpoint]\n\n @query = params_q_scrubbed\n\n searcher = search_service.one(endpoint)\n\n respond_to do |format|\n format.html {\n render :json => { endpoint => render_to_string(\n :partial => \"search/xhr_response\",\n :layout => false,\n :locals => { module_display_name: t(\"#{endpoint}_search.display_name\"),\n searcher: searcher,\n search: '',\n service_name: endpoint\n })}\n }\n\n format.json {\n\n # prevents openstruct object from results being nested inside tables\n # See: http://stackoverflow.com/questions/7835047/collecting-hashes-into-openstruct-creates-table-entry\n result_list = []\n searcher.results.each do |result|\n result_list << result.to_h\n end\n\n render :json => { :endpoint => endpoint,\n :total => searcher.total,\n :results => result_list\n }\n }\n end\n end", "def image_gallery_search_results\n @name = params[\"search_field\"]\n search = @name.split(\"_\")\n @products = Product.where(florist_id: session[\"found_florist_id\"]).where(\"product_type not like '4. Labor'\").where(status: \"Active\").where(\"name ilike ?\", \"%#{search[0]}%\").where(\"name ilike ?\", \"%#{search[1]}%\").where(\"name ilike ?\", \"%#{search[2]}%\").order(\"status\", \"product_type\", \"name\").paginate(:page => params[:page], :per_page => 25)\n render(:image_gallery_search_results, layout:false) and return\n end", "def index\n # (@response, @document_list) = search_results(params)\n set_cached_latest\n\n respond_to do |format|\n format.html { store_preferred_view }\n format.rss { render layout: false }\n format.atom { render layout: false }\n format.js\n format.json do\n render json: render_search_results_as_json\n # @presenter = Blacklight::JsonPresenter.new(@response,\n # @document_list,\n # facets_from_request,\n # blacklight_config)\n end\n # additional_response_formats(format)\n # document_export_formats(format)\n end\n end", "def result \n # Get appropriate search types\n case params[:search_type]\n when \"purchase_order_search\"\n @class = PurchaseOrder\n @css_class = \"purchaseorders\"\n @name = \"Purchase Orders\"\n when \"keycodes_search\"\n @class = Key\n @css_class = \"keycodes\"\n @name = \"Key Codes\"\n when \"end_user_search\"\n @class = EndUser\n @css_class = \"endusers\"\n @name = \"End Users\"\n when \"purchaser_search\"\n @class = Purchaser\n @css_class = \"purchasers\"\n @name = \"Purchaser\"\n when \"assignment_search\"\n @class = Relationship\n @css_class = \"assignments\"\n @name = \"Assignments\"\n end\n \n # Execute search and sort results based on selected model\n @search = @class.search(params[:q])\n @list = @search.result\n @search.build_condition if @search.conditions.empty?\n @search.build_sort if @search.sorts.empty?\n end", "def search\n @search_term = params[:term]\n\n if !@search_term then\n @search_term = session[:last_search_term]\n end\n # Save this for after editing\n session[:last_view] = 'search'\n session[:last_search_term] = @search_term\n\n # Need this so that links show up\n @list_options = @@list_options\n @title = \"Search Results For '#{@search_term}'\"\n\n @search_count = Order.search(@search_term, true, nil)\n @order_pages = Paginator.new(self, @search_count, 30, params[:page])\n # to_sql is an array\n # it seems to return the limits in reverse order for mysql's liking\n the_sql = @order_pages.current.to_sql.reverse.join(',')\n @orders = Order.search(@search_term, false, the_sql)\n\n render :action => 'list'\n end", "def index\n # @search = Shelter.search do\n # fulltext params[:search]\n # end\n # @shelters = @search.results\n @shelters = Shelter.all\nend", "def search \n filters = params[:filters] ||= {}\n thumb_image_url = nil\n \n results = {}\n results['newly_crafted'] = {}\n results['antiques'] = {}\n \n newly_crafted = Material.filter_search_results(filters,'newly_crafted')\n antique_in_title = Material.filter_search_results(filters,'antique_in_title')\n # newly_crafted = Material.newly_crafted(filters)\n # antique_in_title = Material.antique_in_title_results(filters)\n\n use_special_result_images = special_result_images(filters)\n \n results['newly_crafted']['count'] = newly_crafted.count\n results['newly_crafted']['html'] = render_to_string( \n partial: 'materials/search/newly_crafted/header', \n locals: { results: results}\n ) \n \n results['antiques']['count'] = antique_in_title.count\n results['antiques']['html'] = render_to_string( \n partial: 'materials/search/antiques/header', \n locals: { results: results}\n ) \n\n\n # render newly crafted results\n if results['newly_crafted']['count'] > 0 \n newly_crafted.each do |mat| \n \n thumb_image_url = self.get_thumb_image_url(mat,filters,use_special_result_images)\n \n results['newly_crafted']['html'] += render_to_string(\n partial: 'materials/search/newly_crafted/item', \n locals: { mat: mat, thumb_image_url: thumb_image_url })\n end \n end\n \n # render antiques results\n if results['antiques']['count'] > 0 \n antique_in_title.each do |mat| \n\n thumb_image_url = self.get_thumb_image_url(mat,filters,use_special_result_images) \n \n results['antiques']['html'] += render_to_string(\n partial: 'materials/search/antiques/item', \n locals: { mat: mat, thumb_image_url: thumb_image_url })\n end \n end \n \n respond_to do |format| \n format.json { render json: { type: 'ok', status: :success, results: results }}\n end \n end", "def search_by_tags \n query = params[:query].strip if params[:query]\n if query and request.xhr?\n @questions = Admin::Questionbank.find(:all,:order=>'created_at DESC', :conditions => [\"tags LIKE ?\", \"%#{query}%\"]) \n render :partial => \"search_results_all\", :layout => false, :locals => {:searchresults => @questions} \n end\n end", "def search\n @query = params[:keywords].nil? ? \"\" : params[:keywords]\n\n # prepare filters\n filters = apply_filters\n\n # do the search itself\n ultrasphinx_search(filters)\n params[:filter] = false;\n\n respond_to do |format|\n format.html { render :partial => 'dt/projects/search_results', :layout => 'layouts/dt_application'}\n end\n end", "def search_results\n @query = params[:user]\n processed_query = sanitize(@query)\n @source = params[:source]\n @results = ApiHelper.user_search(processed_query, USER_COUNT, @source)\n if @results.count == 0\n flash[:notice] = \"No users matching '#{@query}'.\"\n end\n render 'search'\n end", "def index\n @searches = Sunspot.search(Drug, Review, Condition) do\n fulltext params[:search]\n end\n @[email protected]\n @drugresults=Array.new\n @conditionresults=Array.new\n @reviewresults=Array.new\n @results.each do |result|\n if result.instance_of?Drug\n @drugresults.push(result)\n elsif result.instance_of?Condition\n @conditionresults.push(result)\n else\n @reviewresults.push(result)\n end\n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @searches }\n end\n end", "def render_search_results_as_json\n @presenter = Blacklight::JsonPresenter.new(@response, blacklight_config)\n { response: { docs: @document_list, facets: @presenter.search_facets, pages: @presenter.pagination_info } }\n end", "def index\n respond_to do |format|\n format.html { # index.html.erb\n @researchers = Researcher.search(params[:search_name], params[:page])\n }\n format.xml { \n @researchers = Researcher.all\n render :xml => @researchers \n }\n format.json { \n @researchers = Researcher.all\n render :json => @researchers \n }\n end\n end", "def search_results\n # Sunspot search\n @search = Program.search do\n fulltext params[:search] if params[:search].present?\n facet(:program_subjects)\n with(:program_subjects, params[:subject]) if params[:subject].present?\n end\n @programs = @search.results\n end", "def complete_search\n if is_boolean? && !!@search_value != @search_value\n puts 'No result found'\n return\n end\n if NUMBER_TO_OBJECT_MAP[@object].column_names.include?(@search_term)\n results = NUMBER_TO_OBJECT_MAP[@object].where(\"#{@search_term}\" => @search_value)\n else\n results = NUMBER_TO_OBJECT_MAP[@object].joins(@search_term.to_sym).where(\"#{@search_term}\" => { value: @search_value })\n end\n \n if !results.empty?\n puts 'Result'\n puts '-------------'\n results.each do |result|\n result.render_object\n end\n else\n puts 'No result found'\n end\n results\n end", "def index\n get_results\n end", "def live_search\n @phrase = params[:searchtext]\n @searchphrase = \"%\" + @phrase + \"%\"\n @players = Player.find(:all,\n :conditions => [ \"picks.id IS NULL AND players.player LIKE ?\", @searchphrase],\n :include => [:pick],\n :joins => 'LEFT JOIN picks ON players.id=picks.player_id')\n render :partial => \"search\"\n end", "def index\n @search = search_hash\n respond_to do |format|\n format.html { render :index }\n format.rss { render :layout => false }\n format.json { render :layout => false }\n end\n end", "def index\n @page_title = I18n.t('data_search.page_title')\n prepare_search_parameters(params)\n prepare_attribute_options\n prepare_suggested_searches\n respond_to do |format|\n format.html do\n @traits = SearchTraits.new(@search_options)\n end\n end\n end", "def search\n params[:search] ||= {}\n @document = Document.public.find_by_path(params[:path].join('/'))\n params[:search].merge!(:parent_id => @document.id)\n params[:search][:state_eq] = 'published'\n @documents = Document.search(params[:search]).paginate :page => params[:page], :per_page => Settings.documents.per_page\n setup_view_environment\n render :template => view_for(:suffix => '_search')\n end", "def google_feed_search(query, content_id = 'feed_search_content')\n render :partial => 'google/feed_search', :locals => { :query => query, :content_id => content_id }\n end", "def searchPubmed \n @params = params.pretty_inspect\n @resultsPerPage = params[:resultsPerPage] \n @resultsPerPage = @resultsPerPage.to_i == 0 ? 20 : @resultsPerPage\n @currentPage = params[:page]\n if (request.xhr?)\n initiateSearch\n end\n respond_to do |result| \n result.html do\n @theTerm = params[:term]\n @triggerAjax = true\n render(:template => \"pubmed/index\")\n end\n result.js do \n result.js \n end\n result.json do\n initiateSearch\n results = @pubLib.map {|result| json_for_results(result) }\n render :json => { :content => results }\n end\n #result.js\n end\n end", "def home\n prepare_for_search\n render :template =>\"bodysize/home\"\n end", "def handle_search\n if request.id == 'csv'\n csv(:search_results)\n elsif request.id\n table_page(*model.search_results(normalized_type, request))\n else\n page do\n Forme.form(model.new(nil, request), form_attributes(:action=>url_for(\"search/1\"), :method=>:get), form_opts) do |f|\n model.columns_for(:search_form, request).each do |column|\n col_opts = column_options_for(:search_form, request, f.obj, column).merge(:name=>column, :id=>column)\n if html = model.edit_html_for(f.obj, column, :search_form, request)\n col_opts[:html] = html\n end\n f.input(column, col_opts)\n end\n f.button(:value=>'Search', :class=>'btn btn-primary')\n end\n end\n end\n end", "def search_results\n @results = User.search(params[:search])\n end", "def search\n search = Wine.search do\n fulltext params[:search]\n paginate(:page => params[:page], :per_page => params[:per_page])\n end\n\n # Assign our search results to the wines to display, and render it the same as our index.\n @wines = search.results\n @wines.index\n render 'index'\n end", "def divisions_users_search\n render 'activities/divisions/division_users_search'\n end", "def index\n search = params[:search].present? ? params[:search] : nil\n\n @artists = if search\n\n # Render search results\n\n Artist.search(params[:search], page: params[:page], per_page: 20)\n\n else\n\n # Render blog articles\n\n Artist.all.order(created_at: :desc).page(params[:page])\n\n end\n end", "def search\n sort_init 'name'\n sort_update\n \n @search_term = params[:term]\n\n if !@search_term then\n @search_term = session[:last_search_term]\n end\n # Save this for after editing\n session[:last_search_term] = @search_term\n\n # Need this so that links show up\n @title = \"Search Results For '#{@search_term}'\"\n @tags = Tag.find_alpha\n @search_count = Product.search(@search_term, true, nil)\n @product_pages = Paginator.new(self, @search_count, 30, params[:page])\n # to_sql is an array\n # it seems to return the limits in reverse order for mysql's liking\n the_sql = @product_pages.current.to_sql.reverse.join(',')\n products = Product.search(@search_term, false, the_sql)\n product_ids = products.map(&:id)\n begin\n @product_pages, @products = paginate :product, :conditions => [\"id IN (?)\",product_ids], :order_by => sort_clause, :per_page => 10\n rescue\n @products = []\n end\n render :action => 'list'\n end", "def results\n if current_user.admin?\n @students = Student.all.search(params[:search])\n else\n @students = current_user.students.search(params[:search]) \n end\n \n respond_to do |format|\n format.html\n format.js\n end\n end", "def index\n pp 'render index'\n search_and_sort\n end", "def load_more_search_result\n @users=[]\n @users = @login_user.search_query(session[:search_opt],params[:page].to_i)\n render :partial => \"search_user_result\"\n #render :text => \"yes\"\n end", "def search\n\t @search_term = params[:term]\n\n\t if !@search_term then\n\t @search_term = session[:last_search_term]\n\t end\n\t # Save this for after editing\n\t session[:last_search_term] = @search_term\n\n\t # Need this so that links show up\n\t @title = \"Search Results For '#{@search_term}'\"\n\n\t @search_count = Product.search(@search_term, true, nil)\n\t @product_pages = Paginator.new(self, @search_count, 30, params[:page])\n\t # to_sql is an array\n\t # it seems to return the limits in reverse order for mysql's liking\n\t the_sql = @product_pages.current.to_sql.reverse.join(',')\n\t @products = Product.search(@search_term, false, the_sql)\n\n\t render :action => 'list'\n\tend", "def search\n @hits = []\n\n if params[:query]\n search = DesignMethod.solr_search do\n fulltext params[:query] do\n highlight\n minimum_match 0\n end\n end\n store_location\n @hits = search.hits\n @results = search.results\n end\n\n respond_to do |format|\n format.html\n format.json { render json: @results }\n end\n end", "def find_cartons\n \n render :inline => %{\n\t\t<% @content_header_caption = \"'find cartons'\"%> \n\n\t\t<%= build_carton_search_form()%>\n\n\t\t}, :layout => 'content'\n \n end", "def display_search_results_row(object)\n user_column_fields.reduce(String.new) do |string, field|\n string << (tag.td object.send(field))\n end\n .html_safe +\n display_user_posts(object.posts)\n end", "def show\n @search = Search.find(params[:id])\n @search_run = SearchRun.new\n\n\t\t# if params[:search_result]\n\n # search_terms =\n # if params[:search_result][:use_description_terms] == '1'\n # @search.description.split(' ')\n # else\n # []\n # end\n\n # search_results = @search.scan(params[:search_result][:selector], search_terms)\n\n # search_run = SearchRun.new(search_url: @website.search_url, selector: params[:search_result][:selector])\n # @search.search_runs << search_run\n\n # search_results.each do |result|\n # url = result[:url]\n\n # url = @website.base_url + result[:url] if result[:url].start_with?('/')\n\n # search_run.search_run_results << SearchRunResult.new(text: result[:text], url: url)\n # end\n\t\t# end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @search }\n end\n end", "def find_contacts\n show_params(params)\n @data = process_search(params[:search], params[:page].to_i)\n render :partial => 'search_results_wrapper'\n end", "def show\n @regions = Region.search(@search.keywords)\n @states = State.search(@search.keywords)\n @areas = Area.search(@search.keywords)\n @territories = Territory.search(@search.keywords)\n @crags = Crag.search(@search.keywords)\n @walls = Wall.search(@search.keywords)\n @sport_routes = SportRoute.search(@search.keywords)\n @traditional_routes = TraditionalRoute.search(@search.keywords)\n @boulder_routes = BoulderRoute.search(@search.keywords)\n @sport_route_photos = SportRoutePhoto.search(@search.keywords)\n @traditional_route_photos = TraditionalRoutePhoto.search(@search.keywords)\n @boulder_route_photos = BoulderRoutePhoto.search(@search.keywords)\n end", "def search_form\n %@<form accept-charset=\"UTF-8\" action=\"#{view_context.search_index_path}\" id=\"search\" method=\"get\">\n <div class='field'><input id=\"q\" name=\"q\" value=\"#{params[:q]}\" type=\"text\" class=\"textbox\" /></div></form>@.html_safe\n end", "def find_bins\n render :inline => %{\n <% @content_header_caption = \"'find bins'\"%> \n\n\t\t <%= build_bin_search_form()%>\n },:layout => 'content'\n end", "def index\n\n extra_head_content << '<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS for results\" href=\"'+ url_for(params.merge(\"format\" => \"rss\")) + '\">'\n extra_head_content << '<link rel=\"alternate\" type=\"application/atom+xml\" title=\"Atom for results\" href=\"'+ url_for(params.merge(\"format\" => \"atom\")) + '\">'\n\n (@response, @document_list) = get_search_results\n @filters = params[:f] || []\n\n if Blacklight.config[:data_augmentation][:enabled] and !(params[:q].blank? and params[:f].blank? and params[:search_field].blank?)\n get_gdata_for_result_list\n end\n\n respond_to do |format|\n format.html { save_current_search_params }\n format.mobile { save_current_search_params }\n format.rss { render :layout => false }\n format.atom { render :layout => false }\n end\n end", "def user_search_results\n @limit = 25\n load_facility\n @price_group = PriceGroup.find(params[:price_group_id]) if params[:price_group_id].present?\n @account = Account.find(params[:account_id]) if params[:account_id].present?\n @product = Product.find(params[:product_id]) if params[:product_id].present?\n @search_type = valid_search_types.find { |t| t == params[:search_type] }\n @users, @count = UserFinder.search_with_count(params[:search_term], @limit)\n\n render layout: false\n end", "def search\n @query = params[:q]\n @editions = Book.search(@query)\n respond_to do |format|\n format.html # show.html.haml\n format.xml { render :xml => @editions }\n end\n end", "def index\n @search = MicrornaPatient.search do\n fulltext params[:query_microrna_patient]\n end\n \n @microrna_patients = @search.results\n \n \n respond_to do |format|\n format.html\n format.json { render :json => @microrna_patients.map(&:attributes) }\n end\nend", "def search_results\n pages = Alchemy::PgSearch.config[:page_search_scope].pages\n # Since CanCan cannot (oh the irony) merge +accessible_by+ scope with pg_search scopes,\n # we need to fake a page object here\n if can? :show, Alchemy::Page.new(restricted: true, public_on: Date.current)\n pages.full_text_search(params[:query])\n else\n pages.not_restricted.full_text_search(params[:query])\n end\n end", "def index\n @search = Quirk.accessible_by(current_ability).search(params[:search])\n @quirks = @search.result(:order => 'name', :include=>[:servers])\n if request.xhr?\n render :partial => 'listing'\n else\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @quirks }\n format.json { render :json => @quirks}\n end\n end\n end", "def print_advanced\n @search ||= Search.new()\n\t\trender :partial => 'advanced_search', :locals => { :category => params[:cat] }\n\tend", "def index\n page = params[:page] || 1\n page = page.to_i\n per_page = params[:per_page] || 25\n per_page = per_page.to_i\n @results = {}\n\n search = params[:searchterm]\n if search && search.empty?\n search = nil\n end\n\n if search\n page = 1\n per_page = 50\n @stats = SearchEngine.search(Stat, search)\n total = @stats.count\n @stats = Kaminari.paginate_array(@stats).page(page).per(per_page)\n \n @searchterm = search\n else\n @stats = Stat.desc(:id).page(page).per(per_page)\n total = Stat.count\n end\n \n @results[:first] = (page-1) * per_page + 1\n @results[:last ] = [total, page * per_page].min\n @results[:total] = total\n end" ]
[ "0.8085688", "0.7821141", "0.7396624", "0.73813134", "0.7336223", "0.71947485", "0.7128651", "0.70948905", "0.7067658", "0.7060747", "0.7031068", "0.6999058", "0.699142", "0.6985357", "0.696734", "0.6927623", "0.6917432", "0.6878287", "0.68713117", "0.6855304", "0.6790137", "0.6782339", "0.6777348", "0.6773017", "0.6766667", "0.6755343", "0.67315984", "0.6689827", "0.6648594", "0.664", "0.6623068", "0.6604389", "0.65898037", "0.6564267", "0.6560187", "0.6560057", "0.6555408", "0.6536933", "0.65138", "0.65130997", "0.6508159", "0.64914227", "0.64771473", "0.64700633", "0.6464715", "0.64567375", "0.6451343", "0.6450621", "0.64489895", "0.644466", "0.64437556", "0.642925", "0.6423738", "0.6422589", "0.6420101", "0.6415858", "0.6398869", "0.6398334", "0.63950586", "0.63919044", "0.63831836", "0.63753164", "0.63727677", "0.6370999", "0.63690835", "0.6365223", "0.63570035", "0.6351934", "0.63496596", "0.6349164", "0.63484335", "0.63463867", "0.63416827", "0.6333764", "0.63317865", "0.633095", "0.6329031", "0.63288236", "0.6323712", "0.6318215", "0.6313211", "0.63113225", "0.63097966", "0.6302964", "0.62969786", "0.6293856", "0.6289048", "0.627845", "0.6273655", "0.6267395", "0.6264456", "0.62635463", "0.62612003", "0.6252761", "0.62525487", "0.6247382", "0.62461966", "0.6244349", "0.6234788", "0.62194616" ]
0.8142435
0
These functions are private to the problem one class.
def isMultiple(intMultiplier,input) if (input % intMultiplier)==0 #puts(" multiple of #{intMultiplier}: #{input}") return true else return false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def probers; end", "def suivre; end", "def internal; end", "def schubert; end", "def implementation; end", "def implementation; end", "def problem_8\nend", "def problem_14\nend", "def bug\n end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def intensifier; end", "def anchored; end", "def terpene; end", "def operations; end", "def operations; end", "def private_method\n end", "def silly_adjective; end", "def formation; end", "def celebration; end", "def big_bad; end", "def who_we_are\r\n end", "def problems\n\t\t\treturn nil\n\t\tend", "def internship_passed; end", "def missing; end", "def ibu; end", "def checks; end", "def internal?; end", "def scientist; end", "def miss_reason; end", "def diagnostic; end", "def villian; end", "def gounod; end", "def jack_handey; end", "def required_positionals; end", "def romeo_and_juliet; end", "def hints; end", "def refutal()\n end", "def ignores; end", "def p15\n\t\nend", "def custom; end", "def custom; end", "def zuruecksetzen()\n end", "def hiss; end", "def unsolved_params\n \n end", "def trd; end", "def malts; end", "def feruchemist; end", "def nasa_space_craft; end", "def under_construction\n end", "def missing?; end", "def name\n problem\n end", "def verdi; end", "def solve\n end", "def corrections; end", "def strain; end", "def incomplete\r\n\r\n end", "def dh; end", "def alternatives; end", "def missed?; end", "def restriction \n end", "def king_richard_iii; end", "def invention; end", "def original; end", "def nn\n end", "def solve!\n end", "def methods; end", "def methods; end", "def methods; end", "def methods; end", "def probers=(_arg0); end", "def isp; end", "def isp; end", "def exceptions; end", "def anatomy; end", "def public; end", "def public; end", "def pos; end", "def pos; end", "def pos; end", "def pos; end", "def pos; end", "def pos; end", "def berlioz; end", "def surge; end", "def stderrs; end", "def upc_e; end", "def operation; end", "def isolated; end", "def isolated; end", "def used?; end", "def strategy; end", "def deco_pos; end", "def error; end", "def error; end", "def error; end", "def error; end", "def error; end" ]
[ "0.77340615", "0.66720784", "0.6499635", "0.6469419", "0.6428283", "0.64189804", "0.64189804", "0.6341851", "0.6320635", "0.6303247", "0.62737", "0.62737", "0.62737", "0.62737", "0.62624973", "0.6238918", "0.6151551", "0.614391", "0.614391", "0.6140727", "0.6113295", "0.6021744", "0.6014445", "0.59549075", "0.59542996", "0.59415305", "0.5931576", "0.59250104", "0.5920989", "0.59189206", "0.590701", "0.5888714", "0.5864973", "0.5846387", "0.5843068", "0.5817464", "0.5807714", "0.5800662", "0.5799497", "0.5798357", "0.5797444", "0.57870275", "0.5784081", "0.5776627", "0.5776627", "0.5769773", "0.5768688", "0.57660943", "0.57633924", "0.5759207", "0.5750605", "0.57301366", "0.5721315", "0.5711349", "0.57043576", "0.56915414", "0.568636", "0.5683969", "0.56759876", "0.56745327", "0.5643802", "0.56405795", "0.5640447", "0.56346065", "0.563422", "0.5625599", "0.5612649", "0.56096363", "0.5600397", "0.5597887", "0.5597887", "0.5597887", "0.5597887", "0.55965716", "0.55946255", "0.55946255", "0.55822474", "0.5580437", "0.5579811", "0.5579811", "0.55797845", "0.55797845", "0.55797845", "0.55797845", "0.55797845", "0.55797845", "0.5579038", "0.55775577", "0.5574076", "0.5573336", "0.55718774", "0.5562806", "0.5562806", "0.55605084", "0.5559376", "0.5551252", "0.55502975", "0.55502975", "0.55502975", "0.55502975", "0.55502975" ]
0.0
-1
GET /tasks GET /tasks.json
def index @tasks = @user.tasks.all.includes(:tags) if params[:query] @tasks = @tasks.search(params[:query]) set_complete_incomplete render 'tasks/search' else set_complete_incomplete end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tasks\n uri = URI(BASE_URL + TASKS_ENDPOINT)\n\n make_request(uri)\n end", "def tasks\n @todos = Todo.all\n render json: @todos\n end", "def index\n render json: {\n tasks: tasks.map(&:to_hash)\n }\n end", "def index\n @tasks = Task.all\n\n render json: @tasks\n end", "def get_user_tasks\n render json: get_current_user.tasks\n end", "def index\n # GET /tasks\n @tasks = Task.all\n end", "def tasks\n render json: [{id: 1, name: 'One'}, {id: 2, name: 'Two'}]\n end", "def index\n @tasks = Task.find_all_by_user_id(current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tasks }\n end\n end", "def index\n @tasks = Task.all\n response = @tasks.map{|task| get_task_hash(task)}\n render json: response\n end", "def show\n @task = Task.find(params[:id])\n\n render json: @task\n end", "def index\n @tasks = Task.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tasks }\n end\n end", "def index\n @tasks = Task.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tasks }\n end\n end", "def index\n @tasks = Task.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tasks }\n end\n end", "def index\n @tasks = Task.includes(:user).order(created_at: :desc).all\n render json: @tasks, each_serializer: TasksSerializer\n end", "def show\n render :json => Project.find(params[:project_id]).tasks.find(params[:id])\n end", "def get_task_list(id)\n response = request(\n :expects => 200,\n :idempotent => true,\n :method => 'GET',\n :parser => Fog::ToHashDocument.new,\n :path => \"tasksList/#{id}\"\n )\n ensure_list! response.body, :Task\n response\n end", "def index\n @tasks = Task.all \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tasks }\n end\n end", "def index\n #@tasks = Task.all\n tasks = @task_list.tasks.all\n render :json => tasks\n end", "def show\n render json: @task\n end", "def index \n render :json => Project.find(11).tasks\n end", "def index\n @tasks = current_user.tasks\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @tasks }\n end\n end", "def show\n \n @task = @project.tasks.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @task }\n end\n end", "def index\n\t\t@tasks = @event.tasks.all\n\n\n\n\t\t# @task.find(task_id).user.name\n\t\t# user_id = params[:user_id]\n\t\t# @user = User.find(user_id)\n\t\t# render :index\n\t\trespond_to do |format|\n\t\t\tformat.html { render :index}\n\t\t\tformat.json { render json: @tasks }\n\t\tend\n\tend", "def get_tasks_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: TasksApi#get_tasks ...\"\n end\n \n # resource path\n local_var_path = \"/Tasks\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'brief'] = opts[:'brief'] if opts[:'brief']\n query_params[:'skip'] = opts[:'skip'] if opts[:'skip']\n query_params[:'top'] = opts[:'top'] if opts[:'top']\n query_params[:'count_total'] = opts[:'count_total'] if opts[:'count_total']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<InlineResponse20014>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TasksApi#get_tasks\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @tasks = Task.all\n @root = \"tasks\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tasks }\n end\n end", "def index\n @api_tasks = Api::Task.all\n end", "def index\n authenticate_user!\n @tasks = current_user.tasks\n end", "def get_tasks_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: TasksApi#get_tasks ...\"\n end\n \n # resource path\n path = \"/Tasks\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'brief'] = opts[:'brief'] if opts[:'brief']\n query_params[:'skip'] = opts[:'skip'] if opts[:'skip']\n query_params[:'top'] = opts[:'top'] if opts[:'top']\n query_params[:'count_total'] = opts[:'count_total'] if opts[:'count_total']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<APITask>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TasksApi#get_tasks\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def task(name)\n get \"#{base_url}/tasks/#{name}\"\n end", "def show\n @task = current_user.tasks.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @task }\n end\n end", "def show\n @task = @project.tasks.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { redner json: @task }\n end\n\n end", "def index\n @tasks = @project.tasks.find(:all, :order => 'project_name asc')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { redner json: @tasks }\n end\n\n end", "def tasks\n # find project\n @project = Project.find(params[:id])\n # check user is manager of project\n if (!@superuser_is_superadmin && !(superuser_is_part_of_project? @project))\n flash[:warning] = \"You can't see tasks for this project\"\n redirect_to lato_core.root_path and return false\n end\n # find datas\n @tasks = Task.where(project_id: @project.id).order('end_date ASC')\n @deadline_tasks = @tasks.where('end_date <= ?', Date.today + 1).where.not(status: 'completed')\n @wait_tasks = @tasks.where(status: 'wait')\n @develop_tasks = @tasks.where(status: 'develop')\n @test_tasks = @tasks.where(status: 'test')\n @completed_tasks = @tasks.where(status: 'completed')\n # prepare datas for timeline\n if params[:init_date]\n @init_date = params[:init_date].to_date\n @end_date = @init_date + 6\n # update page without refresh\n respond_to do |format|\n format.js { render action: 'functions/update_timeline'}\n end\n else\n @init_date = Date.yesterday\n @end_date = @init_date + 6\n end\n end", "def tasks\n return self.class.get('/tasks').parsed_response.map do |task|\n Task.new(\n task['task_id'],\n task['template_id'],\n task['status'],\n task['started_at']\n )\n end\n end", "def tasks\n @tasks ||= Harvest::API::Tasks.new(credentials)\n end", "def index\n @tasks = current_user.tasks.active if user_signed_in?\n @task = Task.new\n @this_week = Week.current\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tasks }\n end\n end", "def index\n @project = Project.find(params[:project_id])\n @tasks = @project.tasks.order('id DESC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tasks }\n end\n end", "def index\n @tasks = Task.all\n end", "def index\n @tasks = Task.all\n end", "def index\n @tasks = Task.all\n end", "def index\n @tasks = Task.all\n end", "def index\n @tasks = Task.all\n end", "def index\n @tasks = Task.all\n end", "def index\n @tasks = Task.all\n end", "def index\n @tasks = Task.all\n end", "def index\n @tasks = Task.all\n end", "def index\n @tasks = Task.all\n end", "def index\n @tasks = Task.all\n end", "def index\n @tasks = Task.all\n end", "def index\n @tasks = Task.all\n end", "def index\n @tasks = Task.all\n end", "def index\n @tasks = Task.all\n end", "def index\n @tasks = Task.all\n end", "def index\n @tasks = Task.all\n end", "def index\n @tasks = Task.all\n end", "def index\n @tasks = Task.all\n end", "def index\n @tasks = Task.all\n end", "def index\n @tasks = Task.all\n end", "def index\n @tasks = Task.all\n end", "def tasks_get(opts = {})\n data, _status_code, _headers = tasks_get_with_http_info(opts)\n data\n end", "def tasks_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TasksApi.tasks_get ...'\n end\n # resource path\n local_var_path = '/tasks'\n\n # query parameters\n query_params = {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].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', 'application/xml'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BrainPortalSession']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<CbrainTask>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TasksApi#tasks_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n @task_list = TaskList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @task_list }\n end\n end", "def show\n @task = Task.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @task }\n end\n end", "def show\n @task = Task.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @task }\n end\n end", "def show\n @task = Task.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @task }\n end\n end", "def show\n @task = Task.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @task }\n end\n end", "def show\n @task = Task.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @task }\n end\n end", "def show\n @task = Task.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @task }\n end\n end", "def show\n @task = Task.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @task }\n end\n end", "def show\n @task = Task.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @task }\n end\n end", "def show\n @task = Task.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @task }\n end\n end", "def show\n @task = Task.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @task }\n end\n end", "def show\n @task = Task.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @task }\n end\n end", "def show\n @task = Task.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @task }\n end\n end", "def show\n @task = Task.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @task }\n end\n end", "def show\n @task = Task.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @task }\n end\n end", "def show\n @task = Task.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @task }\n end\n end", "def get_tasks(param_map, *args)\n #Strip off the first element, since it is not a Task\n get(\"tasks\", param_map, Babar::Task, true, *args)\n end", "def tasks(tasklist_id = '@default')\n get gtasks_tasks_url(tasklist_id)\n end", "def get_tasks(opts = {})\n data, status_code, headers = get_tasks_with_http_info(opts)\n return data\n end", "def get_tasks(opts = {})\n data, status_code, headers = get_tasks_with_http_info(opts)\n return data\n end", "def show\n @task = Task[params[:id]]\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @task }\n end\n end", "def get_email_tasks_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: EmailtasksApi.get_email_tasks ...\"\n end\n # resource path\n local_var_path = \"/public-api/email-tasks\"\n\n # query parameters\n query_params = {}\n query_params[:'listId'] = opts[:'list_id'] if !opts[:'list_id'].nil?\n query_params[:'assignee'] = opts[:'assignee'] if !opts[:'assignee'].nil?\n query_params[:'statusId'] = opts[:'status_id'] if !opts[:'status_id'].nil?\n query_params[:'query'] = opts[:'query'] if !opts[:'query'].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 = ['X-API-Key']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<EmailTask>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: EmailtasksApi#get_email_tasks\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @tasks = Task.all \n end", "def tasks(project_id)\n account = Config.details \n c = FreshBooks::Client.new(account[\"account\"], account[\"token\"])\n c.task.list :project_id => project_id\n end", "def index\n\n if params[:project_id].nil?\n results = current_user.tasks\n\n else\n @project = Project.user_readable(current_user).find(params[:project_id])\n results = @project.tasks\n end\n\n @tasks = paginate_results(params[:page], results)\n \n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tasks }\n end\n end", "def get_task\n @task = @current_user.tasks.find(params[:id])\n head 404 and return unless @task\n end", "def index\n @tasks = Task.order_by_company_project_and_task.paginate(page: params[:page] || 1, per_page: helpers.pager_per_page)\n respond_to do |format|\n message = @tasks.present? ? \"\" : \"There are no tasks available at this time\"\n format.json do\n status = @tasks.present? ? :ok : :not_found\n render json: { response: @tasks, status: status, message: message }\n end\n format.html do\n # Only authorize html format, json is okay because we use it as\n # an api.\n authorize(:task)\n flash[:alert] = message unless message.blank?\n @tasks\n end\n end\n end", "def show\n @task = Task.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @task }\n end\n end", "def index\n @tasks = Task.active.order('tasks.position ASC')\n @completed_tasks = Task.completed.order('tasks.completed_at ASC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tasks }\n end\n end", "def read_tasks\n JSON.parse(File.read(\"tasks.json\"))\nend", "def tasks\n user = validate_user( request.headers[\"authentication-token\"] )\n if user.nil?\n respond_to do |format|\n format.html do\n flash[:error] = 'Not authenticated.'\n redirect_to root_url\n end\n\n format.xml { render :xml => { :status => :error, :message => 'Invalid authentication code.'}.to_xml, :status => 403 }\n\n format.json { render :json => { :status => :error, :message => 'Invalid authentication code.'}.to_json, :status => 403 }\n end\n else\n projects = Task.find_all_by_project_id( params[:id] )\n if projects\n respond_to do |format|\n format.html { \n @title = \"Dasher - Your Projects\"\n @projects = Project.find_all_by_owner(@user.id)\n }\n format.xml { render :xml => projects.to_xml( :only => [:project_id, :id, :description] ) }\n format.json { render :json => projects.to_json( :only => [:project_id, :id, :description] ) }\n end\n end\n end\n end", "def index\n respond_to do |format|\n format.html do\n @task = current_user.tasks.new\n end\n format.json do\n page = (params[:page] || 1).to_i\n per_page = 5\n total_pages = (@tasks.count.to_f / per_page).ceil\n total_pages = 1 if total_pages.zero?\n @tasks = @tasks.paginate(page: page, per_page: per_page)\n render json: { tasks: @tasks, page: page, totalPages: total_pages }\n end\n end\n end", "def index\n @tasks = Task.all(:order => \"position\")\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tasks }\n end\n end", "def tasks\n task_list.tasks\n end", "def list_tasks\n tasks = @repository.all\n @view.display_tasks(tasks)\n end", "def index\n @tasks = @project.tasks\n end", "def index\n @tasks = @project.tasks\n end", "def show\n @task = Task.find(params[:id])\n @subtasks = @task.statuses.order(:created_at).reverse\n @subtask = Status.new\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @task }\n end\n end", "def get_user_tasks\n puts \"CURRENT USER: #{get_current_user}\"\n if get_current_user\n # if params[:category_ids].empty?\n tasks = get_current_user.tasks.order(created_at: :desc)\n tasks_categories = TaskSerializer.new(tasks)\n\n puts \"CATEGORRRIES\", tasks_categories\n\n render json: TaskSerializer.new(tasks).to_serialized_json\n else \n render json: {\n error: \"Login to see tasks\"\n }\n # render json: get_current_user.tasks.order(created_at: :desc)\n end \n end", "def tasks(project_id, story_id, options = {})\n get(\"projects/#{project_id}/stories/#{story_id}/tasks\", options).tasks\n end" ]
[ "0.7889543", "0.7751927", "0.7619872", "0.75984913", "0.75936216", "0.7505406", "0.7464987", "0.74337274", "0.7383206", "0.7344766", "0.7322099", "0.7322099", "0.7322099", "0.7303383", "0.7263056", "0.72467685", "0.72430325", "0.7233159", "0.7165631", "0.7160025", "0.713756", "0.71105015", "0.709081", "0.70751214", "0.7055932", "0.7030792", "0.70248514", "0.70229375", "0.7020989", "0.70140356", "0.69951385", "0.6991442", "0.6974759", "0.6973579", "0.6972435", "0.6961948", "0.6960721", "0.69545823", "0.69545823", "0.69545823", "0.69545823", "0.69545823", "0.69545823", "0.69545823", "0.69545823", "0.69545823", "0.69545823", "0.69545823", "0.69545823", "0.69545823", "0.69545823", "0.69545823", "0.69545823", "0.69545823", "0.69545823", "0.69545823", "0.69545823", "0.69545823", "0.69545823", "0.6948957", "0.69476444", "0.6928409", "0.6912184", "0.69118315", "0.69118315", "0.69118315", "0.69118315", "0.69118315", "0.69118315", "0.69118315", "0.69118315", "0.69118315", "0.69118315", "0.69118315", "0.69118315", "0.69118315", "0.69118315", "0.68937725", "0.6878897", "0.68779707", "0.68779707", "0.68775356", "0.6862526", "0.68618", "0.6856252", "0.6850378", "0.6841729", "0.6837171", "0.68286175", "0.6807867", "0.680521", "0.6790767", "0.67895865", "0.67889464", "0.67870545", "0.6786362", "0.6781003", "0.6781003", "0.67745817", "0.67727417", "0.6761079" ]
0.0
-1
POST /tasks POST /tasks.json
def create set_user @task = @user.tasks.new(task_params) if @task.save respond_to do |format| format.js {} end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n #@task = Task.new(task_params)\n task = @task_list.tasks.create!(task_params)\n render json: task\n end", "def create\n @task = Task.new(task_params)\n\n if @task.save\n render json: @task, status: :created\n else\n render json: @task.errors, status: :unprocessable_entity\n end\n end", "def create_task(options = {})\n request(:post, \"tasks\", options)\n end", "def create\n @task = Task.new(task_params)\n @task.save\n render json: full_task(@task)\n end", "def create\n @task = Task.new(task_params)\n\n if @task.save\n render json: @task, serializer: TaskSerializer\n else\n render json: { error: t('task_create_error') }, status: :unprocessable_entity\n end\n end", "def create\n task = Task.new(task_params)\n if task.save\n render json: task, status: :created\n else\n render_errors(task)\n end\n end", "def tasks\n uri = URI(BASE_URL + TASKS_ENDPOINT)\n\n make_request(uri)\n end", "def create\n # raise params.inspect\n @task = Task.new(task_params)\n if @task.save\n redirect_to tasks_url\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n\n end\n end", "def create\n\t\t@task = Task.new(task_params)\n\t\[email protected] = current_user\n\n\t\trespond_to do |format|\n\t\t\tif @task.save\n\t\t\t\tformat.html { render json: @task }\n\t\t\t\tformat.json { render json: @task }\n\t\t\telse\n\t\t\t\tformat.html { render :new }\n\t\t\t\tformat.json { render json: @task.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def create\n @task = Task.new(task_params)\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to tasks_path, notice: 'Task was successfully created.' }\n format.json { render :show, status: :created, location: tasks_path }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n projusers = ProjectsUser.find(params[:task][:project_users_id])\n @task = projuser.tasks.build(task_params)\n\n if @task.save\n render json: @task , status: :created, location: @task\n else\n render json: @task.errors, status: :unprocessable_entity\n end\n end", "def create\n @task = Task.new(task_params)\n\n if @task.save\n render :show, status: :created, location: @task\n else\n render json: @task.errors, status: :unprocessable_entity\n end\n end", "def create\n @task = Task.new(task_params)\n respond_to do |format|\n if @task.save\n @users = User.all\n @users.each do |user|\n user.tasks << @task\n end\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n \n @user= User.find_by_id(session[:user_id])\n @task = @user.tasks.create(params[:task])\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render json: @task, status: :created, location: @task }\n else\n format.html { render action: \"new\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = @project.tasks.new(task_params)\n @task.user = current_user if current_user.developer?\n @statuses = Task.statuses.keys\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to edit_project_task_path(@project, @task.id), notice: 'Task was successfully created.' }\n format.json { render :show, status: :created, location: @task }\n else\n puts @task.errors.as_json\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new(task_param)\n if @task.save\n render json: get_task_hash(@task)\n else\n render json: @task.errors.full_messages \n end\n end", "def create\n @task = Task.new(task_params)\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to tasks_url, notice: 'Task was successfully created.' }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new(task_params)\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to tasks_url, notice: 'Task was successfully created.' }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = current_user.tasks.build(task_params)\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: \"Task was successfully created.\" }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n #byebug\n @task = Task.new(task_params)\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = current_user.tasks.new task_params\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def add task_details\n\n #prepare payload\n now = Time.now.to_i \n defaults = {\n \"method\" => \"task.save\",\n \"id\" => UUID.generate,\n \"type\" => 0,\n \"_type\" => now,\n \"state\" => 0,\n \"_state\" => now,\n }\n\n task = defaults.merge(task_details)\n self.post [task].to_json\n end", "def create\n @api_task = Api::Task.new(api_task_params)\n\n respond_to do |format|\n if @api_task.save\n format.html { redirect_to @api_task, notice: 'Task was successfully created.' }\n format.json { render :show, status: :created, location: @api_task }\n else\n format.html { render :new }\n format.json { render json: @api_task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = current_user.tasks.build(task_params)\n respond_to do |format|\n if @task.save \n format.html { redirect_to @task, notice: \"Task was successfully created.\" }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_user_task\n task = Task.create(task_params)\n puts \"New task: #{task}\"\n if task\n render json: {task: task}\n else\n render json: task.error.full_messages, status: 402\n end\n end", "def create\n \n @task = params[:task] ? Task.create(params[:task]) : Task.create(:description=>params[:description], :isDone=>params[:isDone], :order=>params[:order] )\n respond_with(@task)\n \n end", "def create\n @task = Task.new(task_params)\n @task.start\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to tasks_url, notice: 'Task was successfully created.' }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = current_user.tasks.build(params[:task])\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to :action => :index, notice: 'Task was successfully created.' }\n format.json { render json: @task, status: :created, location: @task }\n else\n format.html { render action: \"new\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new(task_params)\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new(task_params)\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new(task_params)\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new(task_params)\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new(task_params)\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new(task_params)\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new(task_params)\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new(task_params)\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new(task_params)\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new(task_params)\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new(params[:task])\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render json: @task, status: :created, location: @task }\n else\n format.html { render action: \"new\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new(params[:task])\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render json: @task, status: :created, location: @task }\n else\n format.html { render action: \"new\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new(params[:task])\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render json: @task, status: :created, location: @task }\n else\n format.html { render action: \"new\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new(params[:task])\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render json: @task, status: :created, location: @task }\n else\n format.html { render action: \"new\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new(task_params)\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: \"Task was successfully created.\" }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new(task_params)\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: \"Task was successfully created.\" }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new(task_params)\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: \"Task was successfully created.\" }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new do |t|\n t.title = params[:title]\n t.picture = params[:picture]\n t.description = params[:description]\n t.color = params[:color]\n t.date = params[:date]\n t.order = params.has_key?(:order) ? params[:order] : 0\n end\n\n if @task.save\n render json: @task, status: :created, location: @task\n else\n render json: @task.errors, status: :unprocessable_entity\n end\n end", "def create(task)\n validate_type!(task)\n\n attributes = sanitize(task)\n _, _, root = @client.post(\"/tasks\", attributes)\n\n Task.new(root[:data])\n end", "def create\n @task = current_user.tasks.new(task_params)\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'タスクを登録しました!' }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.create!(task_params)\n end", "def create\n @task = @project.tasks.new(task_params)\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to [@project, @task], notice: 'Task was successfully created.' }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = @project.tasks.create!(task_params)\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to project_url(@project), notice: 'Task was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @project = Project.find(params[:project_id])\n @task = @project.tasks.new(task_params)\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @project, notice: 'Task was successfully created.' }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n # @task = Task.new(task_params)\n @task = current_user.tasks.build(task_params)\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, success: t('.notice') }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new(task_params)\n @task.save\n end", "def create\n @task = Task.new(task_params)\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render action: 'show', status: :created, location: @task }\n else\n format.html { render action: 'new' }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new(task_params)\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render action: 'show', status: :created, location: @task }\n else\n format.html { render action: 'new' }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new(task_params)\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render action: 'show', status: :created, location: @task }\n else\n format.html { render action: 'new' }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new(task_params)\n\t\t\n\t\t# Assume none are taken at creation...\n\t\[email protected] = 0\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n #@task = Task.new(params[:task])\n\n\n @task = current_user.tasks.build(params[:task])\n\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to action: \"index\", notice: 'Task was successfully created.' }\n format.json { render json: @task, status: :created, location: @task }\n else\n format.html { render action: \"new\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\t@task = Task.new(task_params)\n\n\t\trespond_to do |format|\n\t\t\tif @task.save\n\t\t\t\tformat.html { redirect_to [:admin, @task], notice: 'Task was successfully created.' }\n\t\t\t\tformat.json { render :show, status: :created, location: [:admin, @task] }\n\t\t\telse\n\t\t\t\tformat.html { render :new }\n\t\t\t\tformat.json { render json: [:admin, @task].errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def create\n @task = Task.create(task_params)\n redirect_to tasks_path\n end", "def create\n @task = current_user.tasks.build(task_params)\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to tasks_path, notice: 'Task was successfully created.' }\n format.json {render inline: \"location.reload();\" }\n format.json { render :show, status: :created, location: tasks_path }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.find(params[:user_task][:tasks_id])\n\tcurrent_user.craete_task!(@task)\n respond_to do |format|\n if @user_task.save\n format.html { redirect_to @user_task, notice: 'User Task was successfully created.' }\n format.json { render json: @user_task, status: :created, location: @user_task }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_task.errors, status: :unprocessable_entity }\n end\n end\n end", "def tasks_post(cbrain_task, opts = {})\n data, _status_code, _headers = tasks_post_with_http_info(cbrain_task, opts)\n data\n end", "def create\n @task = Task.new(params[:task])\n @task.user_id = current_user.id\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render json: @task, status: :created, location: @task }\n else\n format.html { render action: \"new\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if params[:event_id]\n @event = Event.find(params[:event_id])\n if @event.user == current_user\n @task = @event.tasks.create(task_params)\n render json: @task\n else\n render json: { error: \"No such event for user\" }, status: :unauthorized\n end\n else\n @task = @current_user.tasks.create(task_params)\n render json: @task\n end\n end", "def create\n @task = Task.new(task_params)\n\n respond_to do |format|\n if @task.save\n if params[:create_and_continue]\n format.html { redirect_to new_task_url, notice: 'Task was successfully created.' }\n else\n format.html { redirect_to tasks_url, notice: 'Task was successfully created.' }\n end\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n #puts \"=====\"\n #puts task_params.inspect\n @task = Task.new(task_params)\n \n # add user id.\n @task.user_id = current_user.id\n #puts @task.inspect\n \n # save to db.\n respond_to do |format|\n if @task.save\n #format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.html { redirect_to action: 'index' }\n #format.json { render action: 'show', status: :created, location: @task }\n #format.json { render action: 'index', status: :created }\n else\n format.html { render action: 'new' }\n #format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = @list.tasks.build(task_params)\n\n if @task.save\n return render_success_task_created\n else\n return render_error_save @task\n end\n end", "def create\n task = Task.new(task_params)\n\n if task.save\n render json: task, include: [:user, :column], except: [:user_id, :column_id], status: :created, location: task\n else\n render json: task.errors, status: :unprocessable_entity\n end\n \n end", "def create\n @event_task = @event.event_tasks.new(event_task_params)\n\n respond_to do |format|\n if @event_task.save\n format.html { redirect_to @event_task, notice: 'Event task was successfully created.' }\n format.json { render :show, status: :created, location: @event_task }\n else\n format.html { render :new }\n format.json { render json: @event_task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new(task_params)\n @task[:authorization_id] = Authorization.current_id\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render :show, status: :created}\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new(task_params)\n\n @task.user = current_user\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def tasks\n @todos = Todo.all\n render json: @todos\n end", "def create\n @task = Task.new(task_params)\n @task.user_id = current_user.id\n\n respond_to do |format|\n if @task.save\n format.html {redirect_to @task, notice: 'Task was successfully created.'}\n format.json {render :show, status: :created, location: @task}\n else\n format.html {render :new}\n format.json {render json: @task.errors, status: :unprocessable_entity}\n end\n end\n end", "def create\n @task = Task.new(task_params)\n @task.save\n redirect_to task_path(@task)\n end", "def create\n @task_list = TaskList.new(task_list_params)\n\n if @task_list.save\n render json: @task_list, status: :created, location: @task_list\n else\n render json: @task_list.errors, status: :unprocessable_entity\n end\n end", "def create\n @post_task = PostTask.new(post_task_params)\n\n respond_to do |format|\n if @post_task.save\n format.html { redirect_to @post_task, notice: 'Post task was successfully created.' }\n format.json { render :show, status: :created, location: @post_task }\n else\n format.html { render :new }\n format.json { render json: @post_task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = TaskTracker::Task.new(task_params)\n @task.fractal_interface = @user.task_tracker_interface\n\n if @task.save\n render :show, status: :created, location: @task\n else\n render json: @task.errors, status: :unprocessable_entity\n end\n end", "def create\n @default_task = DefaultTask.new(params[:default_task])\n\n if @default_task.save\n render json: @default_task, status: :created, location: @default_task\n else\n render json: @default_task.errors, status: :unprocessable_entity\n end\n end", "def create\n @task = Task.new(task_params)\n @task.users << current_user\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n flash[:notice] = \"Task was successfully created.\" if task.save\n respond_with(task)\n end", "def create\n @task = Task.new(task_param)\n @task.user_id = current_user.id\n\n respond_to do |format|\n if @task.save\n format.json { render json: @task, status: :created, location: @task }\n format.js { render }\n else\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def post(action, task=nil, params={})\n @action = action\n @task = task\n request(:post, params)\n end", "def create\n @task = Task.create!(params[:task])\n @task.complete = 0\n if @task.save\n \t#logger.debug \"New task: #{@task.attributes.inspect}\"\n \trespond_to do |format|\n \t\tformat.html {redirect_to tasks_url, notice: 'Task was successfully created.' }\n \t\tformat.js\n \tend\n end\n end", "def create\n task = Task.new(task_params)\n task.save ? respond_with(task) : false\n end", "def create\n @task = Task.new(\n name: params[:task][:name],\n description: params[:task][:description],\n completed_at: params[:task][:completed_at]\n )\n if @task.save\n redirect_to task_path(@task.id)\n else\n render :new\n end\n end", "def create\n @task = Task.new(params[:task])\n if @task.save\n flash[:notice] = 'Task was successfully created.' \n end\n respond_with(@task)\n end", "def create_tasks_with_http_info(task_payload, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DevicesManagementApi.create_tasks ...\"\n end\n # verify the required parameter 'task_payload' is set\n fail ArgumentError, \"Missing the required parameter 'task_payload' when calling DevicesManagementApi.create_tasks\" if task_payload.nil?\n # resource path\n local_var_path = \"/devicemgmt/tasks\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(task_payload)\n auth_names = ['artikcloud_oauth']\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 => 'TaskEnvelope')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DevicesManagementApi#create_tasks\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @task = current_user.tasks.new(task_params)\n respond_to do |format|\n if @task.save\n format.html { redirect_to tasks_path, notice: 'Task was successfully created.' }\n else\n format.html { render :new }\n end\n end\n end", "def create\n @task = Task.new(params[:task])\n\n respond_to do |format|\n if @task.save\n @feature.tasks << @task\n @iteration.tasks << @task\n @feature.save\n @iteration.save\n get_tasks\n format.js\n format.html { redirect_to(@task, :notice => 'Task was successfully created.') }\n format.xml { render :xml => @task, :status => :created, :location => @task }\n else\n format.js\n format.html { render :action => \"new\" }\n format.xml { render :xml => @task.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n # This prevents \n @task = current_user.tasks.build(task_params)\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render action: 'show', status: :created, location: @task }\n else\n format.html { render action: 'new' }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new(params[:task])\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: '已建立任务.' }\n format.json { render json: @task, status: :created, location: @task }\n else\n format.html { render action: \"new\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t @user = User.find(current_user)\n\t @clients = Client.all\n\t @projects = Project.all\n\t @places = Place.all\n\t @types = Type.all\n\t @responsibles = Responsible.all\n\t @task = @user.tasks.create(task_params)\n\n\t redirect_to task_path(@tasks) \n\n end", "def create\n @task = Task.new(task_params)\n @task.creator_id = current_user.id\n @task.workspace_id = current_user.homespace_id\n if @task.save\n render :show, status: :created\n else\n render json: @task.errors, status: :unprocessable_entity\n end\n end", "def task_params\n params.require(:task).permit(:task)\n end", "def create\n @taks = Task.new()\n @task.save\n redirect_to task_path(@task)\n end", "def create_task(list_id, text)\n path = \"lists/#{list_id}/tasks\"\n params = {task: {text: text}}\n request(path, params, :post)\n\n # output full list again\n show_list(list_id)\n end", "def create\n @task = Task.new(task_params)\n respond_to do |format|\n if @task.save\n set_tasks\n format.js { render_index }\n format.json { render :show, status: :created, location: @task }\n else\n format.js { render :index }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task = Task.new(task_params)\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task.project, notice: 'Tarefa criada com sucesso.' }\n format.json { render :show, status: :created, location: @task }\n else\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n # 'params_task' returns the value that is authorized by this function\n # rails in default blocks any modifications so we have to give this access\n @task = Task.new(task_params)\n @task.save\n # we don't want to go to a kind of 'create's page' so we are redirecting to\n # out root page\n redirect_to tasks_path(@task)\n end" ]
[ "0.7529737", "0.74976224", "0.7411092", "0.7389878", "0.7261207", "0.72587913", "0.7183996", "0.7147952", "0.71120256", "0.70759165", "0.70639485", "0.70576006", "0.70560944", "0.70294535", "0.7016957", "0.7012058", "0.70110804", "0.7009976", "0.6993863", "0.69896185", "0.69874805", "0.6979071", "0.6959856", "0.69576937", "0.69558054", "0.69531894", "0.69487214", "0.692395", "0.6923908", "0.69125044", "0.69125044", "0.69125044", "0.69125044", "0.69125044", "0.69125044", "0.69125044", "0.69125044", "0.69125044", "0.69053763", "0.69053763", "0.69053763", "0.69053763", "0.6901512", "0.6901512", "0.6901512", "0.68694705", "0.6859745", "0.68524545", "0.68371534", "0.68277967", "0.6816359", "0.6814556", "0.6810082", "0.6806421", "0.6798081", "0.6797092", "0.6797092", "0.67956513", "0.67945486", "0.67939824", "0.6776601", "0.677122", "0.67588496", "0.6754308", "0.67512786", "0.6744059", "0.6737928", "0.6732478", "0.6732421", "0.67183125", "0.670832", "0.6705496", "0.66870415", "0.6680263", "0.66769254", "0.6664806", "0.6664068", "0.66593945", "0.66548383", "0.6652324", "0.66382337", "0.6627153", "0.6623946", "0.6623037", "0.66139346", "0.65943986", "0.6590727", "0.65901965", "0.65810376", "0.65792674", "0.6574959", "0.65713674", "0.6569045", "0.65646166", "0.65613085", "0.6557063", "0.65470684", "0.6545884", "0.6540133", "0.65356857", "0.6533326" ]
0.0
-1
PATCH/PUT /tasks/1 PATCH/PUT /tasks/1.json
def update set_task respond_to do |format| if @task.update!(task_params) format.html format.json { respond_with_bip(@task) } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\r\n @tasks = Task.find(params[:id])\r\n if @tasks.update(task_params)\r\n render json: @tasks\r\n else\r\n render json: @tasks.errors, status: :unprocessable_entity\r\n end\r\n end", "def update\n task = Task.find(params[:id])\n if task.update(task_params)\n render json: task\n else\n render_errors(task)\n end\n end", "def edit_user_task\n task = Task.find(params[:id])\n \n if task.update(task_params)\n render json: {task: task, status: 201} \n else\n render json: {errors: task.errors.full_message , status: 422}\n end\n end", "def edit_user_task\n task = Task.find(params[:id])\n \n if task.update(task_params)\n render json: {task: task, status: 201} \n else\n render json: {errors: task.errors.full_message , status: 422}\n end\n end", "def update\n @task = Task.find_by(id: params[:id])\n if @task.update(task_params)\n render json: { message: I18n.t('task.update.success') }, status: 200\n else\n render json: @task.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.json { render :show, status: :ok, location: @task }\n else\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n task = @task_list.tasks.find(params[:id])\n task.update_attributes(task_params)\n render nothing: true\n end", "def update\n respond_to do |format|\n if @api_task.update(api_task_params)\n format.html { redirect_to @api_task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_task }\n else\n format.html { render :edit }\n format.json { render json: @api_task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @task = Task.find(params[:id])\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n format.html { redirect_to @task, :notice => 'Task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @task.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n\t\trespond_to do |format|\n\t\t\tbegin\n\t\t\t\tif @task.update(task_params)\n\t\t\t\t\tformat.html { redirect_to @task, notice: 'Task was successfully updated.' }\n\t\t\t\t\tformat.json { render json: @task, status: :ok }\n\t\t\t\telse\n\t\t\t\t\tformat.html { render :edit }\n\t\t\t\t\tformat.json { render json: @task.errors, status: :unprocessable_entity }\n\t\t\t\tend\n\t\t\trescue ActiveRecord::RecordInvalid => error\n\t\t\t\tformat.html { render :edit }\n\t\t\t\tformat.json { render json: { \"error\": error.message }, status: :ok }\n\t\t\tend\n\t\tend\n\tend", "def update\n @task = Task.find(params[:id])\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @task = Task.find(params[:id])\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @task = Task.find(params[:id])\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @task = Task.find(params[:id])\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @task = Task.find(params[:id])\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @task = Task.find(params[:id])\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @task = Task.find(params[:id])\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @task = Task.find(params[:id])\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @task = Task.find(params[:id])\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @task = Task.find(params[:id])\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @task = Task.find(params[:id])\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @task = current_user.tasks.find(params[:id])\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n format.html { redirect_to :action => :index, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @task.update(task_params)\n end", "def update\n if @task.update(task_param)\n render json: get_task_hash(@task)\n else\n render json: @task.errors.full_messages\n end\n end", "def update\n @task = Task.find(params[:id])\n\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to action: \"index\" }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @task = @project.tasks.find(params[:id])\n #@task = @project.tasks.update!(task_params)\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n format.html { redirect_to project_url(@task), notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def edit_task\n puts 'edit task method'\n @task = Task.find_by(id: params[:id])\n @task.update(name: params[:new_name])\n\n render :json => @task.as_json(:only => [:id, :name])\n end", "def update\n @task = Task.find(params[:id])\n respond_to do |format|\n if @task.update_attributes(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to tasks_path, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: tasks_path }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to tasks_path, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: tasks_path }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to tasks_path, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @task.update(task_params)\n render :show, status: :ok\n else\n render json: @task.errors, status: :unprocessable_entity\n end\n end", "def update\n @user = current_user\n begin\n @task = Task.for_user(@user).find(params[:id])\n @task.change!(params[:task][:action])\n success = true\n error = nil\n rescue => e\n success = false\n error = e.message\n end\n render json: { task: (@task.constructor rescue nil), success: success, error: error }\n end", "def update\n @task = Task.find(params[:id])\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n format.html { redirect_to @task.project, :notice => 'Task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @task.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @task = Task.find(params[:id])\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n format.xml { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n format.xml { render xml: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\t\trespond_to do |format|\n\t\t\tif @task.update(task_params)\n\t\t\t\tformat.html { redirect_to [:admin, @task], notice: 'Task was successfully updated.' }\n\t\t\t\tformat.json { render :show, status: :ok, location: [:admin, @task] }\n\t\t\telse\n\t\t\t\tformat.html { render :edit }\n\t\t\t\tformat.json { render json: [:admin, @task].errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def update\n if @task.update(task_params)\n render :show, status: :ok, location: @task\n else\n render json: @task.errors, status: :unprocessable_entity\n end\n end", "def update\n @task = Task.find(params[:id])\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n $redis.publish('tasks.update', TaskSerializer.new(Task.last).to_json)\n else\n format.html { render action: \"edit\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: t('task.successfully-updated') }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task_entry.update(task_entry_params)\n format.json { head :no_content }\n else\n format.json { render json: @task_entry.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to tasks_url, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to tasks_url, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update \n\t logger.debug \"Params --------------------------------------- #{params}\"\n\n\t logger.debug \"task params --------------------------------------#{task_params}\"\n\t format_task_attributes(task_params)\n\t \n\t logger.debug \"-------------------------------------------------------------\"\n\t logger.debug \"Updated Params #{@updated_params}\"\n\t @updated_params[:id]=params[:id]\n\t @task = Task.find(@updated_params[:id])\n\t logger.debug \"#########################\"\n\t logger.debug \"Task found \"\n\t \n\t @task.assign_attributes(@updated_params)\n\t authorize! :update, @task\n\t @task.is_completed=false\n\t save_task\n\tend", "def update\n @todo_task = TodoTask.find(params[:id])\n\n respond_to do |format|\n if @todo_task.update_attributes(params[:todo_task])\n format.html { redirect_to @todo_task, notice: 'Todo task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @todo_task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @task = current_user.tasks.find(params[:id])\n\n respond_with @task do |format|\n if @task.update_attributes(params[:task])\n format.html { redirect_to(tasks_path, :notice => t('messages.updated')) }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: \"Task was successfully updated.\" }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: \"Task was successfully updated.\" }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: \"Task was successfully updated.\" }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: \"Task was successfully updated.\" }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: \"Task was successfully updated.\" }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n command = Tasks::Update.call(@task, params: task_params)\n respond_to do |format|\n if command.success?\n format.html { redirect_to @task, notice: \"Task was successfully updated.\" }\n else\n format.html { render :edit, status: :unprocessable_entity }\n end\n end\n end", "def update\n #binding.pry\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, notice: \"Task was successfully updated.\" }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update task_params\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @task = Task.find(params[:id])\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n format.html { redirect_to projects_path }\n format.json { head :no_content }\n format.js { redirect_to projects_path }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to [@project, @task], notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to @task, success: t('.notice') }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to back_url, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to back_url, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @task = Task.find(params[:id])\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n get_tasks\n format.js\n format.html { redirect_to(@task, :notice => 'Task was successfully updated.') }\n format.xml { head :ok }\n else\n format.js\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @task.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n if @task.update(task_params)\n flash.now.alert = \"Task was updated\"\n render json: full_task(@task)\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_to project_tasks_path(@project), notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @task = Task.find(params[:id])\n\n respond_to do |format|\n if @task.update_attributes(params.require(:task).permit(:complete))\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n self.init\n authorize! :read, @list\n authorize! :update, @task\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n format.html { redirect_to @list, notice: I18n.t('tasks.update_success') }\n format.json { render json: [] }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @task = Task.find(params[:id])\n params[:task] ? @task.update_attributes(params[:task]) : @task.update_attributes(:description=>params[:description], :isDone=>params[:isDone], :order=>params[:order] )\n #@task.save\n respond_with(@task)\nend", "def update\n respond_to do |format|\n if @task.update(task_params)\n @task.whenever_reset unless task_params[:every].blank? && task_params[:at].blank?\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize @task\n respond_to do |format|\n if @task.update(task_params)\n format.html { redirect_back_or_default(notice: 'Task was successfully updated.') }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @task = Task.find(params[:id])\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n format.html { redirect_to project_task_path(params[:project_id],@task), notice: 'Task was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n flash[:notice] = \"Task was successfully updated.\" if task.save\n respond_with(task)\n end", "def update\n params = task_params\n mark_done = params.delete(:mark_done) == \"1\"\n if mark_done\n @task.mark_done\n else \n @task.mark_undone\n end\n respond_to do |format|\n if @task.update(params)\n \n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.74462444", "0.72925776", "0.7264818", "0.7264818", "0.7076864", "0.70250654", "0.69654405", "0.69621724", "0.6952344", "0.6910241", "0.6906667", "0.6906667", "0.6906667", "0.6896555", "0.6896555", "0.6896555", "0.6896555", "0.6896555", "0.6896555", "0.6896555", "0.6896555", "0.68929297", "0.68867797", "0.6874989", "0.6852821", "0.6852687", "0.68301374", "0.68221664", "0.6815256", "0.6815256", "0.6798908", "0.6796406", "0.6791242", "0.67690206", "0.67599857", "0.67599857", "0.67599857", "0.67599857", "0.67599857", "0.67599857", "0.67599857", "0.67599857", "0.6752676", "0.6750947", "0.6743011", "0.6733928", "0.6720936", "0.6719638", "0.67168444", "0.6714353", "0.6714353", "0.6712363", "0.6712363", "0.6712363", "0.6712363", "0.6712363", "0.6712363", "0.6712363", "0.6712363", "0.6712363", "0.6712363", "0.6712363", "0.6712363", "0.6712363", "0.6712363", "0.6712363", "0.6712363", "0.6712363", "0.6712363", "0.6712363", "0.6712363", "0.6712363", "0.67070997", "0.66957825", "0.66925967", "0.66884345", "0.66884345", "0.66884345", "0.66884345", "0.66884345", "0.6677357", "0.6676796", "0.6675944", "0.6672549", "0.6672233", "0.66213316", "0.66108394", "0.66105765", "0.66105765", "0.6609982", "0.66096133", "0.6607024", "0.6606417", "0.66033673", "0.66033626", "0.65999365", "0.6595808", "0.6587764", "0.65845335", "0.65803826" ]
0.7138948
4
DELETE /tasks/1 DELETE /tasks/1.json
def destroy @task.destroy respond_to do |format| format.js { render layout: false} end flash.now[:info] = 'Task was successfully deleted.' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_task id\n request :delete, \"tasks/#{id}\"\n nil\n end", "def delete_task\n @task = Task.find_by(id: params[:id])\n @task.destroy\n render :json => @task.as_json(:only => [:id])\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :ok }\n end\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :ok }\n end\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n task = Task.find(params[:id])\n if task.destroy\n render json: task\n else\n render_errors(task)\n end\n end", "def destroy\n @task_entry.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n head :no_content\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to :root }\n format.json { head :no_content }\n end\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n Task.find_by_name(unescape_url(params[:id]))\n respond_to do |format|\n format.html { redirect_to(tasks_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @task = Node.find(params[:id])\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_path}\n format.json { head :no_content }\n end\n \n end", "def destroy\n @todo_task = TodoTask.find(params[:id])\n @todo_task.destroy\n\n respond_to do |format|\n format.html { redirect_to todo_tasks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @task = Task.find(params[:id])\n if (access)\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :ok }\n end\n end\n end", "def destroy\r\n @status_task = StatusTask.find(params[:id])\r\n @status_task.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to status_tasks_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @task.destroy\n render json: { message: I18n.t('task.destroy.success') }, status: 200\n end", "def destroy\n @task.destroy\n \n head :no_content\n end", "def destroy\n @task = @project.tasks.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to(project_tasks_path(@project)) }\n format.json { head :no_content }\n end\n end", "def destroy\n @api_task.destroy\n respond_to do |format|\n format.html { redirect_to api_tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n Tasks::Delete.call(id: params[:id])\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n end\n end", "def destroy\n @task = current_user.tasks.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @task = current_user.tasks.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @task_list.tasks.find(params[:id]).destroy\n render nothing: true\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to user_tasks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n \n respond_to do |format|\n format.html { redirect_to(tasks_url) }\n format.xml { head :ok }\n end\n end", "def delete()\n\n client.delete(\"/tasks/#{gid}\") && true\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @todo = Todo.find(params[:todo][:id])\n if @todo.destroy\n render json: {status: 200, message: \"Task with id \" + @todo.id.to_s + ': removed'}\n else\n render nothing: true, status: :bad_request\n end\n end", "def destroy\n @task = current_user.tasks.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to :action => :index }\n format.json { head :no_content }\n end\n \n end", "def destroy\n task.destroy\n respond_with(task)\n end", "def destroy\n @task.destroy\n head :no_content, status: :ok\n end", "def delete_user_task\n task = Task.find(params[:id])\n\n if task.destroy\n render json: {message: 'Task successfully deleted!'}\n else\n render json: task.errors.full_messages, status: 402\n end\n end", "def destroy\n @task.destroy\n track_activity @task\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, danger: t('.notice') }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to my_todo_tasks_url(@todo) }\n format.json { head :no_content }\n end\n end", "def destroy\n name = @task.name\n @task.destroy\n\n render json: [\"You have successfullly deleted '#{name}''\"], status: 200\n end", "def destroy\n @user_task = UserTask.find(params[:id]).task\n @user_task.destroy\n\n respond_to do |format|\n format.html { redirect_to user_tasks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to(tasks_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to(tasks_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to(tasks_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to(tasks_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to(tasks_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @task = Project.find(params[:project_id]).tasks.find(params[:id])\n \n if @task.destroy\n render :json => {:status => :ok}\n else\n render :json => {:error => @task.errors.full_messages, :status => :bad_request}\n end\n end", "def delete_user_task\n task = Task.find(params[:id])\n if task.destroy\n render json: {message: 'Task successfully deleted!'}\n else\n render json: task.errors.full_messages, status: 402\n end\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Tarefa was successfully destroyed.' }\n format.json { head :no_content }\n end\nend", "def destroy\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to @task.user }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to new_task_path, notice: 'Task was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to(tasks_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @task.update_attribute(:status, 'deleted')\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end" ]
[ "0.78326327", "0.75876695", "0.7564121", "0.75633883", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7488168", "0.7488168", "0.7488168", "0.7488168", "0.7488168", "0.7488168", "0.7439073", "0.73971665", "0.7383215", "0.7366426", "0.73521817", "0.7344428", "0.7343063", "0.73387766", "0.7337433", "0.7336587", "0.73272026", "0.7324841", "0.73240036", "0.7323084", "0.73186094", "0.73186094", "0.7309377", "0.7293438", "0.72858804", "0.7277217", "0.72681975", "0.7266236", "0.7241524", "0.7239808", "0.72381705", "0.7234945", "0.72302383", "0.72274977", "0.72274387", "0.72246164", "0.721741", "0.72162366", "0.72162366", "0.72162366", "0.72162366", "0.7202234", "0.72018224", "0.7195978", "0.718567", "0.7177413", "0.71739143", "0.71646357", "0.7164449", "0.71595794", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.7151728", "0.71509457" ]
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_complete_incomplete @tasks_incomplete = @tasks.where("completed = 'f'").order('tasks.created_at DESC') @tasks_complete = @tasks.where("completed = 't'").order('tasks.created_at DESC') 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 before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\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 workflow\n 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 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 after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\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 action\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 config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \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 action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n 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 lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n 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 release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\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 my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n 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" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def task_params params.require(:task).permit(:task, :all_tags, :completed, :raw_date) 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
Use callbacks to share common setup or constraints between actions.
def set_user @user = User.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 set_actions\n actions :all\n end", "def define_action_helpers?; 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 after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\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 action\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 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 matt_custom_action_begin(label); end", "def setup\n # override this if needed\n 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 after_set_callback; end", "def initialize(*args)\n super\n @action = :set\nend", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n 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 release_actions; end", "def around_hooks; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def save_action; end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\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 _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 duas1(action)\n action.call\n action.call\nend", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def call\n setup_context\n super\n end" ]
[ "0.61642385", "0.60448", "0.5945487", "0.5915654", "0.58890367", "0.58330417", "0.5776098", "0.5703048", "0.5703048", "0.5654613", "0.5620029", "0.5423114", "0.540998", "0.540998", "0.540998", "0.5393666", "0.53783023", "0.53568405", "0.53391176", "0.5339061", "0.53310865", "0.5312988", "0.529798", "0.52968603", "0.52962637", "0.52577317", "0.5244704", "0.5236856", "0.5236856", "0.5236856", "0.5236856", "0.5236856", "0.5233461", "0.52322435", "0.5227552", "0.52224743", "0.5217851", "0.521241", "0.52069896", "0.5206555", "0.5176617", "0.51738507", "0.51725876", "0.51660734", "0.51605034", "0.51571786", "0.5152762", "0.5152164", "0.5151477", "0.5145819", "0.51408994", "0.5134412", "0.5114031", "0.5113695", "0.5113695", "0.5108603", "0.5107358", "0.5090405", "0.50889385", "0.50817686", "0.5081617", "0.50658226", "0.50551206", "0.5051746", "0.5049091", "0.5049091", "0.5034681", "0.5024972", "0.5021291", "0.5016024", "0.50134826", "0.50008893", "0.50000244", "0.4999155", "0.49907947", "0.49907947", "0.49853387", "0.49796683", "0.4979596", "0.49778128", "0.49673793", "0.49662578", "0.49587822", "0.4956063", "0.49550167", "0.49523485", "0.4951614", "0.49452996", "0.49442068", "0.49336892", "0.49306205", "0.49264124", "0.49259305", "0.4925823", "0.49229056", "0.4918999", "0.49171805", "0.49167436", "0.4916559", "0.49153692", "0.49148256" ]
0.0
-1
after_commit :create_hash_tags, on: :create def create_hashtags extract_hashtags.each do |name| hash_tags.create(name: name) end end
def extract_hashtags description.to_s.scan(/#\w+/).map{|name| name.gsub("#", "")} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_hash_tags\n get_name_hash_tags.each do |name|\n hash_tags.create(name: name)\n end\n end", "def generate_tags\n\t\ttags = Twitter::Extractor.extract_hashtags(caption)\n\t\ttags.each do |tag|\n\t\t\thashtag = Hashtag.find_by_name(tag)\n\t\t\tif hashtag\n\t\t\t\thashtags << hashtag\n\t\t\telse\n\t\t\t\thashtags.build(:name => tag)\n\t\t\tend\n\t\tend\n\tend", "def perform\n tweets = load_tweets\n tweets.each do |t|\n t.hashtags.each do |h|\n Trend.create(hashtags: h.text, created_at: Time.now)\n end\n end\n end", "def parse_hashtags\n hashtags = extract_hashtags(@title)\n hashtags += extract_hashtags(@description)\n @albums.each do |album|\n hashtags += extract_hashtags(album['name'])\n hashtags += extract_hashtags(album['description'])\n end\n\n if @tags\n @tags.concat hashtags.uniq\n @tags = @tags.uniq\n else\n @tags = hashtags.uniq\n end\n end", "def save_with_tags\n self.save\n tags = self.scan_tags\n tags.each do |tag|\n if Tag.exists?(name: tag) # The argument in the parenthesis is to: search the \"content\" column for a the \"tag\" record and checks if it exists\n tag_id = Tag.find_by(name: tag).id # if it exists, extract its ID and assign it to a variable called \"tag_id\"\n self.tweet_tags.create(tag_id: tag_id) # then go to the tweet_tags(associated with the tweet) and go to the \"tag_id\" column and create a record(which is this variable \"tag_id\")\n else\n self.tags.create(name: tag) # tag here refers to \"#<tag>\"(words) as written in the tweet itself. NOT the ID(integer) of the tag.\n end\n end\n return self # return the tweet so we can continue do things with the tweet itself.\n end", "def extract_tags\n extract_hashtags(content) do |tag|\n extracted_tag = Tag.find_or_create_by(name: tag.downcase)\n self.tags << extracted_tag unless tags.include? extracted_tag\n end\n end", "def create\n @battle = Battle.new\n @battle.user = current_user\n\n params[:battle][:hashtags_attributes].each do |i, hashtag|\n next if hashtag[:name].blank?\n @battle.hashtags << Hashtag.find_or_create_by(name: hashtag[:name])\n end\n\n # At least 2 valid hashtags - maximum 5\n if @battle.save\n redirect_to @battle\n else\n render new_battle_path(@battle), alert: @battle.errors\n end\n end", "def assign_tags(tag_titles)\n update_counters_before\n tags = tag_titles.split(\",\").strip\n tags.each do |t|\n post_tag = self.post_type.post_tags.where(name: t).first_or_create!\n self.term_relationships.where({term_taxonomy_id: post_tag.id}).first_or_create!\n end\n update_counters(\"tags\")\n end", "def create\n # You have to use Tweet.create instead of Tweet.new because you need @tweet to create the id to be able to use it wehn we connect the associaiton between tags and tweet through Tweet_tag. The association can be formed without an id from @tweet \n @tweet = Tweet.create(tweet_params)\n # We make a new array to hold each word of our tweet\n message_arr = Array.new \n message_arr = @tweet.message.split \n\n #This will parse through the indiviual words in that tweet \n message_arr.each_with_index do |word,index|\n #If the first letter is a hashtag in the word \n #We will either add it in our Tag model, or if it wasn't created yet we create a new instance of it \n if word[0] == \"#\"\n #Pluck is a method that returns an array of attributes that matches the column's name \n #With that being said we are looking if that array includes the word \n #If it does then there is already a record of it in our database if not we will add it in \n if Tag.pluck(:phrase).include?(word)\n tag = Tag.find_by(phrase: word)\n else \n tag = Tag.create(phrase: word)\n end\n # So after we create a new instance of Tag or found it in the database we can use both tag and @tweet to set up the association by passing it into TweetTag \n tweet_tag = TweetTag.create(tweet_id: @tweet.id, tag_id: tag.id)\n #message_arr[index] will return the word that includes the #hashtag, then we will change that #hashtag word into a link\n message_arr[index] = \"<a href='/tag_tweets?id=#{tag.id}'>#{word}</a>\"\n end\n end\n #After We are do with parsing through the tweet and checking if there is a #hashtag or not we then join the tweet back together because it was split and assign \n @tweet.update(message: message_arr.join(\" \"))\n\n\n # get_tag(@tweet)\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to @tweet, notice: 'Tweet was successfully created.' }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_tags(tags)\n tags.each do |tag_name|\n self.tags.create!(name: tag_name.downcase) unless self.tags.find_by(name: tag_name.downcase)\n end\n end", "def relation_save_hash_tags(text)\n return if !text || text == nil || text.length = 0\n text.scan(/#[a-zA-Z]+/i).each do |tag|\n relation_add(Note::RELATION_TAG,tag[1..-1])\n end\n end", "def create_commits\n present_commits = user.repositories.find_by(name: repository_name).commits.pluck(:sha)\n commits_details = []\n commits.each do |commit|\n commits_details << get_commit_hash(commit) unless present_commits.include?(commit['sha'])\n end\n Commit.bulk_insert values: commits_details\n end", "def note_relateds(hashes)\n hashes.each do |hash|\n if !related_hashtags.include?(hash) && self != hash\n r = relateds.create(:related_id => hash.id, :intersection => 1)\n elsif related_hashtags.include?(hash) && self != hash\n r = relateds.where(:related_id => hash.id).first\n r.intersection += 1\n r.save\n end\n end\n end", "def create\n\t\tif session[:user]\n\t\t\t@userhashtag = Userhashtag.new()\n\t\t\[email protected]_id = session[:user].id\n\n\t\t\t#Strip the '#' if the user put it\n\t\t\thashtag_name = params[:userhashtag][:name]\n\t\t\tif hashtag_name[0] == '#'\n\t\t\t\thashtag_name[0] = ''\n\t\t\tend\n\n\t\t\t#Get the hashtag ID from the name, create if doesn't exist\n\t\t\t@hashtag = Hashtag.find(:first, conditions:[\"name = ?\",hashtag_name])\n\t\t\tif (!@hashtag)\n\t\t\t\th = Hashtag.new()\n\t\t\t\th.name = params[:userhashtag][:name]\n\t\t\t\th.save\n\t\t\t\t#Now get the hashtag\n\t\t\t\t@hashtag = Hashtag.find(:first, conditions:[\"name = ?\",hashtag_name])\n\t\t\tend\n\n\t\t\[email protected]_id = @hashtag.id\n\t\t\[email protected]\n\n\t\t\t#Set the name of the new element\n\t\t\[email protected] = params[:userhashtag][:name]\n\t\t\t@userhashtag[\"name\"] = params[:userhashtag][:name]\n\n\t\t\trender json: @userhashtag, status: :created\n\n\t\t\t#render json: @post, status: :created\n\t\t\t#redirect_to :back\n\t\tend\n\tend", "def tag_names=(tag_names)\n tag_names.gsub('#', '').split(',').map(&:strip).uniq.each do |tag_name|\n tags << Tag.find_or_create_by(name: tag_name)\n end\n end", "def get_hashtags(tweet)\n list = []\n tweet.hashtags.each { |hashtag| list << hashtag.text.downcase } if tweet.hashtags?\n list\n end", "def favorite_hashtags\n favorite_stuffs(:hashtags, :text, 3)\n end", "def add_tags(names)\n\t\t self.tags = names.split(\",\").map do |name|\n \t\tUser.find_by(:id => user.id).tags.where(name: name.strip).first_or_create!\n \tend\n\tend", "def hashtag_mentions\n return {} if self.collection_yaml.nil?\n return self[:hashtag_mentions] unless self[:hashtag_mentions].nil?\n\n # Obtain all hashtag mention entities from all eligible status updates\n mentions = status_updates.map do |status_update|\n status_update['entities']['hashtags']\n end\n \n # Count all hashtag references in all entity entries\n self[:hashtag_mentions] = Hash.new { 0 }\n mention_counter = mentions.each do |mention|\n mention.each do |hashtag|\n self[:hashtag_mentions][\"\\##{hashtag['text']}\"] += 1\n end\n end\n self.save!\n\n self[:hashtag_mentions]\n end", "def create_tags\n\tend", "def index\n @message_hashtags = MessageHashtag.all\n end", "def get_hash_tags\n self.text.gsub(/#(([a-z_\\-]+[0-9_\\-]*[a-z0-9_\\-]+)|([0-9_\\-]+[a-z_\\-]+[a-z0-9_\\-]+))/).to_a\n #self.text.gsub(/#(\\w+)/).to_a\n end", "def get_hashtags(post)\n post.scan(/[\\A\\#|\\s\\#]\\w*/).join(\"\").scan(/\\w+/)\nend", "def persist_tags!(tag_names)\n tag_names.each do |name|\n Tag.where(name: name).first_or_create!.increment!(:count)\n end\n end", "def make_tags\r\n Post.all.each do |post|\r\n 10.times do\r\n name = Faker::Lorem.word\r\n post.tags.create!(name: name)\r\n end\r\n end\r\nend", "def after_save\n save_tags\n end", "def save_tags(tag_names)\n TaskToTag.where(task: self).destroy_all\n tags_arr = tag_names.split(',')\n ActiveRecord::Base.transaction do\n tags_arr.each do |tag_name|\n ProjectTag.create_and_associate_task(tag_name, self)\n end\n end\n end", "def new\n @battle = Battle.new \n @battle.user = current_user\n\n 2.times { @battle.hashtags.build }\n end", "def get_hashtags2(post)\n post.split.grep(/^#+(\\w+)$/) { $1 }\nend", "def add_commit_to_db(hash)\n #insert hash values into proper attribute in commits table\n @con.exec_prepared('commitInsert', hash.values_at(*@@GIT_LOG_PROPERTIES))\n \n create_commit_filepath(hash[\"filepaths\"], hash[:commit_hash])\n create_commit_bug(hash[:bug], hash[:commit_hash]) if hash[:bug]!=nil\n end", "def sanitized_hashtags\n modified_tags = hashtag_params.map do |hashtag|\n hashtag.first != '#' ? hashtag.prepend('#') : hashtag\n end\n modified_tags\n end", "def hashtagify(sentence, tags)\n\nend", "def auto_link_hashtags(text, options = {}, &block) # :yields: hashtag_text\n auto_link_entities(text, Extractor.extract_hashtags_with_indices(text), options, &block)\n end", "def create\n @bookmark = Bookmark.new(bookmark_params)\n\n tags = bookmark_params[:tags].split(\",\")\n tags.each do |tag|\n if Tag.where(:tagname => tag.strip.gsub(' ', '-').downcase).size == 0\n @tag = Tag.new\n @tag.tagname = tag.strip.gsub(' ','-').downcase\n @bookmark.tags << @tag\n else\n @bookmark.tags << Tag.where(:tagname => tag.strip.gsub(' ', '-').downcase).first\n end\n end\n\n respond_to do |format|\n if @bookmark.save\n format.html { redirect_to @bookmark, notice: 'Bookmark was successfully created.' }\n format.json { render action: 'show', status: :created, location: @bookmark }\n else\n format.html { render action: 'new' }\n format.json { render json: @bookmark.errors, status: :unprocessable_entity }\n end\n end\n end", "def search_for_hashtags(text)\n tags = []\n text.gsub(/\\#([\\w_\\-\\.]+)/) do\n tags << $1\n end\n tags\n end", "def auto_tag!\n tags = self.body.scan(/(?<=#)\\S+/).map{ |ts| J::Tag.find_or_create_by(name: ts) }\n self.tags = tags\n end", "def assign_tags\n if self.text\n self.tag_s = self.text.scan(/\\s+\\#\\S+/).join(' ')\n save\n end\n true\n end", "def get_hashtags(post)\n post.scan(/(?:\\s|^)(?:#+(?!\\d+(?:\\s|$)))(\\w+)(?=\\s|$)/).flatten\nend", "def generate_hash\n @tags.group_by do |x|\n x[:name]\n x.delete(:name)\n end\n end", "def create_commits commits_array\n commits_array = [commits_array] if commits_array.is_a? Hash\n normalize_commit_data commits_array\n commits_array.each do |commit_data|\n create_commit add_default_commit_data(commit_data)\n end\nend", "def tags_string=(titles)\n self.tags = titles.split(',').map do |title|\n Tag.find_or_create_by(title: title, user: user)\n end\n end", "def save_new_tag_to_tag_table(tag_attributes)\n\n tag_attributes.split(\",\").each do |value|\n value=value.strip\n available_tag = Tag.where('tagname = ?', value).first #checking if added tag is available in the list/not.\n new_tag = Tag.create(:tagname => value) if available_tag.blank? #If it's a new tag then create and Add it to Tag list.\n available_tag.blank? ? self.insert_ids_to_post_tags(new_tag.id) : self.insert_ids_to_post_tags(available_tag.id) #Depending on tag available or it's a new tag, updating post_tags tag.\n end\n\n end", "def create\n @hash_tag = HashTag.new(hash_tag_params)\n\n respond_to do |format|\n if @hash_tag.save\n format.html { redirect_to @hash_tag, notice: 'Hash tag was successfully created.' }\n format.json { render :show, status: :created, location: @hash_tag }\n else\n format.html { render :new }\n format.json { render json: @hash_tag.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_article_tags\n 5.times do\n Tag.create(tag_text: Faker::Hipster.word, author_id: Author.pluck(:id).sample, taggable_type: \"Article\", taggable_id: Article.pluck(:id).sample)\n end\nend", "def initialize(hashtags = \"nsfail\")\n self.hashtags = hashtags\n end", "def hashtags\n result_hash['hashtag']\n end", "def test_tag_assignment\n assert_equal 2, @twitter_reporter.reports.create(:body => 'my #machine is #good').tags.size\n # assert_equal 7, @twitter_reporter.reports.create(:body => 'many #challenges here, #bad').score\n goodreport = @twitter_reporter.reports.create(:body => 'no problems #good overall, #wait12')\n goodreport.reload\n assert_equal 2, goodreport.tags.size\n epreport = @twitter_reporter.reports.create(:body => 'being #challenges here #EPOH l:cincinnati oh')\n epreport.reload\n assert_equal 2, epreport.tags.size\n # FIXM - figure out how to get EPXX back into the tag_list, all we have is the pattern here\n #assert epreport.tag_list.split(Tag::TAG_SEPARATOR).include?('EPOH'), \"has tag_list: #{epreport.tag_list}\"\n end", "def index\n @hash_tags = HashTag.all\n end", "def get_hash_tags(reload = false) \n @hash_tags = nil if reload\n @hash_tags ||= Dtag.find(:all, :conditions => [\"id IN (?)\", tag_ids]).inject({}) { |hash, tag| hash[tag.id] = tag; hash }\n end", "def set_tags(tags)\n self.tags = tags.map.each do |tag|\n Tag.find_or_create_by_name tag\n end\n end", "def add_tags\n \tunless tags_field.blank?\n\t\t\ttags = tags_field.split(\",\")\n\t\t\ttags.each do |tag|\n self.tags << Tag.find_or_initialize_by_name(tag.strip)\n\t\t\tend\n\t\tend\t\n end", "def tags_attributes=(tag_attributes)\n tag_attributes.values.each do |tag_name|\n tag_name.values.each do |tag|\n tag.split(\", \").each do |name|\n tag = Tag.find_or_create_by(name: name)\n tag.slug = tag.to_slug\n tag.save\n self.tags << tag\n end\n end\n end\n end", "def build_tweets # rubocop:disable Metrics/MethodLength\n tweet = Tweet.new(@link)\n @tags.each do |tag|\n begin\n tweet.add(tag)\n rescue Tweet::TagTooLong\n @tweets.push tweet\n raise StandardError if \"#{tag} | #{@link}\".length > 140\n tweet = Tweet.new(@link)\n end\n end\n @tweets.push tweet\n end", "def create_taggings_from_atom(atom)\n Tagging.transaction do \n taggings_from_atom(atom)\n end\n end", "def getHashtags( num_hashtags = nil )\n \n #get all hashtags\n hashtags = (@min_hash..@max_hash).to_a\n \n #limit if necessary\n if num_hashtags\n hashtags = hashtags.sample( num_hashtags )\n end\n \n #return\n hashtags\n \n end", "def reparse\n @parsable = nil\n \n if self.not_active?\n self.hashtagships.destroy_all\n self.assignments.destroy_all\n else\n old_hashtags = self.hashtags.collect { |h| h.title } || []\n old_assignees = self.assignees.collect { |a| a.login } || []\n \n new_hashtags = parse_content(/\\B#([a-z0-9_]+)/i)\n new_assignees = parse_content(/\\B@([a-z0-9._]+)/i)\n \n # Destroy obsolete\n (old_hashtags - new_hashtags).each do |t|\n hashtag = self.hashtags.find_by_title(t)\n self.hashtagships.find_by_hashtag_id(hashtag.id).destroy unless hashtag.nil?\n end\n \n (old_assignees - new_assignees).each do |a|\n assignee = self.assignees.find_by_login(a)\n self.assignments.find_by_assignee_id(assignee.id).destroy unless assignee.nil?\n end\n \n # Create new\n new_hashtags.each do |t|\n hashtag = self.project.hashtags.find_or_create_by_title(t)\n self.hashtags << hashtag unless self.hashtags.include?(hashtag)\n end\n \n (new_assignees - old_assignees).each do |a|\n assignee = self.project.participants.find_by_login(a)\n self.assignees << assignee unless assignee.nil? || self.assignees.include?(assignee)\n end\n end\n end", "def create_post values, fetched_tags\n unless (Post.first(:id => values[:id])) || (values[:tumblr_name] == ENV['tumblr_name'])\n post_db = Post.new\n post_db.id = values[:id]\n if tumblr = Tumblr.first(:url => values[:tumblr_url])\n if tumblr.name != values[:tumblr_name]\n tumblr.update(:name => values[:tumblr_name])\n end\n else\n tumblr = Tumblr.create(:name => values[:tumblr_name], :url => values[:tumblr_url])\n end\n post_db.tumblr = tumblr\n post_db.score = 0\n post_db.fetched = DateTime.now\n post_db.img_url = values[:img_url]\n post_db.height = values[:height]\n post_db.width = values[:width]\n unless values[:img_url]\n post_db.skip = true\n end\n post_db.save\n score = 0\n\n values[:tags].each do |t|\n if ta = fetched_tags[t] || Tag.first(:name => t)\n score += ta.value\n else\n ta = Tag.create(:name => t, :value => 0, :fetch => false, :value => 0)\n fetched_tags[t] = ta\n end\n post_db.add_tag ta\n end\n post_db.update({:score => score})\n post_db\n end\n end", "def publishHashtags\n twitterclient = Twitter::Streaming::Client.new(@opts);\n count = 0\n twitterclient.sample do |object|\n if count < @opts[:limit]\n if object.is_a?(Twitter::Tweet) && object.hashtags?\n hashtags = object.hashtags\n hashtags.each do |ht|\n count += 1\n text = ht.text\n if text.match(/^[\\x20-\\x7E]*$/)\n puts(\"TWEET HASHTAG: #{ht.text}\")\n @server.publish @opts[:channel], ht.text\n end\n end\n end\n else\n twitterclient.close\n puts count\n end\n end\n end", "def find_or_create(tag_names)\n transaction do\n found_tags = find(:all, :conditions => ['name IN (?)', tag_names])\n found_tags + (tag_names - found_tags.collect(&:name)).collect { |s| create!(:name => s) }\n end\n end", "def hashtagify(sentence, tags)\n # I assume punctuation will only be at the end of the sentence.\n # To deal with punctuation in the middle of the sentence, I could do\n # the same thing for each word that I'm doing for the whole sentence.\n ends_with_punc = false\n if '!?.,;'.include?(sentence[-1]) \n ends_with_punc = true\n punc = sentence[-1] # save the punc and then add it back in at end.\n sentence = sentence.slice(0, sentence.length-1)\n end\n words = sentence.split(' ')\n result = []\n words.each do |word|\n if tags.include?(word.downcase)\n result << \"#\" + word\n else\n result << word\n end\n end\n if ends_with_punc\n result.join(' ') + punc\n else\n result.join(' ')\n end\nend", "def create\n @post = Post.new(params[:post])\n\n if params['tag_field'] != nil\n tags_array = params['tag_field'].split(\",\")\n tags_array.each do |tag|\n @post.tags << Tag.find_or_create_by_etiqueta_and_post_id(tag.strip, @post.id)\n end\n end\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @hash_tag = HashTag.new(params[:hash_tag])\n\n respond_to do |format|\n if @hash_tag.save\n format.html { redirect_to(@hash_tag, :notice => 'Hash tag was successfully created.') }\n format.xml { render :xml => @hash_tag, :status => :created, :location => @hash_tag }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @hash_tag.errors, :status => :unprocessable_entity }\n end\n end\n end", "def find_or_create(tag_names)\n transaction do\n found_tags = find :all, :conditions => ['name IN (?)', tag_names]\n found_tags + (tag_names - found_tags.collect(&:name)).collect { |s| create!(:name => s) }\n end\n end", "def all_tags=(names)\n self.tags = names.split(\",\").map do |name|\n Tag.where(name: name.strip).first_or_create!\n end\n end", "def create_tag_sets\n FactoryGirl.create(:tag, name: 'e0_out_of_business')\n FactoryGirl.create(:tag, name: 'e1_existence_doubtful')\n FactoryGirl.create(:tag, name: 'e2_existence_unknown')\n FactoryGirl.create(:tag, name: 'e3_existence_confirmed')\n\n FactoryGirl.create(:tag, name: 'n1_no_contact')\n FactoryGirl.create(:tag, name: 'n5_signed_only')\n FactoryGirl.create(:tag, name: 'n6_signedAndNDAd')\n\n FactoryGirl.create(:tag, name: 'b0_none_sent')\n\n FactoryGirl.create(:tag, name: 'datadump')\nend", "def all_tags=(names)\n self.tags = names.split(\",\").map do |name|\n name.gsub!(/[!@%&\"']/,'')\n name.downcase!\n Tag.where(name: name.strip).first_or_create!\n end\n end", "def create\n # params[:tag_id].split(\",\").each do |p|\n @tag = Tag.new(title:params[:title])\n @tag.save\n#end\n @meetup = Meetup.new(meetup_params)\n @meetup.save\n params[:tag_id].split(\",\").each do |p|\n @tagmeetup = Tagmeetup.new(tag_id:p,meetup_id:@meetup.id);\n @tagmeetup.save\n end\n respond_to do |format|\n if @meetup.save\n format.html { redirect_to @meetup, notice: 'Meetup was successfully created.' }\n format.json { render :show, status: :created, location: @meetup }\n else\n format.html { render :new }\n format.json { render json: @meetup.errors, status: :unprocessable_entity }\n end\n end\n end", "def save_tweets_for(term)\n @client.search(term).each do |tweet|\n @tweets_found += 1\n tweet_doc = tweet.to_h\n tweet_doc[:tags] = term\n tweet_doc[:_id] = tweet_doc[:id]\n @tweets.insert_one(tweet_doc)\n end\n end", "def tag_names=(tag_names)\n self.tags = tag_names.map do |tag_name|\n tag_name.strip!\n self.tags.find_or_create_by(name: tag_name)\n end\n end", "def generate_tags\n tag_data = self.analyze_and_return_labels_with_score\n tag_data.each do |description, score|\n tag = Tag.find_or_create_by(description: description)\n self.image_tags.create(score: score, description: description, tag: tag)\n end\n end", "def perform\n histories << SearchTermHistory.create\n touch # updated_at does not update automatically...\n end", "def save_tweet(tweet)\n if self.save_tweet?(tweet)\n author = @parser.get_author(tweet)\n if Tweet.where(twitter_id: tweet.id).blank?\n t = author.tweets.create(\n text: tweet.text,\n retweets: tweet.retweet_count,\n twitter_id: tweet.id\n )\n t.set_webpages(@parser.get_webpages(tweet)) unless @parser.get_webpages(tweet).nil?\n t.set_hashtags(@parser.get_hashtags(tweet)) unless @parser.get_hashtags(tweet).nil?\n generate_hashtag_hashtag(t.get_hashtags)\n generate_author_hashtag(t.get_author, t.get_hashtags)\n end\n end\n end", "def tag_list=(names)\n tag_names = names.split(\",\").map! {|tag| tag.downcase.strip.gsub(/[^\\w]/,'_') }\n tags_array = []\n tag_names.each do |name|\n tags_array << Tag.where(name: name).first_or_create\n end\n self.tags = tags_array\n end", "def save_tags\n Tag.transaction do\n taggings.delete_all\n\n scope = nil\n scope = send(self.class.taggable_options[:scope]) if self.class.taggable_options[:scope]\n\n parsed_tags(tagged_with).each do |tag_name|\n tag = Tag.find_or_create_by_name(tag_name)\n self.taggings.create(:tag => tag, :scope => scope)\n end\n end\n end", "def update_or_create_tags\n return true if @inner_tags.nil? || !@save_tags\n words = []\n @inner_tags.each do |t|\n raise ActiveRecord::Rollback if t.new_record? && !t.save\n words << t.id\n tagging = Tagging.where(:taggable_id => self.id, :taggable_type => 'MediaElement', :tag_id => t.id).first\n if tagging.nil?\n tagging = Tagging.new\n tagging.taggable_id = self.id\n tagging.taggable_type = 'MediaElement'\n tagging.tag_id = t.id\n raise ActiveRecord::Rollback if !tagging.save\n end\n end\n Tagging.where(:taggable_type => 'MediaElement', :taggable_id => self.id).each do |t|\n t.destroy if !words.include?(t.tag_id)\n end\n end", "def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n\n new_tags = params[:tags].split(',')\n\n new_tags.each do |stag|\n @event.tags.create(tag: stag)\n end\n\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def search_hashtag tag\r\n response = RestClient.get 'https://api.twitter.com/1.1/search/tweets.json', params: {q: tag, count: 100}, Authorization: 'Bearer AAAAAAAAAAAAAAAAAAAAAJr1YQAAAAAAHA%2FAKcuAEPhPSJgFqwcwKMU0wPk%3DwHtz3CIM3eluP3XQDNfXobhvApEBTpyYeWrJ31ZxUukMm1idUj'\r\n \r\n tweets = Array.new\r\n JSON.parse(response)['statuses'].each do |t|\r\n hashtags = Array.new\r\n t[\"entities\"][\"hashtags\"].each do |h|\r\n hashtags << (\"#\" + h[\"text\"].downcase)\r\n end\r\n tweet={\r\n \"id\" => t[\"id\"],\r\n \"text\" => t['text'],\r\n \"hashtags\" => hashtags\r\n }\r\n tweets << tweet\r\n end\r\n tweets\r\n end", "def add_to_db(name, username, user_location, artist_name, song_name)\n\tTwitterCrawl.create do |twitter|\n\t\ttwitter.name = @name\n\t\ttwitter.username = @username\n\t\ttwitter.user_location = @user_location\n\t\ttwitter.artist = {'name' => @artist_name}\n \ttwitter.track = {'title' => @song_name}\n end\nend", "def create\n @shout = Shout.new(params[:shout])\n\n# params[:tags].split(\" \").each do |tag_word|\n# \t @shout.tags.build(:tag_word => tag_word)\n# \tend\n\t\n respond_to do |format|\n if @shout.save\n format.html { redirect_to @shout, notice: 'Shout was successfully created.' }\n format.json { render json: @shout, status: :created, location: @shout }\n else\n format.html { render action: \"new\" }\n format.json { render json: @shout.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_subscriptions\n Subscription.create_subscriptions(self.id, self.hashtag)\n end", "def all_tags=(names)\n\t self.tags = names.split(\",\").map do |name|\n\t Tag.where(name: name.strip).first_or_create!\n\t end\n\tend", "def create\n #\"tags_attributes\"=>{\"0\"=>{\"title\"=>\"qwerty},\"1\"=>{\"title\"=>\"toma},cholo,lechon\"}}\n\n Rails.logger.info \"BEFORE XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\"\n\n Rails.logger.info haircut_params\n\n Rails.logger.info \"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\"\n\n #tags = haircut_params['tags_attributes'][\"0\"][\"title\"].split(\",\")\n #i = 0\n #tag_replacement = \"\"\n #tags.each do |tag|\n # tag_replacement[i.to_s] = tag\n # i+=1\n #end\n #haircut_params['tags_attributes'] = tag_replacement.to_s\n tags = params[:tag_title].split(\",\")\n\n @haircut = Haircut.new(haircut_params)\n\n Rails.logger.info \"AFTER XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\"\n\n Rails.logger.info haircut_params\n\n Rails.logger.info \"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\"\n respond_to do |format|\n if @haircut.save\n if tags.length > 0\n tags.each do |title|\n if (tag = Tag.where(:title => title).first) == nil\n tag = Tag.create(:title => title)\n end\n HaircutTag.create(:tag_id => tag.id, :haircut_id => @haircut.id)\n end\n end\n format.html { redirect_to @haircut, notice: 'Haircut was successfully created.' }\n format.json { render action: 'show', status: :created, location: @haircut }\n else\n format.html { render action: 'new' }\n format.json { render json: @haircut.errors, status: :unprocessable_entity }\n end\n end\n end", "def find_hash_tags\n self.scan(/#[\\w-]+/).flatten.uniq\n end", "def create\n @post = Post.new\n @post.title = params[:title]\n @post.body = params[:body]\n @post.user = current_user if current_user\n @tags = params[:tags].split(',') unless params[:tags].blank?\n\n respond_to do |format|\n\n Post.transaction do\n if @post.save\n create_tags(@post, @tags)\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "def all_tags=(names)\n self.tags = names.split(\",\").map do |name|\n Tag.where(name: name.strip).first_or_create!\n end\n end", "def all_tags=(names)\n self.tags = names.split(\",\").map do |name|\n Tag.where(name: name.strip).first_or_create!\n end\n end", "def all_tags=(names)\n self.tags = names.split(\",\").map do |name|\n Tag.where(name: name.strip).first_or_create!\n end\n end", "def tweet (user_id)\n \n #generate a new tweet\n body = \"This is a new tweet being written to the DB!\"\n \n IBM_DB.exec(@conn, \"INSERT INTO tweets(tweet, user_id) VALUES( '#{body.gsub(/'/,'')}', #{user_id} );\")\n new_id = getSimpleValue(@conn, \"SELECT IDENTITY_VAL_LOCAL() FROM users\").to_i\n \n #insert 0-2 hashtags per tweet\n rand(2).times do\n new_tag = rand(@max_hash - @min_hash + 1) + @min_hash\n IBM_DB.exec(@conn, \"INSERT INTO hashtags_tweets(tweet_id, hashtag_id) VALUES ( #{ new_id }, #{ new_tag })\")\n end\n \n debug \"wrote new tweet for user: \" + user_id.to_s\n end", "def related_hashtag_cloud\n cloud = get_related_hashtags\n #Get rid of the ones that only intersect once.\n cloud.delete_if{|tag| tag[1] == 1}\n cloud = cloud.reverse.drop(cloud.count - 30).reverse if cloud.count > 30\n cloud\n end", "def create_tag_pages\n tag_set(items).each do |tag|\n @items.create(\n \"= render('_tag_page', :tag => '#{tag}')\", # use locals to pass data\n { :title => \"Category: #{tag}\", :is_hidden => true}, # do not include in sitemap.xml\n \"/tags/#{tag}/\", # identifier\n :binary => false\n )\n end\nend", "def set_hash_tag\n @hash_tag = HashTag.find(params[:id])\n end", "def tag_books(tag, books)\n puts \"Tagging #{books.length} books as #{tag}\"\n books.each do |b|\n unless Tag.exists?(book_id: b.id, name: tag)\n Tag.create(book_id: b.id, name: tag)\n end\n end\n puts \"Done tagging #{tag}\"\nend", "def hashtagify(sentence, words)\r\n\r\nend", "def import_hash hashtree\r\n\t\tLogger.send(\"warn\",\"Start CSV(hash) import\")\r\n\t\t@result[:description] << \"Start CSV(hash) import\"\r\n\t\thashtree.each { |b|\r\n\t\t\timport_bien b.split(\"!#\")\r\n\t\t}\r\n\r\n\t\tLogger.send(\"warn\",\"End CSV import\")\r\n\t\t@result[:description] << \"End CSV import\"\r\n\t\treturn true\r\n\tend", "def import_hash hashtree\r\n\t\tLogger.send(\"warn\",\"Start CSV(hash) import\")\r\n\t\t@result[:description] << \"Start CSV(hash) import\"\r\n\t\thashtree.each { |b|\r\n\t\t\timport_bien b.split(\"!#\")\r\n\t\t}\r\n\r\n\t\tLogger.send(\"warn\",\"End CSV import\")\r\n\t\t@result[:description] << \"End CSV import\"\r\n\t\treturn true\r\n\tend", "def hashtagify(sentence, tags)\n temp = sentence.split\n\n temp.map! do |word|\n \tif tags.any? { |tag| word.downcase.include?(tag) }\n \"#\" + word\n else\n word\n end\n end\n\n temp.join(\" \")\nend", "def create_tag(recipe_id, tags)\n\t\t\t\tdestroy_tags = RecipeTag.where(recipe_id: recipe_id)\n\t\t\t\tif !destroy_tags.blank? \n\t\t\t\t\tdestroy_tags.delete_all\n\t\t\t\tend\n\t\t\t\ttags.each do |recipe_tag|\n\t\t\t\t\ttag = RecipeTag.new\n\t\t\t\t\ttag.recipe_id = recipe_id\n\t\t\t\t\ttag.tag = recipe_tag\n\t\t\t\t\ttag.save!\n\t\t\t\tend\n\t\t\tend", "def all_tags=(names)\n self.tags = names.split(\",\").map do |tag|\n Tag.where(name: tag.strip.capitalize).first_or_create!\n end\n end", "def get_name_hash_tags\n description.to_s.scan(/#\\w+/).map{|name| name.gsub('#', '') }\n end", "def create!\n set_id = generate_set_id\n\n @volume_ids.each do |id|\n snapshot = @fog.snapshots.new\n\n snapshot.description = \"#{@hostname.split(\".\")[0]} #{@mount} (#{self.needed_types.join(\", \")}) (#{set_id})\"\n snapshot.volume_id = id\n\n # Actually do the snapshot\n snapshot.save\n\n # Reload to get snapshot.id so we can add tags\n snapshot.reload\n\n @fog.tags.create(:resource_id => snapshot.id, :key => \"Host\", :value => @hostname)\n @fog.tags.create(:resource_id => snapshot.id, :key => \"Mount\", :value => @mount)\n @fog.tags.create(:resource_id => snapshot.id, :key => \"SetID\", :value => set_id)\n @fog.tags.create(:resource_id => snapshot.id, :key => \"Type\", :value => self.needed_types.join(\",\"))\n end\n end" ]
[ "0.7510807", "0.71801835", "0.6715844", "0.66586167", "0.6565296", "0.6375183", "0.62083095", "0.60688454", "0.59807956", "0.5976545", "0.59640515", "0.59308684", "0.57908475", "0.5771271", "0.57668513", "0.5763289", "0.576197", "0.5731258", "0.5686651", "0.5680399", "0.5676846", "0.56540275", "0.5649436", "0.56398314", "0.56275845", "0.5621237", "0.55832064", "0.5567388", "0.5550639", "0.5533132", "0.55180407", "0.5517718", "0.55090904", "0.5491683", "0.5490804", "0.54704666", "0.5461744", "0.5454592", "0.541951", "0.5410259", "0.5400413", "0.54001665", "0.539146", "0.53884256", "0.53740156", "0.5368045", "0.53434175", "0.53361034", "0.532928", "0.5305047", "0.5295771", "0.52955544", "0.5295521", "0.5266985", "0.52652556", "0.5247977", "0.5240689", "0.52367616", "0.5234078", "0.5229503", "0.5214709", "0.52111614", "0.5208972", "0.5206438", "0.5204419", "0.5187329", "0.51793474", "0.51735544", "0.5168039", "0.51656747", "0.51651293", "0.51542073", "0.5133729", "0.51126003", "0.5108426", "0.5108095", "0.5105", "0.50938815", "0.5092586", "0.5090944", "0.50866836", "0.5085691", "0.5077903", "0.50673115", "0.50626546", "0.50626546", "0.50626546", "0.50625306", "0.5047135", "0.50460297", "0.5044497", "0.503348", "0.5032421", "0.50316167", "0.50316167", "0.503102", "0.5029147", "0.5026379", "0.50202566", "0.50194806" ]
0.5915009
12
GET /pages GET /pages.json
def index @pages = Page.includes(:user) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @pages = Page.page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n @pages = current_site.pages\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n @pages = Page.all\n render json: @pages\n end", "def index\n\t\t@pages = Page.order('created_at DESC').all\n\n\t\trespond_to do |format|\n\t\t\tformat.html #index.html.erb\n\t\t\tformat.json { render json: @pages }\n\t\tend\n\tend", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def pages\n get(\"v1/event/#{@id}/pages\")\n end", "def index\n @pages = Page.all\n \n respond_to do |format|\n format.json { render :json => @pages }\n format.xml { render :xml => @pages }\n end\n end", "def get_pages(options = nil)\n @client.raw('get', '/content/pages', options)\n end", "def pages\n get(\"v1/account/#{@email}/pages\")\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.json { render json: @pages }\n format.xml { render xml: @pages }\n end\n end", "def index\n @pages = Page.paginate(page: params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: Page.roots.map{|r| r.node}}\n end\n end", "def index\n @sites = current_user.sites.page(params[\"page\"])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sites }\n end\n end", "def index\n @pages = Page.all\n\n respond_with @pages\n end", "def get_page\n render_page_sections_json\n end", "def index\n @about_pages = AboutPage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @about_pages }\n end\n end", "def index\n @pages = Page.all\n respond_with(@pages)\n end", "def index\n @pages = Page.all\n respond_with(@pages)\n end", "def index\n #Page.all is fine for small sets of data, for larger sets pagination would be best\n @pages = data_cache('pages', 10.minutes) do\n Page.all\n end\n respond_to do |format|\n format.json { render action: 'index', status: :ok, location: api_pages_url(@pages) }\n format.xml { render xml: @pages, location: api_pages_url(@pages) }\n end\n end", "def index\n @urls = @site.urls.paginate(:page => params[:page])\n render json: @urls\n end", "def index\n @pages = Page.all\n respond_with(@pages)\n end", "def show\n render json: @page\n end", "def index\n respond_with(pages)\n end", "def index\n @static_pages = StaticPage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @static_pages }\n end\n end", "def index\n @static_pages = StaticPage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @static_pages }\n end\n end", "def index\n @pages = Page.all\n\n respond_to do |format| \n format.json {render json: @pages}\n format.xml {render xml: @pages}\n end\n\n end", "def index\n @users = User.page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end", "def pages()\n get('subAccountPages')\n end", "def index\n @sites = Site.paginate(:page=>params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sites }\n end\n end", "def index\n @pages = @user.pages\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pages }\n end\n end", "def index\n @ideas = current_user.ideas.page(params[\"page\"])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ideas }\n end\n end", "def index\n @book_pages = @book.book_pages\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @book_pages }\n end\n end", "def index\n @links = Link.paginate(page: params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @links }\n end\n end", "def show\n @page = Page.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @page }\n end\n end", "def show\n @page = Page.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @page }\n end\n end", "def show\n @page = Page.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @page }\n end\n end", "def show\n @page = Page.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @page }\n end\n end", "def show\n @page = Page.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @page }\n end\n end", "def show\n @page = Page.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @page }\n end\n end", "def show\n @page = Page.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @page }\n end\n end", "def index\n\n # find all pages\n @pages = Page.all\n\n # send data in different format\n respond_to do |format|\n format.html{render :template => 'mcms_pages/admin/pages/index'}# index.html.erb\n format.json { render json: @pages }\n end # end respond_to\n\n end", "def index\n @roles = Role.page params[:page]\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @roles}\n end\n end", "def index\n @courts = Court.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courts }\n end\n end", "def index\n @enq_pages = EnqPage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @enq_pages }\n end\n end", "def index\n @concept_maps = ConceptMap.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json:@concept_maps }\n end\n end", "def index\n respond_with(@pages = Page.all.paginate(:page => params[:page] || 1, :per_page => params[:per_page] || 5))\n end", "def index\n @instances = Instance.page params[:page]\n authorize! :read, @instances\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @instances }\n end\n end", "def index\n @pages = Page.all\n end", "def index\n @pages = Page.all\n end", "def index\n @pages = Page.all\n end", "def index\n @pages = Page.all\n end", "def index\n @pages = Page.all\n end", "def index\n @pages = Page.all\n end", "def index\n @pages = Page.all\n end", "def index\n @pages = Page.all\n end", "def index\n @pages = Page.all\n end", "def index\n @pages = Page.all\n end", "def index\n page_num=params[:page]\n @users= User.page(page_num)\n render json: @users\n end", "def index\n @pages = Page.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @page }\n end\n end", "def pages\n end", "def show\n @Page = Page.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @Page }\n end\n end", "def index\n @pages = Page.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pages }\n end\n end", "def index\n @pages = Page.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pages }\n end\n end", "def index\n @users = User.all.page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pages }\n end\n end", "def children\n @pages = @page.children\n \n respond_to do |format|\n format.json { render :json => @pages }\n format.xml { render :xml => @pages }\n end\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.html {render :layout => \"layout_1\"}\n format.json { render json: @pages }\n end\n end", "def index\n page = params[:page] || 1\n\n @global_jsons = CfTemplate.global\n\n respond_to do |format|\n format.json { @global_jsons = @global_jsons }\n format.html { @global_jsons = @global_jsons.page(page) }\n end\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pages }\n end\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pages }\n end\n end", "def index\n @page_objects = PageObject.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @page_objects }\n format.tson { render :json => @page_objects }\n end\n end", "def index\n @pages = current_cms.pages.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pages }\n end\n end", "def index\n @pages = Page.all\n end", "def published\n @pages = Page.published\n\n respond_to do |format|\n format.json {render json: @pages}\n format.xml {render xml: @pages}\n end\n end", "def pages\n @pages \n end", "def index\n @aboutshetuans = Aboutshetuan.order(\"created_at desc\").page params[:page]\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @aboutshetuans }\n end\n end", "def index\n respond_to do |format|\n format.html\n format.json do\n collections = Collection.where.not(published_at: nil)\n .order(published_at: :desc)\n .page(params[:page])\n .per(Collection::COLLECTION_PER)\n is_more_load = collections.total_pages > params[:page].to_i\n render json: { collections: collections, is_more_load: is_more_load }\n end\n end\n end", "def pages\n @pages ||= get_pages\n end", "def pages\n @pages\n end", "def get_page(id)\n @client.raw('get', \"/content/pages/#{id}\")\n end", "def pages\n project_size = Project.all.length\n\n puts project_size\n\n respond_to do |format|\n format.json {\n @pages = (project_size/10.0).ceil\n render :json => @pages \n }\n end\n end", "def new\n @page = current_site.pages.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end", "def pages(taxon_id, query_options = {})\n handle_response self.class.get(\"/pages/1.0/#{taxon_id}.json\", :query => query_options)\n end", "def index\n @pages = @offering.pages.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pages }\n end\n end", "def pages\n @pages\n end", "def index\n @teams = Team.page(params[:page])\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end", "def index\n#\t\t@pages = Page.find(:all)\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.xml\t{ render :xml => @pages }\n\t\tend\n\tend", "def get_pages(name, opts = {})\n @api_client.request_token_if_needed\n data, _status_code, _headers = get_pages_with_http_info(name, opts)\n rescue ApiError => error\n if error.code == 401\n @api_client.request_token_if_needed\n data, _status_code, _headers = get_pages_with_http_info(name, opts)\n else\n raise\n end\n return data\n end", "def index\n @page = Page.find(params[:page_id])\n @revisions = @page.revisions\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @revisions }\n end\n end", "def index\n page = params[:page] || 1\n\n @users = User.all.page(page)\n respond_to do |format|\n format.json\n format.html\n end\n end", "def get_page_data(json_file)\n pages = {}\n pages[\"page_count\"] = json_file[\"pagination\"][\"page_count\"]\n pages[\"page_number\"] = json_file[\"pagination\"][\"page_number\"]\n return pages\n end", "def show\n @pages_article = PagesArticle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pages_article }\n end\n end", "def index\n @pages = @comic.pages\n \n respond_to do |format|\n format.html\n format.xml\n end\n end", "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page, :only => [:title, :content] }\n end\n end", "def index\n @http_backends = Http::Backend.scoped\n\n respond_to do |format|\n format.html { @http_backends = @http_backends.page(params[:page]) }\n format.json { render json: @http_backends }\n end\n end" ]
[ "0.80336875", "0.78896105", "0.7849311", "0.7684534", "0.7683288", "0.7683288", "0.7683288", "0.7683288", "0.7683288", "0.7683288", "0.7683288", "0.75573516", "0.75080585", "0.7400755", "0.7392056", "0.73434967", "0.73199916", "0.72880936", "0.7158694", "0.7145756", "0.712009", "0.70882004", "0.70791376", "0.70791376", "0.7065491", "0.70540047", "0.7033597", "0.6995546", "0.69684905", "0.6962466", "0.6962466", "0.68572277", "0.6791214", "0.6785715", "0.6781545", "0.67549074", "0.6729467", "0.6716968", "0.6704133", "0.6672641", "0.6672641", "0.6672641", "0.6672641", "0.6672641", "0.6672641", "0.6672641", "0.666305", "0.66628194", "0.66270036", "0.66087466", "0.660871", "0.65968126", "0.65885097", "0.658532", "0.658532", "0.658532", "0.658532", "0.658532", "0.658532", "0.658532", "0.658532", "0.658532", "0.658532", "0.65722823", "0.65476656", "0.65440834", "0.65431184", "0.6512498", "0.6512498", "0.6500977", "0.6499622", "0.64995265", "0.64986336", "0.6479299", "0.64772356", "0.64772356", "0.64744115", "0.6472949", "0.64645237", "0.64565647", "0.64550483", "0.64529717", "0.64503324", "0.6449729", "0.64477754", "0.6446191", "0.6445456", "0.64451116", "0.6429022", "0.6427724", "0.64270055", "0.6424232", "0.6412444", "0.6411204", "0.64091027", "0.6406962", "0.6403604", "0.6395386", "0.6386725", "0.6369631", "0.63521487" ]
0.0
-1
GET /pages/1 GET /pages/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @pages = Page.page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n @pages = current_site.pages\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n @pages = Page.all\n render json: @pages\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n\t\t@pages = Page.order('created_at DESC').all\n\n\t\trespond_to do |format|\n\t\t\tformat.html #index.html.erb\n\t\t\tformat.json { render json: @pages }\n\t\tend\n\tend", "def show\n render json: @page\n end", "def get_page\n render_page_sections_json\n end", "def show\n @page = Page.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @page }\n end\n end", "def show\n @page = Page.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @page }\n end\n end", "def show\n @page = Page.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @page }\n end\n end", "def show\n @page = Page.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @page }\n end\n end", "def show\n @page = Page.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @page }\n end\n end", "def show\n @page = Page.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @page }\n end\n end", "def show\n @page = Page.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @page }\n end\n end", "def index\n @pages = Page.all\n \n respond_to do |format|\n format.json { render :json => @pages }\n format.xml { render :xml => @pages }\n end\n end", "def get_page(id)\n @client.raw('get', \"/content/pages/#{id}\")\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.json { render json: @pages }\n format.xml { render xml: @pages }\n end\n end", "def pages\n get(\"v1/event/#{@id}/pages\")\n end", "def show\n @Page = Page.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @Page }\n end\n end", "def index\n @sites = current_user.sites.page(params[\"page\"])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sites }\n end\n end", "def index\n @pages = Page.paginate(page: params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: Page.roots.map{|r| r.node}}\n end\n end", "def index\n @about_pages = AboutPage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @about_pages }\n end\n end", "def show\n @page = @chapter.pages.find_by_number(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @page }\n end\n end", "def index\n @static_pages = StaticPage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @static_pages }\n end\n end", "def index\n @static_pages = StaticPage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @static_pages }\n end\n end", "def index\n @pages = Page.all\n\n respond_with @pages\n end", "def new\n @page = current_site.pages.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end", "def pages\n get(\"v1/account/#{@email}/pages\")\n end", "def show\n @page = Page.friendly.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @page }\n end\n end", "def get_pages(options = nil)\n @client.raw('get', '/content/pages', options)\n end", "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page, :only => [:title, :content] }\n end\n end", "def index\n @ideas = current_user.ideas.page(params[\"page\"])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ideas }\n end\n end", "def show\n @page = Page.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @page }\n format.xml { render xml: @page }\n end\n end", "def show\n @page = Page.find(params[:id])\n @version = @page.versions.last\n @author = User.all\n page = {\n :version => @version.changeset,\n :body => @page.body,\n :author => @author\n }\n respond_to do |format|\n format.html\n format.json { render json: page.to_json }\n end\n end", "def new\n\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end", "def index\n @pages = Page.all\n respond_with(@pages)\n end", "def index\n @pages = Page.all\n respond_with(@pages)\n end", "def index\n @urls = @site.urls.paginate(:page => params[:page])\n render json: @urls\n end", "def new\n @title = 'New Page'\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end", "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end", "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end", "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end", "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end", "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end", "def index\n #Page.all is fine for small sets of data, for larger sets pagination would be best\n @pages = data_cache('pages', 10.minutes) do\n Page.all\n end\n respond_to do |format|\n format.json { render action: 'index', status: :ok, location: api_pages_url(@pages) }\n format.xml { render xml: @pages, location: api_pages_url(@pages) }\n end\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.html {render :layout => \"layout_1\"}\n format.json { render json: @pages }\n end\n end", "def index\n @pages = Page.all\n respond_with(@pages)\n end", "def show\n @mypage = Mypage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mypage }\n end\n end", "def show\n @structure_page = Structure::Page.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @structure_page }\n end\n end", "def index\n @instances = Instance.page params[:page]\n authorize! :read, @instances\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @instances }\n end\n end", "def show\n @pages_article = PagesArticle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pages_article }\n end\n end", "def show\n @nested_page = Nested::Page.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nested_page }\n end\n end", "def index\n @sites = Site.paginate(:page=>params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sites }\n end\n end", "def index\n @pages = Page.all\n\n respond_to do |format| \n format.json {render json: @pages}\n format.xml {render xml: @pages}\n end\n\n end", "def show\n if admin?\n @page = Page.find_by_slug(params[:id]) \n else\n @page = Page.published.find_by_slug(params[:id]) \n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @page, :only => [:title, :content] }\n end\n end", "def index\n @book_pages = @book.book_pages\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @book_pages }\n end\n end", "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end", "def show\n #Page data isn't updated very frequently so a longer cache time is acceptable\n @page = data_cache(\"page-#{@page.id}\", 1.hour) do\n Page.find(params[:id])\n end\n respond_to do |format|\n format.json { render action: 'show', status: :ok, location: api_page_url(@page) }\n format.xml { render xml: @page, location: api_page_url(@page) }\n end\n end", "def new\r\n @page = Page.new\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @page }\r\n end\r\n end", "def show\n if params[:id]\n @page = current_site.pages.find(params[:id])\n else\n @page = current_site.pages.first()\n end\n @post = Post.new\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @page }\n end\n end", "def index\n @page = Page.find(params[:page_id])\n @revisions = @page.revisions\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @revisions }\n end\n end", "def index\n @concept_maps = ConceptMap.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json:@concept_maps }\n end\n end", "def index\n @links = Link.paginate(page: params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @links }\n end\n end", "def index\n respond_with(pages)\n end", "def show\n @about_page = AboutPage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @about_page }\n end\n end", "def new\n @Page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @Page }\n end\n end", "def index\n @roles = Role.page params[:page]\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @roles}\n end\n end", "def index\n @courts = Court.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courts }\n end\n end", "def page(id, params = {})\n get \"pages/#{id}\", {query: params}\n end", "def show\n @page_type = PageType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @page_type }\n end\n end", "def booking\n page = @site.pages.where(order: 2).first\n unless page\n head 404\n else\n render json: { content: Content.where(page_id: page.id, order: 0).first }\n end\n end", "def index\n @users = User.page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end", "def index\n @pages = Page.all\n end", "def index\n @pages = Page.all\n end", "def index\n @pages = Page.all\n end", "def index\n @pages = Page.all\n end", "def index\n @pages = Page.all\n end", "def index\n @pages = Page.all\n end", "def index\n @pages = Page.all\n end", "def index\n @pages = Page.all\n end", "def index\n @pages = Page.all\n end", "def index\n @pages = Page.all\n end", "def index\n @pages = Page.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @page }\n end\n end", "def page\n get_page\n nil\n end", "def view\n \t@parent = params[:parent]\n\n @pages = Page.where(\"digital_edition_id = ?\", @parent).order(\"page_page ASC\").page( params[:page]).per(20)\n\n respond_to do |format|\n format.html # view.html.erb\n format.json { render json: @page }\n end\n end", "def privacy\n @api_v1_pages = Api::V1::Page.where('title = \"privacy\"').first\n\n render json: @api_v1_pages\n end", "def index\n\n # find all pages\n @pages = Page.all\n\n # send data in different format\n respond_to do |format|\n format.html{render :template => 'mcms_pages/admin/pages/index'}# index.html.erb\n format.json { render json: @pages }\n end # end respond_to\n\n end", "def show\n @static_page = StaticPage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @static_page }\n end\n end", "def show\n @static_page = StaticPage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @static_page }\n end\n end", "def index\n @pages = @user.pages\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pages }\n end\n end", "def page\n obj\n end", "def index\n @enq_pages = EnqPage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @enq_pages }\n end\n end", "def index\n page = params[:page] || 1\n\n @global_jsons = CfTemplate.global\n\n respond_to do |format|\n format.json { @global_jsons = @global_jsons }\n format.html { @global_jsons = @global_jsons.page(page) }\n end\n end", "def show\n respond_to do |format|\n format.json { render :json => @page }\n format.xml { render :xml => @page }\n end\n end" ]
[ "0.77813053", "0.7577138", "0.7564708", "0.74609", "0.74609", "0.74609", "0.74609", "0.74609", "0.74609", "0.74609", "0.7314717", "0.71998656", "0.7184496", "0.7140601", "0.7108643", "0.7108643", "0.7108643", "0.7108643", "0.7108643", "0.7108643", "0.7108643", "0.71046406", "0.70414495", "0.70153075", "0.7004255", "0.6993428", "0.6978079", "0.69474053", "0.6861281", "0.68477815", "0.682564", "0.682564", "0.67363244", "0.67262745", "0.67169076", "0.670455", "0.66981393", "0.66869503", "0.66813636", "0.66760296", "0.6666863", "0.6665146", "0.6657971", "0.6657971", "0.6649946", "0.664576", "0.66409695", "0.66409695", "0.66409695", "0.66409695", "0.66409695", "0.66320026", "0.66010165", "0.6588172", "0.6587452", "0.65804654", "0.657549", "0.6574489", "0.6568804", "0.6566806", "0.6562834", "0.6556109", "0.6551286", "0.6538391", "0.65347713", "0.65347606", "0.6532865", "0.6519383", "0.65166223", "0.65158623", "0.65155584", "0.6513788", "0.65043193", "0.6477106", "0.6471065", "0.6469658", "0.64621264", "0.6459911", "0.64593613", "0.64566696", "0.64566696", "0.64566696", "0.64566696", "0.64566696", "0.64566696", "0.64566696", "0.64566696", "0.64566696", "0.64566696", "0.64484715", "0.64373416", "0.6435513", "0.64307994", "0.64269567", "0.6423421", "0.6423421", "0.6407453", "0.6393826", "0.63728565", "0.63697463", "0.6352483" ]
0.0
-1
POST /pages POST /pages.json
def create params = page_params possible_page = Page.where('user_id IS NOT NULL').where(uid: params[:uid]).order('updated_at DESC').first() # last page associated to some user that has the "uid" param if(!possible_page.nil?) params[:user_id] = possible_page.user_id end @page = Page.new(params) respond_to do |format| if @page.save format.html { redirect_to @page, notice: 'Page was successfully created.' } format.json { render :show, status: :created, location: @page } else format.html { render :new } format.json { render json: @page.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @page = Page.new(page_params)\n\n if @page.save\n render json: @page, status: :created, location: @page\n else\n render json: @page.errors, status: :unprocessable_entity\n end\n end", "def create\n respond_to do |format|\n begin\n @page = Page.create_page!\n format.html { redirect_to \"/#{@page.request_id}/inspect\", notice: t('pages.create.success') }\n format.json { render action: 'show', status: :created, location: @page }\n rescue => e\n format.html { render action: 'index' }\n format.json { render json: {:message => \"create page error\"}, status: :unprocessable_entity }\n end\n end\n end", "def create\n @page = Page.new(params[:page])\n\n respond_to do |format|\n if @page.save\n format.html { redirect_to pages_path, notice: 'Page was successfully created.' }\n format.json { render json: @page, status: :created, location: @page }\n else\n format.html { render action: \"new\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n #Each Page could be tied to an ApiKey or set of ApiKeys for security\n @page = Page.new(page_params)\n #Render the object created or errors\n respond_to do |format|\n if @page.save\n #Cache bust pages\n Rails.cache.delete(\"pages\")\n format.json { render action: 'show', status: :created, location: api_page_url(@page) }\n else\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @nested_page = Nested::Page.new(params[:nested_page])\n\n respond_to do |format|\n if @nested_page.save\n format.html { redirect_to @nested_page, notice: 'Page was successfully created.' }\n format.json { render json: @nested_page, status: :created, location: @nested_page }\n else\n format.html { render action: \"new\" }\n format.json { render json: @nested_page.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n params[:page].except!(:map_info) unless params[:page][:map_info].present?\n @page = current_user.pages.new(params[:page])\n respond_to do |format|\n if @page.save\n format.html { redirect_to @page, notice: 'Page was successfully created.' }\n format.json { render json: @page, status: :created, location: @page }\n else\n @business = Business.select('id, title')\n format.html { render action: \"new\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @page = current_site.pages.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end", "def index\n @pages = Page.page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def create\n @page = Page.new(params[:page])\n if @page.save\n respond_with(@page, location: api_pages_url)\n else\n respond_with(@page)\n end\n end", "def create\n @page = Page.new(page_params)\n respond_to do |format|\n if @page.save\n self.build_pages_tree\n format.html { redirect_to @pages_tree[@page.id], notice: 'Page was successfully created.' }\n format.json { render :show, status: :created, location: @page }\n else\n format.html { render :new }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @pages = Page.all\n render json: @pages\n end", "def create\n @page = Page.new(params[:page])\n\n respond_to do |format|\n if @page.save\n format.json { render json: @page, status: :created, location: [:api, @page] }\n format.xml { render xml: @page, status: :created, location: [:api, @page] }\n else\n format.json { render json: @page.errors, status: :unprocessable_entity }\n format.xml { render xml: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @page = Page.new(params[:page])\n\n respond_to do |format|\n if @page.save\n format.html { redirect_to @page, notice: 'Page was successfully created.' }\n format.json { render json: @page, status: :created, location: @page }\n else\n format.html { render action: \"new\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @page = Page.new(params[:page])\n\n respond_to do |format|\n if @page.save\n format.html { redirect_to @page, notice: 'Page was successfully created.' }\n format.json { render json: @page, status: :created, location: @page }\n else\n format.html { render action: \"new\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @page = Page.new(params[:page])\n\n respond_to do |format|\n if @page.save\n format.html { redirect_to @page, notice: 'Page was successfully created.' }\n format.json { render json: @page, status: :created, location: @page }\n else\n format.html { render action: \"new\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @page = Page.new(params[:page])\n\n respond_to do |format|\n if @page.save\n format.html { redirect_to @page, notice: 'Page was successfully created.' }\n format.json { render json: @page, status: :created, location: @page }\n else\n format.html { render action: \"new\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @page = Page.new(params[:page])\n\n respond_to do |format|\n if @page.save\n format.html { redirect_to @page, notice: 'Page was successfully created.' }\n format.json { render json: @page, status: :created, location: @page }\n else\n format.html { render action: \"new\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @page = Page.new(params[:page])\n\n respond_to do |format|\n if @page.save\n format.html { redirect_to @page, notice: 'Page was successfully created.' }\n format.json { render json: @page, status: :created, location: @page }\n else\n format.html { render action: \"new\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @page = Page.new(params[:page])\n\n respond_to do |format|\n if @page.save\n format.html { redirect_to [:admin, @page], notice: 'Страница успешно создана.' }\n format.json { render json: @page, status: :created, location: @page }\n else\n format.html { render action: \"new\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n respond_to do |format|\n if @page.save\n format.html { redirect_to @page, notice: 'Page was successfully created.' }\n format.json { render json: @page, status: :created, location: @page }\n else\n format.html { render action: \"new\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @page = Page.new(params[:page])\n\n if @page.save\n respond_to do |format|\n format.json {render json: @page, status: :created }\n format.xml {render xml: @page, status: :created}\n end\n \n else\n respond_to do |format|\n format.json {render json: @page.errors, status: :unprocessable_entity}\n format.xml {render xml: @page.errors, status: :unprocessable_entity}\n end\n end\n end", "def create\n @page = Page.new(params[:page])\n \n if @page.save\n respond_to do |format|\n format.json { render :json => @page, :status => :created }\n format.xml { render :xml => @page, :status => :created }\n end\n else\n respond_to do |format|\n format.json { raise Palani::Api::InvalidRecordJSONException }\n format.xml { raise Palani::Api::InvalidRecordXMLException }\n end\n end\n end", "def create\n @page = Page.new\n\n respond_to do |format|\n if @page.save\n format.html { redirect_to [:admin, @page], notice: 'Page was successfully created.' }\n format.json { render json: @page, status: :created, location: @page }\n else\n format.html { render action: \"new\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end", "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end", "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end", "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end", "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end", "def create\n @page = Page.new(page_params)\n\n respond_to do |format|\n if @page.save\n format.html { redirect_to @page, notice: 'Page was successfully created.' }\n format.json { render :show, status: :created, location: @page }\n else\n format.html { render :new }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @page = Page.new(page_params)\n\n respond_to do |format|\n if @page.save\n format.html { redirect_to @page, notice: 'Page was successfully created.' }\n format.json { render :show, status: :created, location: @page }\n else\n format.html { render :new }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @page = Page.new(page_params)\n\n respond_to do |format|\n if @page.save\n format.html { redirect_to @page, notice: 'Page was successfully created.' }\n format.json { render :show, status: :created, location: @page }\n else\n format.html { render :new }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @page = Page.new(page_params)\n\n respond_to do |format|\n if @page.save\n format.html { redirect_to @page, notice: 'Page was successfully created.' }\n format.json { render action: 'show', status: :created, location: @page }\n else\n format.html { render action: 'new' }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @page = Page.new(page_params)\n\n respond_to do |format|\n if @page.save\n format.html { redirect_to @page, notice: 'Page was successfully created.' }\n format.json { render action: 'show', status: :created, location: @page }\n else\n format.html { render action: 'new' }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def new\r\n @page = Page.new\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @page }\r\n end\r\n end", "def new\n\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end", "def create\n @page = Page.new(page_params)\n respond_to do |format|\n if @page.save\n format.html { redirect_to page_path(@page), notice: 'Page was successfully created.' }\n format.json { render action: 'show', status: :created, location: @page }\n else\n flash[:notice] = @page.errors.full_messages.to_sentence\n format.html { render action: 'new' }\n format.json { render json: [@page.errors.full_messages.to_sentence], status: :unprocessable_entity }\n end\n end\n end", "def create\n @page = current_site.pages.new(params[:page])\n @site = @page.site\n\n respond_to do |format|\n if @page.save\n format.html { redirect_to @page, notice: 'Page was successfully created.' }\n format.json { render json: @page, status: :created, location: @page }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n respond_with(@page = Page.create(params[:page]), :status => :created)\n end", "def create\n @page = Page.new(page_params)\n\n respond_to do |format|\n if @page.save\n @pages = current_user.pages\n format.html { redirect_to page_url(@page), notice: \"Page was successfully created.\" }\n format.json { render :show, status: :created, location: @page }\n flash.now[:notice] = \"Page was successfully created.\"\n format.turbo_stream { render \"shared/index\", locals: { object: Page.new, objects: @pages } }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\t@page = Page.new(params[:page])\n\n\t\trespond_to do |format|\n\t\t\tif @page.save\n\t\t\t\tformat.html { redirect_to @page, notice: 'Boom, page created.' }\n\t\t\t\tformat.json { render json: @page, status: :created, location: @page }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"Create new page\"}\n\t\t\t\tformat.json { render json: @page.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def new\n @Page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @Page }\n end\n end", "def create\n @page = current_site.pages.new(params[:page])\n\n respond_to do |format|\n if @page.save\n format.html { redirect_to quick_page_path(@page), notice: 'Page was successfully created.' }\n format.json { render json: @page, status: :created, location: @page }\n format.js\n else\n format.html { render action: \"new\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end", "def index\n @pages = current_site.pages\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def new\n @nested_page = Nested::Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nested_page }\n end\n end", "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page, :only => [:title, :content] }\n end\n end", "def create\n response = @page.parse_url\n render json: response\n end", "def create\n redirect_to pages_path\n end", "def create\n @page_page = PagePage.new(page_page_params)\n\n respond_to do |format|\n if @page_page.save\n format.html { redirect_to @page_page, notice: 'Page page was successfully created.' }\n format.json { render :show, status: :created, location: @page_page }\n else\n format.html { render :new }\n format.json { render json: @page_page.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @user = User.find_or_create_by(userid: params[:userid])\n @page = Page.create(page: params[:page], user: @user)\n if @user.save\n render status: 201, json: @user\n else\n render status: 422, json: { errors: @user.errors }\n end\n end", "def create\n @page = Page.new(params[:page])\n\n respond_to do |format|\n if @page.save\n # format.html { redirect_to @page, notice: 'Page was successfully created.' }\n # format.json { render json: @page, status: :created, location: @page }\n\n format.html { redirect_to action: \"edit\", id: @page.id, notice: 'Page was successfully created.' }\n format.json { head :no_content }\n\n\n else\n format.html { render action: \"new\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n flash[:notice] = 'The page was successfully created.' if page.save\n respond_with(page, location: project_page_path(page.project, page))\n end", "def creates\n @page = Page.new(pages_params)\n\n if @page.sav\n redirect_to pages_path\n else\n render :new\n end\n end", "def create\n @page = Page.new(params[:page])\n flash[:notice] = \"Page successfully created\" if @page.save\n respond_with(@page)\n end", "def create\n @page = Page.new(params[:page])\n flash[:notice] = \"Page successfully created\" if @page.save\n respond_with(@page)\n end", "def create\n @page = Page.new(pages_params)\n if @page.save\n redirect_to pages_path\n else\n render :new\n end\n end", "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end", "def create\n @page = Page.new(pages_params)\n\n if @page.save\n redirect_to pages_path\n else\n render :new\n end\n end", "def index\n @pages = Page.paginate(page: params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: Page.roots.map{|r| r.node}}\n end\n end", "def create\n @page = Page.new(page_params)\n\n respond_to do |format|\n if @page.save\n# format.html { redirect_to @page, notice: 'Page was successfully created.' }\n# format.json { render :show, status: :created, location: @page }\n format.html { redirect_to edit_page_path(@page), notice: 'Page was successfully created.' }\n format.json { render :show, status: :created, location: edit_page_path(@page) }\n else\n format.html { render :new }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @page = Page.new\n\n respond_to do |format|\n format.json { render json: @page }\n format.xml { render xml: @page }\n end\n end", "def create\n @page = current_user.pages.new(page_params)\n\n @page.slug = @page.title.parameterize\n\n if Page.exists?(slug: @page.slug, site_id: @site.id)\n pages = Page.where(title: @page.title, site_id: @site.id).count\n @page.slug = @page.title.parameterize + \"-\" + (pages + 1).to_s\n end\n\n respond_to do |format|\n if @page.save\n format.html { redirect_to edit_page_path(@page), notice: 'Saved' }\n format.json { render action: 'show', status: :created, location: @page }\n else\n format.html { render action: 'new' }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @title = 'New Page'\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end", "def index\n @pages = Page.all\n \n respond_to do |format|\n format.json { render :json => @pages }\n format.xml { render :xml => @pages }\n end\n end", "def pages\n get(\"v1/event/#{@id}/pages\")\n end", "def index\n\t\t@pages = Page.order('created_at DESC').all\n\n\t\trespond_to do |format|\n\t\t\tformat.html #index.html.erb\n\t\t\tformat.json { render json: @pages }\n\t\tend\n\tend", "def create\n @test_page = TestPage.new(params[:test_page])\n\n respond_to do |format|\n if @test_page.save\n format.html { redirect_to @test_page, notice: 'Test page was successfully created.' }\n format.json { render json: @test_page, status: :created, location: @test_page }\n else\n format.html { render action: \"new\" }\n format.json { render json: @test_page.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @page = Page.new(params[:page])\n \n\n respond_to do |format|\n if @page.save\n @page.update_attribute('published_at', Time.now) if params[:commit] == 'Publish'\n \n if params[:commit] == 'Publish'\n format.html { redirect_to root_page_path(@page), notice: 'Page was successfully published.' }\n else\n format.html { redirect_to edit_page_path(@page), notice: 'Page was successfully created.' }\n end\n format.json { render json: @page, status: :created, location: @page, :only => [:title, :content] }\n else\n format.html { render action: \"new\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @pages = Page.all\n\n respond_to do |format|\n format.json { render json: @pages }\n format.xml { render xml: @pages }\n end\n end", "def create\n\n # retrieve page part attributes from params and assign it to a variable\n page_parts = params[:page][:page_parts_attributes]\n\n # sort the page_parts and reassign it to the params\n params[:page][:page_parts_attributes] = Hash[page_parts.sort]\n\n #creating the page object with its own and child attributes\n @page = Page.new(params[:page])\n\n #retrieving layout id from params and assigning to a variable\n @layout = params[:page][:layout_id]\n\n # calling method to find all pages and page parts\n find_pages_and_parts(@layout)\n\n # sends the data in different formats\n respond_to do |format|\n\n if @page.save #page saved successfully\n\n format.html { redirect_to admin_pages_path, notice: 'Page was successfully created.' }\n format.json { render json: @page, status: :created, location: @page }\n\n else #page saving failed, re-render the form\n\n format.html { render action: \"new\", :template => 'mcms_pages/admin/pages/new' }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n\n end # end if\n\n end # end respond_to block\n\n end", "def create(params)\n put(\"v1/fundraising/pages\", {:basic_auth => true}.merge(params))\n end", "def new\n @page = Page.new\n\n respond_to do |format|\n format.json {render json: @page}\n format.xml {render xml: @page}\n end\n end", "def create_page\n puts 'params = ' + params.inspect\n puts params[:content_page].inspect\n puts params[:content_page['name']].inspect\n @page = ContentPage.new(params[:content_page])\n puts '@page = ' + @page.inspect\n\n respond_to do |format|\n if @page.save\n format.html { redirect_to show_content_pages_path(@page.id), notice: 'Page was successfully created.' }\n format.json { render json: @page, status: :created }\n else\n format.html { render :controller => 'content_pages', action: \"new\", alert: 'There were Errors. Could not Create a New Page.' }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @page = @user.pages.build(params[:page])\n\n respond_to do |format|\n if @page.save\n flash[:notice] = 'Page was successfully created.'\n format.html { redirect_to(@page) }\n format.xml { render :xml => @page, :status => :created, :location => @page }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @page.errors, :status => :unprocessable_entity }\n end\n end\n end", "def pages\n end", "def create\n @pages = Page.new(pages_params)\n if @pages.save\n redirect_to pages_path\n else\n renders :new\n end\nend", "def create\n @pageable = polymorphic_parent\n @page = polymorphic_parent.pages.new(params[:page])\n authorize! :create, @page\n\n respond_to do |format|\n if @page.save\n ChalkDust.publish_event(current_user, 'created', @page)\n @activity = ChalkDust::ActivityItem.where(:event => 'created', :target => @page).first\n format.html { redirect_to @page.path, :notice => 'Page was successfully created.' }\n format.json { render :json => @page, :status => :created, :location => @page }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @page.errors, :status => :unprocessable_entity }\n end\n end\n end", "def publish\n @page.publish\n respond_with(@page, location: published_api_pages_url)\n end", "def create\n @page = Page.new(admin_page_params)\n respond_to do |format|\n if @page.save\n format.html { redirect_to admin_pages_url, notice: 'page was successfully created.' }\n format.json { render :show, status: :created, location: @page }\n else\n format.html { render :new }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @page = Page.new(page_params)\n respond_to do |format|\n begin\n if @page.save\n flash[:success] = 'Page was successfully created.'\n format.html { redirect_to admin_page_url(@page) }\n format.json { render :show, status: :created, location: @page }\n else\n format.html { render :new }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n rescue Exception => e \n flash[:danger] = \"Oops! Something went wrong: #{e.message}\"\n format.html { render :new }\n end\n end\n end", "def load_pages_json(pages_json_path)\n basename = File.basename pages_json_path\n rel_dir = File.dirname pages_json_path\n rel_dir = rel_dir[self.source.size..rel_dir.size]\n page = ::JekyllPagesApi::PageWithoutAFile.new(\n self, self.source, rel_dir, basename)\n page.output = File.read(pages_json_path)\n self.pages << page\n end", "def create\n @structure_page = Structure::Page.new(params[:structure_page])\n\n respond_to do |format|\n if @structure_page.save\n format.html { redirect_to @structure_page, notice: 'Page was successfully created.' }\n format.json { render json: @structure_page, status: :created, location: @structure_page }\n else\n format.html { render action: \"new\" }\n format.json { render json: @structure_page.errors, status: :unprocessable_entity }\n end\n end\n end", "def page_params\n params.require(:page).permit(:title, :slug, :content, :status)\n end", "def create\n @mypage = Mypage.new(params[:mypage])\n\n respond_to do |format|\n if @mypage.save\n format.html { redirect_to @mypage, notice: 'Mypage was successfully created.' }\n format.json { render json: @mypage, status: :created, location: @mypage }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mypage.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @pages_article = PagesArticle.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pages_article }\n end\n end", "def new\n \n @page = Page.new\n @page.images.build\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end", "def create\n @pages_article = PagesArticle.new(params[:pages_article])\n\n respond_to do |format|\n if @pages_article.save\n format.html { redirect_to @pages_article, notice: 'Pages article was successfully created.' }\n format.json { render json: @pages_article, status: :created, location: @pages_article }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pages_article.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @page = Page.new(params[:page])\n\n respond_to do |format|\n if @page.save\n @contribution = @page.contributions.build(:user_id => current_user.id)\n @contribution.save\n format.html { redirect_to @page, notice: 'Page was successfully created.' }\n format.json { render json: @page, status: :created, location: @page }\n else\n format.html { render action: \"new\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @page = ContentPage.new\n @blocks = nil\n #@newBlock = PageBlock.new\n @form_action = \"create_page\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end", "def create\n @page = Page.new(page_params)\n authorize @page\n\n respond_to do |format|\n if @page.save\n format.html { redirect_to @page, notice: 'Page was successfully created.' }\n format.json { render :show, status: :created, location: @page }\n else\n format.html { render :new }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @test_page = TestPage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @test_page }\n end\n end", "def new\n @page = @user.pages.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end", "def published\n @pages = Page.published\n\n respond_to do |format|\n format.json {render json: @pages}\n format.xml {render xml: @pages}\n end\n end", "def index\n\n # find all pages\n @pages = Page.all\n\n # send data in different format\n respond_to do |format|\n format.html{render :template => 'mcms_pages/admin/pages/index'}# index.html.erb\n format.json { render json: @pages }\n end # end respond_to\n\n end" ]
[ "0.7211315", "0.6897405", "0.6834769", "0.68295294", "0.68169403", "0.6816336", "0.6809005", "0.6803334", "0.6786953", "0.6776035", "0.67602175", "0.6754758", "0.6717724", "0.6717724", "0.6717724", "0.6717724", "0.6717724", "0.6717724", "0.66893786", "0.6675025", "0.66329163", "0.6628282", "0.65461546", "0.654196", "0.654196", "0.654196", "0.654196", "0.654196", "0.65410465", "0.65410465", "0.65410465", "0.65342623", "0.65342623", "0.6510782", "0.6510782", "0.6510782", "0.6510782", "0.6510782", "0.6510782", "0.6510782", "0.6508133", "0.65017104", "0.6495443", "0.6494985", "0.6494083", "0.6484743", "0.64538026", "0.6437769", "0.64124984", "0.640957", "0.64049983", "0.64049715", "0.64027154", "0.6396313", "0.6377189", "0.6343872", "0.63323015", "0.6321542", "0.6320619", "0.62975025", "0.62842417", "0.62842417", "0.6279125", "0.6274186", "0.6264773", "0.62579226", "0.6255754", "0.6253713", "0.6245986", "0.6218197", "0.61925304", "0.61870927", "0.6177616", "0.6174632", "0.6169836", "0.61696935", "0.61376464", "0.61358154", "0.6131909", "0.6130478", "0.61188203", "0.61172223", "0.6115589", "0.61069626", "0.61031866", "0.61021185", "0.60887617", "0.6086607", "0.608573", "0.6077105", "0.6073996", "0.6051279", "0.60507554", "0.6047481", "0.60472655", "0.60456336", "0.60441536", "0.6022346", "0.6008152", "0.60073876", "0.5997325" ]
0.0
-1
DELETE /pages/1 DELETE /pages/1.json
def destroy @page.destroy respond_to do |format| format.html { redirect_to pages_url, notice: 'Page was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_page(id)\n @client.raw('delete', \"/content/pages/#{id}\")\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :ok }\n end\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :ok }\n end\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :ok }\n end\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_pages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url, :notice => \"Successfully deleted page. #{undo_link}\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n format.xml { head :no_content }\n end\n end", "def destroy\r\n @page = Page.find(params[:id])\r\n @page.destroy\r\n File.delete(\"#{Rails.public_path}/#{@page.project_id}/#{@page.page_name}.html\")\r\n respond_to do |format|\r\n format.html { redirect_to pages_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @page = Page.find_by_slug(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :ok }\n end\n end", "def destroy\n @mypage = Mypage.find(params[:id])\n @mypage.destroy\n\n respond_to do |format|\n format.html { redirect_to mypages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @page.destroy\n respond_to do |format|\n format.json { render :json => @page }\n format.xml { render :xml => @page }\n end\n end", "def destroy\n @nested_page = Nested::Page.find(params[:id])\n @nested_page.destroy\n\n respond_to do |format|\n format.html { redirect_to nested_pages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_path(page: params[:page], type: params[:type]) }\n format.json { head :no_content }\n end\n end", "def destroy\n @page = current_site.pages.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to edit_site_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n respond_with(@page, :status => :deleted, :location => pages_path)\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n head :no_content\n end", "def destroy\n @page = Page.friendly.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_pages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @structure_page = Structure::Page.find(params[:id])\n @structure_page.destroy\n\n respond_to do |format|\n format.html { redirect_to structure_pages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @page_page.destroy\n respond_to do |format|\n format.html { redirect_to page_pages_url, notice: 'Page page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n Page.find(params[:id]).destroy\n redirect_to pages_path\n end", "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to admin_pages_url, notice: 'Страница успешно удалена!' }\n format.json { head :no_content }\n end\n end", "def destroy\n @test_page = TestPage.find(params[:id])\n @test_page.destroy\n\n respond_to do |format|\n format.html { redirect_to test_pages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @static_page = StaticPage.find(params[:id])\n @static_page.destroy\n\n respond_to do |format|\n format.html { redirect_to static_pages_url }\n format.json { head :ok }\n end\n end", "def destroy\n @static_page = StaticPage.find(params[:id])\n @static_page.destroy\n\n respond_to do |format|\n format.html { redirect_to static_pages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @static_page = StaticPage.find(params[:id])\n @static_page.destroy\n\n respond_to do |format|\n format.html { redirect_to static_pages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect }\n format.xml { head :ok }\n end\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(page_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to all_pages_path(:magazine_id=>@page.magazine_id), notice: 'Page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @oasis_page = OasisPage.find(params[:id])\n @oasis_page.destroy\n\n respond_to do |format|\n format.html { redirect_to oasis_pages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @page = Page.find_by_slug(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n respond_with(@page)\n end", "def destroy\n @page = current_cms.pages.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(big_cms_pages_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n authorize! :destroy, @page\n @page.destroy\n respond_to do |format|\n format.html { redirect_to request.referer || pages_url, notice: 'Page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @page = @chapter.pages.find_by_number(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to manga_chapter_url(@manga, @chapter) }\n format.json { head :no_content }\n end\n end", "def destroy \n # finds and delete page \n Page.find(params[:id]).destroy\n # take us back to all pages \n redirect_to pages_path\n end", "def destroy\n @about_page = AboutPage.find(params[:id])\n @about_page.destroy\n\n respond_to do |format|\n format.html { redirect_to about_pages_url }\n format.json { head :ok }\n end\n end", "def destroy\n @admined_page1 = AdminedPage1.find(params[:id])\n @admined_page1.destroy\n\n respond_to do |format|\n format.html { redirect_to admined_page1s_url }\n format.json { head :ok }\n end\n end", "def destroy\n @page = @user.pages.find_by_permalink(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @page = current_site.pages.find_by_permalink(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n format.js\n end\n end", "def destroy\n @page_type = PageType.find(params[:id])\n @page_type.destroy\n\n respond_to do |format|\n format.html { redirect_to page_types_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @page.delete\n @message = {message: 'Page deleted'}\n respond_with(@message)\n end", "def destroy\n @story_page.destroy\n respond_to do |format|\n format.html { redirect_to story_pages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n\n # find the page with with\n @page = Page.find(params[:id])\n\n # calling class method of PagePart model to delete page parts of a page\n PagePart.delete_page_parts(@page)\n\n #destroy the page\n @page.destroy\n\n #sends in data in different format to index action\n respond_to do |format|\n\n format.html { redirect_to admin_pages_url }\n format.json { head :no_content }\n\n end # end respond_to block\n\n end", "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to(admin_pages_url) }\n format.xml { head :ok }\n end\n website.add_log(user: current_user, action: \"Deleted page: #{@page.title}\")\n end", "def destroy\n\t\t@page = Page.find(params[:id])\n\t\[email protected]\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to pages_url }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url, :notice => 'The page has vanished.') }\n format.xml { head :ok }\n end\n end", "def destroy\n @admin_page = Page.find(params[:id])\n @admin_page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n end\n end", "def destroy\n @sync_page = SyncPage.find(params[:id])\n @sync_page.destroy\n\n respond_to do |format|\n format.html { redirect_to sync_pages_url }\n format.json { head :no_content }\n end\n end", "def delete_page(page)\n transaction \"delete `#{page.title}'\" do\n store.delete(page.title + '.md')\n end\n end", "def destroy\n @yellow_page.destroy\n respond_to do |format|\n format.html { redirect_to yellow_pages_url, notice: 'Yellow page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @pages_article = PagesArticle.find(params[:id])\n @pages_article.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_articles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @page.destroy\n\n expire_page :action => :show\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n redirct_to root_path\n end", "def destroy\n @document_page = DocumentPage.find(params[:id])\n @document_page.destroy\n\n respond_to do |format|\n format.html { redirect_to document_pages_url }\n format.json { head :no_content }\n end\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def destroy\n @page.destroy\n\n respond_to do |wants|\n wants.html { redirect_to(admin_pages_url) }\n wants.xml { head :ok }\n end\n end", "def destroy\n @page.destroy\n #Cache bust pages and individual page. With pagination we would only bust the cache on the paginated \"pages\" key.\n Rails.cache.delete(\"pages\")\n Rails.cache.delete(\"page-#{@page.id}\")\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy \n @page.destroy\n respond_to do |format|\n format.html { redirect_to website_path(params[:website_id]), notice: 'Page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @comic_page = ComicPage.find(params[:id])\n @comic_page.destroy\n\n respond_to do |format|\n format.html { redirect_to comic_pages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n authorize @page\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url, notice: 'Page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profilepage = Profilepage.find(params[:id])\n @profilepage.destroy\n\n respond_to do |format|\n format.html { redirect_to profilepages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @rcadmin_static_page.destroy\n respond_to do |format|\n flash[:notice] = 'Static page was successfully deleted.'\n format.html { redirect_to rcadmin_static_pages_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Post.delete(params[\"id\"])\n end", "def destroy\n @uneautrepage.destroy\n respond_to do |format|\n format.html { redirect_to uneautrepages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_pages_path }\n end\n end", "def destroy\n @admin_page.destroy\n respond_to do |format|\n format.html { redirect_to admin_pages_url, notice: 'Page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n begin\n Page.destroy(params[:id])\n respond_with \"destroyed\"\n rescue\n respond_with({:errors => [\"not destroyed\"]})\n end\n end", "def destroy\n @cms_page.destroy\n respond_to do |format|\n format.html { redirect_to cms_pages_url, notice: \"#{@cms_page.title} has been deleted.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @enq_page = EnqPage.find(params[:id])\n @enq_page.destroy\n\n respond_to do |format|\n format.html { redirect_to enq_pages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @page_fetch = PageFetch.find(params[:id])\n @page_fetch.destroy\n\n respond_to do |format|\n format.html { redirect_to(page_fetches_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @words_page = WordsPage.find(params[:id])\n @words_page.destroy\n\n respond_to do |format|\n format.html { redirect_to words_pages_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.75885814", "0.7533844", "0.7533844", "0.7533844", "0.75185406", "0.75185406", "0.75185406", "0.75185406", "0.75185406", "0.75185406", "0.75185406", "0.75185406", "0.7513754", "0.7513754", "0.7513754", "0.7513754", "0.7400107", "0.73982805", "0.7391226", "0.7356314", "0.7349746", "0.72769994", "0.7250729", "0.72383237", "0.7236142", "0.72191364", "0.72146577", "0.72042006", "0.7195766", "0.7190908", "0.7144051", "0.7141389", "0.7141389", "0.7141389", "0.7141389", "0.7141389", "0.7141389", "0.7141389", "0.7141389", "0.7110245", "0.7095243", "0.7085851", "0.7081725", "0.70778567", "0.7072369", "0.7072369", "0.7066424", "0.7050733", "0.70306975", "0.70265424", "0.70248234", "0.7011653", "0.70109475", "0.69896567", "0.6988108", "0.69791794", "0.6962661", "0.6959823", "0.69489235", "0.69480956", "0.69298357", "0.69258994", "0.6920159", "0.69166404", "0.6914675", "0.6909286", "0.69086593", "0.68913645", "0.68822867", "0.6877132", "0.6876372", "0.68676436", "0.6864608", "0.6861246", "0.6854858", "0.6850511", "0.68499666", "0.6843799", "0.6842069", "0.6837942", "0.6836502", "0.68326056", "0.683214", "0.68308395", "0.6824117", "0.6815937", "0.68152255", "0.6813073", "0.6800696", "0.6800515", "0.6797284", "0.6796499", "0.6788875" ]
0.723134
32
Use callbacks to share common setup or constraints between actions.
def set_page @page = Page.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 before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\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 workflow\n 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 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 after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\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 action\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 config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \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 action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n 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 lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n 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 release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\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 my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n 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" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def page_params params.require(:page).permit(:title, :url, :access_at, :user_id, :uid) 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
Override Devise Sign Out Behavior Delete the pa_auth_token cookie Redirect to the PA logout page
def after_sign_out_path_for(resource_or_scope) cookies.delete :pa_auth_token "#{Civiccommons::PeopleAggregator.URL}/logout.php?redirect=http://#{request.host}#{request.port == "80" ? nil : ":#{request.port}"}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sign_out\n\n # mark them as signed out.\n # (this is a helper method of devise, the rails ruby gem we're using for\n # authentication in the sample app.)\n # \n # \n #session_sign_out <---- NEED TO CHANGE TO CUSTOM USER SIGN OUT\n\n # send them back to the homepage.\n redirect_to root_path\n\n end", "def sign_out\n cookies.permanent[:auth_token] = nil\n session[:scope_id] = session[:scope_type] = session[:redirect] = nil\n end", "def destroy\n redirect_path = after_sign_out_path_for(\"user\")\n signed_out = (Devise.sign_out_all_scopes ? sign_out : sign_out(\"user\"))\n set_flash_message :notice, :signed_out if signed_out && is_navigational_format?\n super\n end", "def sign_out\n reset_session\n end", "def sign_out\n request.session.delete(:authorized)\n end", "def sign_out_and_redirect(resource_or_scope); end", "def destroy\n sign_out(authenticatable_class)\n redirect_to(passwordless_sign_out_redirect_path, Passwordless.config.redirect_to_response_options.dup)\n end", "def signout\n self.oaw_signout\n redirect_to root_url\n end", "def sign_out\n @logout = true\n authenticate_api_user\n @logout = false\n revoke_access if @current_user\n head :no_content\n end", "def logout\n cookies.delete SL_CONFIG[:USER_EMAIL_COOKIE]\n cookies.delete SL_CONFIG[:USER_HASH_COOKIE]\n redirect_to Site.full_url\n end", "def destroy\n signed_out_user = current_user\n sign_out :user\n session.try(:delete, :_csrf_token)\n # Prevent Token Fixation attacks by generating a new token upon user logout.\n signed_out_user.authentication_token = Devise.friendly_token\n signed_out_user.save\n super\n end", "def feature_sign_out\n # Make a delete request\n page.driver.delete Rails.application.routes.url_helpers.destroy_educator_session_path\n\n # Follow redirection back to root.\n page.visit page.driver.response.location\n end", "def sign_out\n logout\n end", "def destroy \n if session.present?\n #与accounts/config/initializers/devise文件before_logout重复\n send_logout_message\n session.destroy\n end\n flash[:notice] = 'You have successfully signed out!'\n redirect_to \"#{accounts_provider_url}/accounts/logout?redirect_uri=http://#{request.env['HTTP_HOST']}\"\n end", "def sign_out\n reset_session\n @current_user = nil\n end", "def sign_out\n return unless current_user\n current_user.update_attribute(:session_token, nil)\n session.delete(:token)\n end", "def signout\n self.current_user = nil\n\n redirect_to root_path\n end", "def handle_unverified_request\n# sign_out\n super\n end", "def sign_out\n session.sign_out\n end", "def destroy\n super\n after_sign_out_path_for(resource)\n end", "def sign_out\n cookies.delete(:remember_token)\n self.current_user = nil\n end", "def sign_out_and_redirect!(return_to = \"/\")\n sign_out_user\n redirect_to sign_out_url(return_to)\n end", "def sign_out\n self.current_user = nil \n cookies.delete(:remember_token)\n end", "def destroy\n reset_session()\n view_context.apphelp_flash( :notice, :signed_out )\n\n redirect_to( signin_path() )\n end", "def destroy\n sign_out_with_backend\n redirect_to new_session_path\n end", "def after_sign_out_path_for(resource)\n #if current_user_signed_in?\n # redirect_to home_path \n # else\n redirect_to site_index_path \n #end \n end", "def sign_out\n\tcookies.delete(:remember_token)\n\tcurrent_user = nil\n end", "def sign_out(*args)\n warden.logout(*args)\n end", "def sign_out\n\t\tself.current_user = nil \n\t\tcookies.delete(:remember_token)\n\tend", "def sign_out\r\n self.current_user = nil\r\n cookies.delete(:remember_token)\r\n end", "def logout_user\n cookies.delete(:auth_token)\n end", "def sign_out\n @current_user = nil\n end", "def after_sign_out_path_for(resource_or_scope)\n # caught by apache to trigger pubcookie logout\n '/logout'\n end", "def destroy\n self.current_person.forget_me if logged_in?\n cookies.delete :auth_token\n reset_session\n flash[:notice] = t('sessions.destroy.logged_out')\n redirect_to login_path\n end", "def sign_out\n self.current_user = nil\n cookies.delete(:remember_token)\n end", "def sign_out\n self.current_user = nil\n cookies.delete(:remember_token)\n end", "def sign_out\n self.current_user = nil\n cookies.delete(:remember_token)\n end", "def sign_out\n self.current_user = nil\n cookies.delete(:remember_token)\n end", "def sign_out\n self.current_user = nil\n cookies.delete(:remember_token)\n end", "def sign_out\n self.current_user = nil\n cookies.delete(:remember_token)\n end", "def sign_out\n self.current_user = nil\n cookies.delete(:remember_token)\n end", "def sign_out\n self.current_user = nil\n cookies.delete(:remember_token)\n end", "def sign_out\n self.current_user = nil\n cookies.delete(:remember_token)\n end", "def after_sign_out_path_for(resource_or_scope)\n Faraday.get(logout_path) if logout_path.present?\n super(resource_or_scope)\n end", "def sign_out\n send_request('sign_out', :delete) do |req|\n req.body = { auth_token: @auth_token }\n end\n end", "def sign_out\n # Make a delete request\n page.driver.delete destroy_educator_session_path\n\n # Follow https, make same delete request.\n page.driver.delete page.driver.response.location\n\n # Follow redirection back to root.\n page.visit page.driver.response.location\nend", "def after_sign_out_path_for user\n reset_session\n\n # for hijacking\n # cookies.delete :secure_user_id\n\n new_user_session_path\n # root_path\n end", "def destroy\n session[:user_id] = nil\n\n redirect_to(URI(Rails.application.config.apslabs_federation_url).merge('/users/sign_out').to_s, :notice => 'You have successfully signed out!')\n end", "def sign_out\n current_session.destroy if current_session\n @current_session = nil\n end", "def sign_out\n\t\tcookies.delete(:remember_token)\n\t\tcurrent_user = nil\n\tend", "def sign_out\n if active_token = ActiveToken.find_by_device(current_device)\n active_token.destroy\n end\n end", "def destroy\n __log_activity(\"LOGOUT #{current_user}\")\n __debug_route\n __debug_request\n user = current_user&.account&.dup\n opt = BS_AUTH ? { no_revoke: true?(params[:no_revoke]) } : {}\n delete_auth_data(**opt)\n super\n api_clear(user: user)\n set_flash_notice(user: user, clear: true)\n rescue => error\n auth_failure_redirect(message: error)\n end", "def destroy\n\t\tlog_out\n\t\tUTEPSSO.deauthenticate(cookies[:UTEP_SE], cookies[:UTEP_SA])\n\t\tredirect_to root_url\n\tend", "def destroy\n session[:user_id] = nil\n\n flash[:notice] = t(:successfully_logged_out)\n redirect_to \"#{CUSTOM_PROVIDER_URL}/users/sign_out\"\n end", "def destroy\n logger.info \"Session :: End omniauth session request.\"\n sign_out\n redirect_to root_path, :notice => \"Signed out!\"\n end", "def logout\n reset_session\n cookies.delete 'dc_logged_in'\n redirect_to '/'\n end", "def sign_out\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n session.delete(:user_id)\n current_user = nil\n end", "def sign_out\n #forget(current_user)\n self.current_user = nil\n cookies.delete(:remember_token)\n end", "def sign_out\n\t\tself.current_user = nil\n\t\tcookies.delete(:remember_token)\n\tend", "def sign_out\n\t\t@current_user = nil\n\t\tcookies.delete :remember_token\n\tend", "def handle_unverified_request\n \tsign_out\n \tsuper\n end", "def handle_unverified_request\n \tsign_out\n \tsuper\n end", "def handle_unverified_request\n \tsign_out\n \tsuper\n end", "def handle_unverified_request\n \tsign_out\n \tsuper\n end", "def handle_unverified_request\n \tsign_out\n \tsuper\n end", "def handle_unverified_request\n \tsign_out\n \tsuper\n end", "def signout \n\t if current_user\n\t session[:identity] = nil\n\t session[:authentication_id] = nil\n\t session.delete :identity\n\t session.delete :authentication_id\n\t flash[:notice] = 'You have been signed out!'\n\t end \n\t redirect_to root_url\n\t end", "def logout \n sign_out\n# render :text => \"single sign off\" and return unless params[\"from_sso\"].nil?\n redirect_to \"#{my_addr}/#{app.name}/home\"\n end", "def sign_out\n session[:user_id] = nil\n end", "def destroy\n sign_out(resource_name)\n doorkeeper_token.revoke\n\n render_meta message: I18n.t('devise.sessions.signed_out')\n end", "def sign_out\n forget current_user\n session[:user_id] = nil\n end", "def sign_out\n\n\t\t# Current user now is new.\n\t\tself.current_user = nil\n\n\t\t# The data cookies are deleted.\n\t\tcookies.delete(:remember_token)\n\tend", "def sign_out\n session[:user_id] = nil\n end", "def handle_unverified_request\n super\n sign_out\n end", "def log_out\n\t\tsuper\n\t\t@current_user = nil\n\tend", "def destroy\n\t\tcookies.delete(:auth_token)\n\t\tredirect_to root_url\n\tend", "def sign_out\n current_user = nil\n cookies.delete(:remember_token)\n end", "def sign_out\n current_user = nil\n cookies.delete(:remember_token)\n end", "def sign_out\n current_user = nil\n cookies.delete(:remember_token)\n end", "def sign_out\n session.delete(:user_id)\n @current_user = nil\n end", "def log_out\n cookies.delete :remember_token\n end", "def sign_out\n session.delete :user_id\n @current_user = nil\n end", "def signed_out\r\n # clear the authentication toke when the person manually signs out\r\n person = person.find_by_id(session[:person_id])\r\n\r\n if person\r\n update_authentication_token(person, nil)\r\n person.save\r\n session[:person_id] = nil\r\n flash[:notice] = \"You have been signed out.\"\r\n else\r\n redirect_to :sign_in\r\n end\r\n end", "def sign_out!\n self.current_account = AnonymousAccount.instance\n end", "def sign_out\n arguments = { \"token\" => token }\n response = Services::Web.post user: self, service: 'User Data Service', endpoint: 'Authentication', method: 'signOut', arguments: arguments\n @token = nil if response.status == 200\n nil\n end", "def after_sign_out_path_for(resource_or_scope)\n cookies.delete :session\n building_path\n end", "def sign_out\n session.delete(:user_id)\n end", "def sign_out\n current_user.update_attribute(:remember_token, User.hash(User.new_remember_token))\n cookies.delete(:remember_token)\n self.current_user = nil\n end", "def sign_out\n current_user.update_attribute(:remember_token, User.hash(User.new_remember_token))\n cookies.delete(:remember_token)\n self.current_user = nil\n end", "def handle_unverified_request\n sign_out\n super\n end", "def destroy\n self.current_user.forget_me if logged_in?\n cookies.delete :auth_token\n reset_session\n flash[:notice] = \"You have been logged out.\"\n redirect_back_or_default\n end", "def sign_out\n session.delete(:user_id)\n @current_user = nil\nend", "def destroy\n log_out\n redirect_to login_url, notice: t('controllers.sessions.destroy.logged_out')\n end", "def after_sign_out_path_for(resource_or_scope)\n if request.params[:type] == \"sso\"\n Rails.configuration.devise[:sign_out_redirect_url]\n else\n super\n end\n end", "def destroy\n\tsign_out\n\tredirect_to root_path\n end", "def handle_unverified_request\n sign_out\n super\n end", "def handle_unverified_request\n sign_out\n super\n end", "def handle_unverified_request\n sign_out\n super\n end", "def handle_unverified_request\n sign_out\n super\n end", "def handle_unverified_request\n sign_out\n super\n end" ]
[ "0.7290194", "0.7285405", "0.72332394", "0.71412194", "0.70934147", "0.7092693", "0.70764625", "0.70427114", "0.7027523", "0.70130646", "0.6987139", "0.6986207", "0.6982017", "0.69804245", "0.6953956", "0.691257", "0.69027793", "0.69003195", "0.68968827", "0.6892779", "0.6884138", "0.68835145", "0.6868703", "0.6864314", "0.6863324", "0.68624526", "0.68549544", "0.6852484", "0.68400013", "0.6834146", "0.6832598", "0.68299884", "0.68278897", "0.68204117", "0.68195885", "0.6817416", "0.6817416", "0.6817416", "0.6817416", "0.6817416", "0.6817416", "0.6817416", "0.6817416", "0.680294", "0.6792951", "0.6789228", "0.67797905", "0.6777008", "0.67750347", "0.67715806", "0.6771504", "0.6765652", "0.6760911", "0.67576885", "0.6755146", "0.6752151", "0.6751649", "0.67458147", "0.6745429", "0.67435426", "0.6741235", "0.6741235", "0.6741235", "0.6741235", "0.6741235", "0.6741235", "0.67331374", "0.6731983", "0.67319024", "0.67318475", "0.6730434", "0.6727668", "0.67260075", "0.67233616", "0.6722336", "0.6719023", "0.6716293", "0.6716293", "0.6716293", "0.67105937", "0.67094356", "0.6707671", "0.6707509", "0.67064565", "0.67061394", "0.67045486", "0.6703289", "0.67010134", "0.67010134", "0.6696257", "0.6694365", "0.669133", "0.66913295", "0.66874206", "0.66847014", "0.6683773", "0.6683773", "0.6683773", "0.6683773", "0.6683773" ]
0.76395696
0
return render setting keys
def rendersettingkeys() return @settings_render.keys end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keys\n @config.keys\n end", "def keys\n configuration.keys\n end", "def get_keys()\n\t\t\treturn @config.keys\n\t\tend", "def get_names\r\n\t\tsettings = []\r\n\t\[email protected] { |key, value|\r\n\t\t\tsettings.push(key)\r\n\t\t}\r\n\t\treturn settings\r\n\tend", "def settings_list\n setting.list\n end", "def keys\n configs.keys | store.keys\n end", "def keys\n end", "def static_keys\n keys - dynamic_keys\n end", "def keys\n end", "def keys\n end", "def keys\n end", "def keys\n end", "def keys\n @key\n end", "def keys\n @keys ||= fields.order(:fieldnum).select do |field|\n field.useedit & 1 == 1\n end.map do |field|\n field.fieldname.downcase\n end\n end", "def keys; end", "def keys; end", "def keys; end", "def keys; end", "def keys; end", "def keys; end", "def keys; end", "def keys; end", "def keys; end", "def keys\n [ name ]\n end", "def keys\n DoesKeyValue::State.instance.keys[self.to_s]\n end", "def option_keys\n []\n end", "def key_options\n case key_type\n when :select\n return Concerto::Application.config.field_configs[key.to_sym][:values]\n else\n return nil\n end\n end", "def list_apps\n render :text => app_configs.keys\n end", "def to_s\n \"#{@__keys__.join(' ')} from #{@__schema__} for #{@__settings__}\"\n end", "def keys()\n @locals.keys\n end", "def key_template\n @key_template ||= [*name.downcase.split(\"::\"), \"%<id>d\"].join(\":\")\n end", "def list_keys()\n # TODO\n end", "def keys\n\t\tsuper + self.class.keys\n\tend", "def key(config)\n # By default we use all params and metrics\n sb = []\n sb.push(self.handle)\n sb.push(config['params'].flatten) if config['params']\n sb.push((config['metrics'] || default_metrics).flatten)\n sb.flatten.join('_')\n end", "def keys() end", "def combined_key_field\n BlacklightBrowseNearby::Engine.config.combined_key_field\n end", "def keys\n entries.keys\n end", "def keys\n\n (@services.keys + conf.keys).uniq.sort\n end", "def widget_options\n app_options = {}\n app_options[:level] ||= {}\n app_options[:level].merge! @level.properties.camelize_keys\n app_options.merge! view_options.camelize_keys\n app_options\n end", "def to_js_keys\n []\n end", "def keys\n values.map(&:to_sym)\n end", "def load_keys\n @@keys = Hash[buttons.map{|button| [button.text, button]}]\n end", "def category_keys\n @backend.category_keys\n end", "def page_settings(key)\n # We use #fetch instead of #[] so that an exception is raised on\n # non-existing keys.\n # We need `english_bound` for englarged copies because the text box\n # is different between bound and stitched in english.\n # All foreign files are forced to stitched since text boxes between\n # bound and stitched are identical. That way we have a single\n # source of data and no duplication.\n {\n english_bound: {\n paperwidth: '8.5truein',\n paperheight: '11truein',\n inner: '1.304655truein',\n outer: '1.345345truein',\n top: '1.06154truein',\n bottom: '0.66855truein',\n headsep: '0.1106in', # We want this dimension to scale with geometry package \\mag.\n footskip: '0.351in', # We want this dimension to scale with geometry package \\mag.\n },\n english_stitched: {\n paperwidth: '8.5truein',\n paperheight: '11truein',\n inner: '1.304655truein',\n outer: '1.345345truein',\n top: '1.06154truein',\n bottom: '0.66855truein',\n headsep: '0.1106in', # We want this dimension to scale with geometry package \\mag.\n footskip: '0.351in', # We want this dimension to scale with geometry package \\mag.\n },\n foreign_stitched: {\n paperwidth: '8.5truein',\n paperheight: '11truein',\n inner: '1.528125truein',\n outer: '1.555165truein',\n top: '1.04425truein',\n bottom: '0.70715truein',\n headsep: '0.172in', # We want this dimension to scale with geometry package \\mag.\n footskip: '0.25in', # We want this dimension to scale with geometry package \\mag.\n },\n }.fetch(key)\n end", "def keys\n @params.keys\n end", "def list_keys\n @keys.keys\n end", "def env_keys\n mapping.values\n end", "def stringified_keys; end", "def list_settings\n configure do |settings|\n settings.reject { |_, setting| setting.internal? }.each do |name, setting|\n @env.ui.info \"#{name}\\t#{setting.description}\", bold: true\n @env.ui.info indent(setting.help, 2) unless setting.help.nil?\n value_info = \"Current value: #{setting.value}\"\n value_info += ' (default)' unless setting.set?\n @env.ui.info indent(value_info, 2)\n @env.ui.info ''\n end\n end\n end", "def getSettingsForDash\n\t\tif(!self.customCode)\n\t\t\treturn {}\n\t\telse\n\t\t\tsettings = Hash.new\n\t\t\tcustomSettings.each do |k,v|\n\t\t\t\tsettings[k] = v[:val]\n\t\t\tend\n\n\t\t\treturn settings\n\t\tend\n\tend", "def keys; @caesars_properties.keys; end", "def setting_name\n return @setting_name\n end", "def keys\n Keys[to_attr_list]\n end", "def all_settings\n @settings.values.sort_by(&:key)\n end", "def liner_keys\n self.class.liner_keys\n end", "def keys\n @yaml.keys\n end", "def index\n @configuration_keys = ConfigurationKey.all\n end", "def permitted_keys\n @permitted_keys ||= properties.map(&:to_sym)\n end", "def default_keys; end", "def get_all_settings\n return @db[:settings].as_hash(:name, :body) if onblock(:u, -1, @client).admin?\n end", "def settings(key)\n self_settings = self.super_settings(key)\n return self_settings if self_settings.value?\n# self.dmptemplate.settings(key)\n self.template.settings(key) unless self.template.nil?\n end", "def contents\n @set.keys\n end", "def names\n @configs.keys\n end", "def names\n @configs.keys\n end", "def setting_states\n return @setting_states\n end", "def specific_keys\n %w(\n animate\n size\n background\n transparent\n enhanced\n rounded\n butt\n linewidth\n dashlength\n tiny\n small\n medium\n large\n giant\n font\n fontscale\n crop\n )\n end", "def grouped_key_for_results\n blacklight_config.view_config(action_name: :index).group\n end", "def grouped_key_for_results\n blacklight_config.view_config(action_name: :index).group\n end", "def keys(*) end", "def get_all_keys\n settings, _ = _get_settings()\n if settings === nil\n @log.error(1000, \"Config JSON is not present. Returning empty list.\")\n return []\n end\n return settings.keys\n end", "def get_settings(names)\n configure do |settings|\n names.each do |name|\n setting = settings.setting(name)\n @env.ui.info setting.value, bold: setting.set? if setting\n end\n end\n end", "def keys\n attributes.keys\n end", "def _defensio_keys\n self.class._defensio_keys\n end", "def property_keys\n headers = { 'Accept' => 'application/json; charset=UTF-8' }\n get_request 'propertykeys', headers\n end", "def keys\n @keys ||= LicenseField.all.map(&:key)\n end", "def stringify_keys; end", "def stringify_keys; end", "def stringify_keys; end", "def dot_key_array\n return ['label', 'label and hint','message','message error', 'message info','message success','message warning','model','model and menu','action', 'lookup']\n end", "def keys\n (@defs.keys.to_set + @extra_inputs.keys.to_set).to_a\n end", "def answer_keys\n [key]\n end", "def key\n \"#{@type}{#{@title}}]\"\n end", "def input_keys\n if options.blank?\n answer_keys\n else\n # Some options don't have a key (inner_title), they are stripped\n options.map { |opt| opt.input_key }.compact\n end\n end", "def keys\n items.keys\n end", "def keys\n\n self.to_h.keys\n end", "def list_keys\n @keydict.keys\n end", "def inspect\n %(#<#{self.class} keys=#{keys.inspect}>)\n end", "def inspect\n %(#<#{self.class} keys=#{keys.inspect}>)\n end", "def keys\n config.resolver.keys(_container)\n end", "def settings\n {}\n end", "def key_name_groups\n KEY_NAME_GROUPS.map { |kn| const_get kn }\n end", "def key_map\n steps.key_map\n end", "def keys\n @attributes.keys\n end", "def settings\n # TODO\n {}\n end", "def key_variants; end", "def settings\n {}\n end", "def settings\n {}\n end", "def get_all(key)\n configuration.hpath(key)\n end", "def keys\n @navigable_map.key_set.to_a\n end", "def settings\n attributes.fetch(:settings)\n end" ]
[ "0.66135925", "0.6577235", "0.65454", "0.6471078", "0.63356584", "0.6269167", "0.61767477", "0.60718304", "0.60665935", "0.60665935", "0.60665935", "0.6042199", "0.6013304", "0.5994426", "0.59562343", "0.59562343", "0.59562343", "0.59562343", "0.59562343", "0.59562343", "0.59562343", "0.59562343", "0.59562343", "0.59554046", "0.5937976", "0.5861928", "0.5861043", "0.5855505", "0.5848137", "0.58369195", "0.58363444", "0.58246", "0.5783732", "0.57823753", "0.57784003", "0.57779527", "0.57777834", "0.5757815", "0.57556283", "0.57456523", "0.5745563", "0.5729541", "0.5702899", "0.5691888", "0.5677272", "0.56566286", "0.5655813", "0.5652377", "0.5651486", "0.564086", "0.5635943", "0.56193924", "0.5615184", "0.56146806", "0.56099004", "0.5602643", "0.5600579", "0.55943835", "0.55796903", "0.5571635", "0.5562311", "0.55604094", "0.55416703", "0.55416703", "0.553613", "0.55333453", "0.5531484", "0.5531484", "0.55304915", "0.55281675", "0.5518097", "0.5514931", "0.55133575", "0.549842", "0.54975224", "0.54971176", "0.54971176", "0.54971176", "0.5492298", "0.54888666", "0.5485404", "0.54766196", "0.54697084", "0.5469664", "0.5465574", "0.54610616", "0.54495555", "0.54495555", "0.5445462", "0.54396445", "0.5435466", "0.54350334", "0.54262555", "0.5426147", "0.54253894", "0.54213506", "0.54213506", "0.5408004", "0.54038984", "0.54038924" ]
0.9029768
0
END load_from_model def save_to_model note: all changes are saved to model instantly puts "LuxrenderSettings.rb calling attribute dictionary to save settings to SketchUp file"
def get_names settings = [] @settings.each { |key, value| settings.push(key) } return settings end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_settings\n dir = 'Wave_Trace'\n model = Sketchup.active_model\n model.start_operation('Wave_Trace: Save All Settings', true) # Start an undo-able operation\n model.attribute_dictionaries.delete(dir) # First delete any pre-existing Wave_Trace dictionary\n \n model.set_attribute(dir, 'draw_realtime', @draw_realtime_check.checked?)\n model.set_attribute(dir, 'bounce_hidden', @bounce_hidden_check.checked?)\n model.set_attribute(dir, 'max_length', @max_length_drop.value)\n # model.set_attribute(dir, 'use_barrier', @use_barrier_check.checked?)\n model.set_attribute(dir, 'max_bounces', @max_bounces_drop.value)\n model.set_attribute(dir, 'bounce_filter', @bounce_filter_drop.value)\n # model.set_attribute(dir, 'draw_sweetspot', @draw_sweetspot_check.checked?)\n \n @speaker_list.each do |speaker|\n # Name each speaker after its index location in speaker_list... \"s_1\" \"s_2\" etc\n speaker_key = \"s_#{speaker_list.index(speaker).to_s}\" \n speaker_value = {\n name: speaker.button.caption,\n realtime_check: speaker.realtime_check.checked?,\n commit_check: speaker.commit_check.checked?,\n group_num: speaker.group_num\n }\n # Store the speaker settings as a string\n model.set_attribute(dir, speaker_key, speaker_value.inspect) \n \n speaker.driver_list.each do |driver|\n # Name driver index s_1_d_1, s_1_d_2 etc \n driver_key = \"#{speaker_key}_d_#{speaker.driver_list.index(driver).to_s}\"\n driver_value = {\n name: driver.name_field.value,\n origin: driver.origin.to_a,\n vector: driver.vector.to_a,\n x_angle_low: driver.x_angle_low_drop.value,\n x_angle_high: driver.x_angle_high_drop.value,\n y_angle_low: driver.y_angle_low_drop.value,\n y_angle_high: driver.y_angle_high_drop.value,\n x_angle_link: driver.x_angle_link_check.checked?,\n y_angle_link: driver.y_angle_link_check.checked?,\n density: driver.density_drop.value,\n ray_list: driver.ray_list,\n realtime_check: driver.realtime_check.checked?,\n commit_check: driver.commit_check.checked?\n }\n # Store the driver settings as a string\n model.set_attribute(dir, driver_key, driver_value.inspect)\n end\n end\n \n # FIX - Save global options too\n \n model.commit_operation # End undo-able operation\n UI.messagebox(\" Important!\\n\\nAll speakers, drivers and global settings have been stored in your model. You must SAVE YOUR MODEL for these settings to persist.\", MB_OK)\n end", "def save_model( model )\n file = model_filename model\n file_path = File.join(Dir.home,'tempo', file)\n File.delete( file_path ) if File.exists?( file_path )\n\n File.open( file_path,'a' ) do |f|\n model.index.each do |m|\n f.puts YAML::dump( m.freeze_dry )\n end\n end\n end", "def persist_model(model)\n joblib.dump(model, 'model.pkl')\n model = joblib.load('model.pkl')\n return model\nend", "def configure_save\n save = load_save\n @word = save.word\n @hints = save.hints\n @incorrect = save.incorrect\n @lives = save.lives\n end", "def save\n # Nothing in base class. This should be used to persist settings in\n # subclasses that use files.\n end", "def save_editor_settings\n Sketchup.write_default('MSPhysics', 'Editor Theme', @editor_theme.to_s)\n Sketchup.write_default('MSPhysics', 'Editor Font', @editor_font.to_i)\n Sketchup.write_default('MSPhysics', 'Editor Wrap', @editor_wrap.to_s)\n Sketchup.write_default('MSPhysics', 'Editor Print Margin', @editor_print_margin)\n Sketchup.write_default('MSPhysics', 'Editor Size', @editor_size.inspect)\n Sketchup.write_default('MSPhysics', 'Dialog Help Box', @dialog_help_box)\n Sketchup.write_default('MSPhysics', 'Dialog Scale', @dialog_scale)\n end", "def save\n indices = {}\n model.indices.each do |field|\n next unless (value = send(field))\n indices[field] = Array(value).map(&:to_s)\n end\n\n uniques = {}\n model.uniques.each do |field|\n next unless (value = send(field))\n uniques[field] = value.to_s\n end\n\n features = {\n \"name\" => model.name\n }\n\n if defined?(@id)\n features[\"id\"] = @id\n end\n\n @id = script(LUA_SAVE, 0,\n features.to_json,\n _sanitized_attributes.to_json,\n indices.to_json,\n uniques.to_json\n )\n\n return self\n end", "def save_settings!\n File.open(settings_path, \"w\") { |f| f << settings.to_nested_hash.to_yaml }\n settings.create_accessors!\n end", "def save_with_load\r\n @oksave = true\r\n save\r\n @oksave = nil\r\n end", "def save_settings\n File.open(@path, \"w\") do |file|\n file.write @settings.to_yaml\n end\n end", "def _save\n properties\n end", "def save; end", "def save; end", "def save; end", "def save; end", "def save; end", "def save; end", "def save; end", "def save; end", "def save(params)\r\n save_admin_pass(params[:admin_pass])\r\n save_setting(:site_name, params[:site_name])\r\n save_setting(:navbar_bg_color, params[:navbar_bg_color])\r\n save_setting(:navbar_font_color, params[:navbar_font_color])\r\n save_setting(:navbar_border_color, params[:navbar_border_color])\r\n save_setting(:page_bg_color, params[:page_bg_color])\r\n save_setting(:page_font_color, params[:page_font_color])\r\n save_setting(:subnav_bg_color, params[:subnav_bg_color])\r\n save_setting(:subnav_font_color, params[:subnav_font_color])\r\n save_setting(:copyright_name, params[:copyright_name])\r\n save_setting(:gallery_captions, params[:gallery_captions])\r\n save_setting(:meta_description, params[:meta_description])\r\n save_setting(:favicon, params[:favicon])\r\n save_setting(:paypal_client_id, params[:paypal_client_id])\r\n save_setting(:show_hidden_pages, params[:show_hidden_pages])\r\n end", "def save\n File.open(SETTING_FILE, 'w') do |file|\n file.write @values.to_yaml\n end\n end", "def save\n @model = register_model\n end", "def save_settings\n options = PAGENOTFOUND_DEFAULTS.merge(params[:options]&.to_unsafe_h.presence || {})\n @plugin.set_options(options) # save option values\n @plugin.set_metas(params[:metas]) if params[:metas].present? # save meta values\n @plugin.set_field_values(params[:field_options]) if params[:field_options].present? # save custom field values\n Rails.cache.delete_matched('pagenotfound_')\n redirect_to url_for(action: :settings), notice: 'Settings Saved Successfully'\n end", "def save\n SAVE\n end", "def save\n # Get the currently set path\n \tconfig_file = File.expand_path('../../config/bookhero.conf',File.dirname(__FILE__))\n settings = YAML::load(File.open(config_file))\n \t@configured_library_path = settings['library_path']\n \t@configured_google_api_key = settings['google_api_key']\n\n \n # Get data from form\n library_path = params[:library_path]\n if library_path.blank?\n library_path = @configured_library_path\n end\n\n google_api_key = params[:google_api_key]\n # if google_api_key.blank?\n # google_api_key = @configured_google_api_key \n # end\n\n # Write the data to yaml config file.\n \tdata = {\"library_path\" => \"#{library_path}\",\n \"google_api_key\" => \"#{google_api_key}\"}\n \tFile.open(File.expand_path('../../config/bookhero.conf',File.dirname(__FILE__)),\"w\") {|f| f.write(data.to_yaml)}\n\n # Read settings again\n redirect_to :action => \"settings\"\n\n end", "def save_and_reload! model\n model.save!\n model.reload\nend", "def save_settings\n @plugin.set_options(params[:options]) if params[:options].present? # save option values\n @plugin.set_metas(params[:metas]) if params[:metas].present? # save meta values\n @plugin.set_field_values(params[:field_options]) if params[:field_options].present? # save custom field values\n redirect_to url_for(action: :settings), notice: \"Settings Saved Successfully\"\n end", "def load_settings\n dir = 'Wave_Trace'\n \n dict = Sketchup.active_model.attribute_dictionary(dir)\n return if !dict # No saved settings\n\n # Set the global options\n @draw_realtime_check.checked = dict['draw_realtime']\n @bounce_hidden_check.checked = dict['bounce_hidden']\n @max_length_drop.value = dict['max_length']\n # @use_barrier_check.checked = dict['use_barrier']\n @max_bounces_drop.value = dict['max_bounces']\n @bounce_filter_drop.value = dict['bounce_filter']\n # @draw_sweetspot_check.checked = dict['draw_sweetspot']\n \n # Now load any speaker settings\n s_index = 0\n while(speaker_str = dict[\"s_#{s_index}\"]) # There is a saved speaker at s_x in attribute dictionary\n \n # Create a speaker and set its values according to the saved information\n speaker_hash = eval(speaker_str)\n speaker = self.add_speaker(true) # Add a speaker with the 'loading' option set to TRUE (avoids creating any drivers)\n \n speaker.name_field.value = speaker_hash[:name]\n speaker.name_field.trigger_event(:textchange)\n \n speaker.realtime_check.checked = speaker_hash[:realtime_check]\n speaker.commit_check.checked = speaker_hash[:commit_check]\n speaker.group_num = speaker_hash[:group_num]\n # Set the link_to_group droplist value to whatever the group_num index is. Then set a color if there is a group.\n # speaker.link_to_group_drop.value = speaker.link_to_group_drop.items[speaker.group_num] if speaker.group_num\n # case speaker.group_num\n # when 1\n # speaker.group_highlight.background_color = Sketchup::Color.new(128,0,0,255) # Red\n # when 2\n # speaker.group_highlight.background_color = Sketchup::Color.new(0,128,0,255) # Green\n # when 3\n # speaker.group_highlight.background_color = Sketchup::Color.new(128,128,0,255) # Yellow\n # when 4\n # speaker.group_highlight.background_color = Sketchup::Color.new(200,200,200,255) # White\n # end\n \n d_index = 0\n while(driver_str = dict[\"s_#{s_index}_d_#{d_index}\"]) # There is a saved driver at s_x_d_x in attribute dictionary\n # Create a driver and set its values according to the saved information\n driver_hash = eval(driver_str)\n driver = speaker.add_driver(true) # Add a driver with the 'loading' option set to TRUE (avoids any group settings logic)\n \n driver.name_field.value = driver_hash[:name]\n driver.name_field.trigger_event(:textchange)\n\n origin_array = driver_hash[:origin]\n vector_array = driver_hash[:vector]\n if origin_array.empty? # No saved origin... it was never set\n driver.origin = nil\n driver.vector = nil\n else # Found an origin... so there has to be a vector as well. Load both and change \"locate driver\" button to reflect such.\n driver.origin = Geom::Point3d.new(origin_array)\n driver.vector = Geom::Vector3d.new(vector_array)\n driver.locate_button.background_color = Sketchup::Color.new(0, 0, 0, 128) # Un-highlight locate_button\n driver.locate_button.caption = \"Relocate\" # Change its caption\n end\n \n driver.realtime_check.checked = driver_hash[:realtime_check]\n driver.commit_check.checked = driver_hash[:commit_check]\n \n driver.density_drop.trigger_event(:change, driver_hash[:density], true) # Call the density change to update angle droplists\n driver.x_angle_low_drop.value = driver_hash[:x_angle_low]\n driver.x_angle_high_drop.value = driver_hash[:x_angle_high]\n driver.y_angle_low_drop.value = driver_hash[:y_angle_low]\n driver.y_angle_high_drop.value = driver_hash[:y_angle_high]\n driver.x_angle_link_check.checked = driver_hash[:x_angle_link]\n driver.y_angle_link_check.checked = driver_hash[:y_angle_link]\n driver.ray_list = driver_hash[:ray_list]\n \n d_index += 1\n end\n s_index += 1\n end\n \n self.select_speaker(@speaker_list.first) if speaker_list.length > 0\n end", "def load_model\n self.model = new_model\n model.load_model model_path\n model.print_model\n self.fm = Model::FunctionMap.load_function_map\n end", "def model=(model)\n if model\n @model = model\n\n @state_symbols = model.each_state.map { |name, type| name.to_sym }\n @error_states = model.each_state.\n map { |name, type| name.to_sym if (type == :error || type == :exception || type == :fatal) }.\n compact.to_set\n @exception_states = model.each_state.\n map { |name, type| name.to_sym if type == :exception }.\n compact.to_set\n @runtime_states = model.each_state.\n map { |name, type| name.to_sym if (type == :error || type == :runtime) }.\n compact.to_set\n @fatal_states = model.each_state.\n map { |name, type| name.to_sym if type == :fatal }.\n compact.to_set\n\n if ext = Orocos.extension_modules[model.name]\n ext.each { |m_ext| extend(m_ext) }\n end\n add_default_states\n else @model = nil\n end\n end", "def save\n end", "def generate_save\n YAML.dump(self)\n end", "def save\n # Alternative ways can be implemented here. (text file etc.)\n # TODO: Handle Unicode and special characters.\n # (If further escaping than inspect is necessary.)\n Sketchup.write_default(\"Plugins_ae\", @identifier, @options.inspect.gsub(/\"/, \"'\"))\n # Sketchup.write_default(\"Plugins_ae\", @identifier, @options.inspect.inspect[1..-2]) # TODO!!!\nend", "def persist\n settings = {\n area: @focus[:key]\n }\n File.open(@path, 'w') do |file|\n file.write settings.to_yaml\n end\n end", "def save_all\n return if @loading_data\n\n json_data = JSON.dump(@model.to_h)\n\n LocalStorage['volt-store'] = json_data\n end", "def autosave; end", "def save\n end", "def save\n end", "def save\n end", "def save\n end", "def update_model(wbs)\n f = File.new(\"#{wbs.railsbase}/app/models/#{singular_name}.rb\",'r+')\n fa = f.readlines\n new_array = prepare_model_changes(fa, wbs)\n f.rewind\n new_array.each {|line| f.puts(line)}\n end", "def save\r\n props = {}\r\n instance_variables.each{|v|\r\n # props[v.to_s[1..-1]] = instance_variable_get(\"#{v}\")\r\n p = v.to_s[1..-1]\r\n props[p] = self.send(p)\r\n }\r\n File.write(STORAGE, YAML.dump(props))\r\n end", "def save\r\n SystemConfig.set name, to_h(false), true\r\n end", "def set_model\n @model = Info\n end", "def model=(model)\n @model = model\n end", "def make_save_contents\n contents = rm_extender_make_save_contents\n contents[:self_vars] = $game_self_vars\n contents[:labels] = $game_labels\n contents[:self_labels] = $game_self_labels\n contents\n end", "def save_settings\n rf = Plugins::CamaleonRobotsEditor::CamaleonRobotsEditor.new\n rf.write params[:robots_content] if params[:robots_content].present?\n redirect_to url_for(action: :settings), notice: 'Settings Saved Successfully'\n end", "def save!\n end", "def save\n end", "def save\n return unless dirty? && config.respond_to?(:write)\n\n config.write\n clean_up\n end", "def save\n File.open(@file, 'w') do |file|\n file.write(Psych.dump(@params))\n end\n @saved = true\n end", "def sendDataFromSketchup()\r\n puts \"running sendDataFromSketchup from scene settings editor\"\r\n\t\[email protected]_xresolution = Sketchup.active_model.active_view.vpwidth unless @lrs.fleximage_xresolution\r\n\t\[email protected]_yresolution = Sketchup.active_model.active_view.vpheight unless @lrs.fleximage_yresolution\r\n\t\tsettings = @lrs.get_names_scene\r\n\t\tsettings.each { |setting|\r\n #puts \"\"\r\n #puts setting\r\n #puts @lrs.send(setting)\r\n updateSettingValue(setting) # gets setting from @lrs\r\n\t\t}\r\n # update interface for resolution section\r\n updateResolutionGUI()\r\n if (@lrs.aspectratio_type == \"aspectratio_fixed\")\r\n setFixedResValue(@lrs.aspectratio_fixed_ratio)\r\n end\r\n \r\n # update subsections based on active dropdown values\r\n @scene_settings_dialog.execute_script('update_subfield(\"environment_light_type\")')\r\n @scene_settings_dialog.execute_script('update_boxfield(\"use_environment_infinite_sun\")')\r\n @scene_settings_dialog.execute_script('update_subfield(\"fleximage_colorspace_wp_preset\")')\r\n @scene_settings_dialog.execute_script('update_subfield(\"fleximage_tonemapkernel\")')\r\n @scene_settings_dialog.execute_script('update_subfield(\"fleximage_render_time\")')\r\n \r\n \r\n\tend", "def config_model\n source = \"#{Dir.pwd}/app/models/#{@scaffold_name}.rb\"\n modify_content(source, 'Model', \"#{model_class}\") \n modify_content(source, '@model', \"@#{@scaffold_name}\")\n end", "def save\n write_properties\n notify(EVENT_SAVE, self)\n end", "def set_model\n @model=Info\n end", "def save\n if self.valid?\n # encrypt_password\n file = File.new(FILE_PATH, \"w+\")\n YAML::dump(self.attributes, file)\n file.close\n end\n end", "def save\n fann.save(\"#{Rails.root}/data/#{self.class.to_s.tableize.singularize}.conf\")\n end", "def save\n\n end", "def save\n super save\n end", "def save_settings\n open(@@FN_CREDENTIALS, \"wb\") { |fd| fd.write(YAML::dump(@credentials)) }\n open(@@FN_CONFIG, \"wb\") { |fd| fd.write(YAML::dump(@configuration)) }\n open(@@FN_SETTINGS, \"wb\") { |fd| fd.write(YAML::dump(@settings)) }\n end", "def reload\n @dirty = []\n @cache = Preference.find_all_by_model_type_and_model_id(@model.class.name, @model.id).index_by(&:key)\n end", "def save!\n super\n logger.debug \"overriden save called!\"\n update_vars\n super\n end", "def save\n #code\n end", "def save\n\t\tend", "def save\n attributes = MultiJson.dump({ name: @name, linkbutton: @linkbutton })\n Huey::Request.put(\"config\", body: attributes)\n self.reload\n end", "def save_settings\n File.open( @settings_filename, 'w' ) do |out|\n YAML.dump( @app_settings, out )\n end\n @log.debug \"Settings saved into #{@settings_filename}\"\n end", "def save_settings settings\n File.open(@settings_file, 'w') {|file| file << YAML::dump(settings)}\n end", "def save\n update({})\n end", "def save_config\n self.data = JSON.dump(self.config)\n end", "def save_config\n self.data = JSON.dump(self.config)\n end", "def save_model\n refresh_catalog_record_id_from_form = catalog_record_ids.find { |id| id.refresh && id._destroy != \"1\" }&.value\n non_refresh_catalog_record_ids_from_form = catalog_record_ids.filter_map { |id| id.value if id.refresh != true && id._destroy != \"1\" }\n catalog_record_ids_from_form = [refresh_catalog_record_id_from_form].compact + non_refresh_catalog_record_ids_from_form\n\n new_catalog_links = CatalogRecordId.serialize(model, catalog_record_ids_from_form, refresh: refresh_catalog_record_id_from_form.present?)\n\n # now store everything in the cocina object\n updated_object = model\n identification_props = updated_object.identification.new(catalogLinks: new_catalog_links)\n updated_object = updated_object.new(identification: identification_props)\n Repository.store(updated_object)\n end", "def save\n self.class.save(self)\n end", "def save()\n File.open(CONFIG_FILE, 'w'){ |f| f.write config.to_yaml } # Store\n end", "def save_data\n puts \"saving data\"\n\n File.open(generate_filename(self), \"w\") do |f|\n f.write(ostruct_to_hash(self.json).to_yaml)\n end\n end", "def save\n @opts\n end", "def export\n # Temporarily use first database entry for all saves\n s = GomokuSave.first\n s.position = @current_state.position.join\n s.human_to_move = @current_state.player == :human\n s.human_last_row = @current_state.last_move[:human][0]\n s.human_last_column = @current_state.last_move[:human][1]\n s.computer_last_row = @current_state.last_move[:computer][0]\n s.computer_last_column = @current_state.last_move[:computer][1]\n s.top = @current_state.outer_bounds[:top]\n s.bottom = @current_state.outer_bounds[:bottom]\n s.left = @current_state.outer_bounds[:left]\n s.right = @current_state.outer_bounds[:right]\n s.save\n end", "def load_model(model_class)\n begin\n file_content = File.read(model_class.db_filename)\n json_data = JSON.parse(file_content)\n rescue Errno::ENOENT\n # The file does not exists\n json_data = []\n end\n json_data.each do |data_hash|\n new_object = model_class.from_hash(data_hash)\n new_object.save\n end\nend", "def load_model(model_class)\n begin\n file_content = File.read(model_class.db_filename)\n json_data = JSON.parse(file_content)\n rescue Errno::ENOENT\n # The file does not exists\n json_data = []\n end\n json_data.each do |data_hash|\n new_object = model_class.from_hash(data_hash)\n new_object.save\n end\nend", "def setup\r\n @model = Profile\r\n @record_one = Profile.find(1)\r\n @new_obj = {\r\n :bio => 'I am awesome',\r\n :user_id => 1,\r\n :address_line1 => ' 1600 Pennsylvania Avenue NW',\r\n :address_line2 => 'bunker #4',\r\n :city => 'Washington',\r\n :job_title=>'Manager',\r\n :company=>\"Uncle Sam's Military Surplus\",\r\n :state=> 'DC',\r\n :postal_code =>'20500',\r\n :telephone=>'202-456-1111',\r\n :fax=>'202-456-2461'\r\n }\r\n end", "def after_save\n reload\n end", "def save\n import\n errors.none?\n end", "def sendDataFromSketchup()\r\n puts \"running sendDataFromSketchup from render settings editor\"\r\n\t\tsettings = @lrs.get_names_render\r\n\t\tsettings.each { |setting|\r\n #puts \"\"\r\n #puts setting\r\n #puts @lrs.send(setting)\r\n #updateSettingValue(setting) \r\n\t\t\tsetValue(setting, @lrs[setting]) # gets setting from @lrs\r\n\t\t\t\r\n\t\t}\r\n # set setting areas based on dropdown settings\r\n subfield_categories = [\"sampler_type\", \"sintegrator_type\", \"pixelfilter_type\", \"accelerator_type\"]\r\n subfield_categories.each{|fieldname|\r\n update_subfield = 'update_subfield(\"' + fieldname + '\")'\r\n #puts update_subfield\r\n @render_settings_dialog.execute_script(update_subfield)\r\n }\r\n # show/hide SPPM integrator field\r\n if (@lrs.renderer==\"sppm\")\r\n showintegrator='$(\"#sppm\").show();'\r\n hideintegrator='$(\"#integratorsection\").hide();'\r\n else\r\n showintegrator='$(\"#integratorsection\").show();'\r\n hideintegrator='$(\"#sppm\").hide();'\r\n \r\n end\r\n @render_settings_dialog.execute_script(hideintegrator)\r\n @render_settings_dialog.execute_script(showintegrator)\r\n \r\n # show preset name in dropdown value\r\n setdropdown = '$(\"#renderpreset\").val(\"' + @lrs.renderpreset + '\");'\r\n @render_settings_dialog.execute_script(setdropdown)\r\n\r\n \r\n\tend", "def save_grip; end", "def save()\n super\n end", "def save()\n super\n end", "def save()\n super\n end", "def save()\n super\n end", "def save()\n super\n end", "def save_file\r\n @saved = true\r\n saving\r\n Dir.mkdir(\"saves\") unless Dir.exists? \"saves\"\r\n File.open(\"my_save.yaml\", \"w\") {|f| f.puts YAML::dump(self) }\r\n end", "def save_object\n end", "def save\n object.save\n end", "def force_save\n GamePlay::Save.save\n end", "def refresh\n # re-download the model from the server\n set_model\n end", "def save\n File.write(yfile, to_yaml)\n end", "def restore; end", "def initialize \n save\n end", "def save_settings\n @list_id = env['TRELLO_TARGET_LIST_ID']\n @key = env['TRELLO_APP_KEY']\n @secret = env['TRELLO_SECRET']\n @token = env['TRELLO_USER_TOKEN']\n @archive_card = env['ARCHIVE_CARD']\n end", "def save_view(view, title)\n title.downcase!\n default_template = Doing.setting('templates.default')\n user_config = Util.safe_load_file(config_file)\n user_config['views'] = {} unless user_config.key?('views')\n\n view.delete_if { |k, v| v == default_template[k] }\n\n user_config['views'][title] = view\n Util.write_to_file(config_file, YAML.dump(user_config), backup: true)\n Doing.logger.warn('Config:', %(View \"#{title}\" saved to #{config_file}))\n Doing.logger.info('Config:', %(to use, run `doing view #{title}`))\n Hooks.trigger :post_config, self\n end", "def write_settings\n Application.settings.set_value('pos', Qt::Variant.new(pos))\n Application.settings.set_value('size', Qt::Variant.new(size))\n Application.settings.sync\n end", "def model\n obj = versionable.class.new\n YAML::load( self.yaml ).each do |var_name,var_value|\n obj.__send__( \"#{var_name}=\", var_value )\n end\n obj\n end", "def save_intro\n self.current_stage = :profile_stage\n self.save validate: false\n true\n end" ]
[ "0.6754634", "0.6215465", "0.62102216", "0.6163619", "0.61432266", "0.6064836", "0.60359275", "0.60189044", "0.5959097", "0.59505486", "0.59270483", "0.59225625", "0.59225625", "0.59225625", "0.59225625", "0.59225625", "0.59225625", "0.59225625", "0.59225625", "0.58287615", "0.57853496", "0.57838345", "0.5760556", "0.5740833", "0.57267", "0.57210374", "0.5718059", "0.5703477", "0.5701682", "0.5682563", "0.565915", "0.56535846", "0.5646762", "0.5612115", "0.56108123", "0.56036764", "0.55838805", "0.55838805", "0.55744034", "0.55744034", "0.55624235", "0.55591834", "0.55538183", "0.55290705", "0.55146474", "0.5510824", "0.5507942", "0.5494373", "0.5492114", "0.5483882", "0.5479132", "0.54780674", "0.54563195", "0.5447575", "0.5432993", "0.54263717", "0.54253066", "0.5419666", "0.54180044", "0.5406933", "0.54032636", "0.53853685", "0.53508604", "0.5349816", "0.5345384", "0.53326136", "0.5325562", "0.53035456", "0.5300939", "0.5300939", "0.5271015", "0.5269147", "0.5257723", "0.5254081", "0.5253701", "0.5251007", "0.5245251", "0.5245251", "0.5244136", "0.52418524", "0.5236749", "0.52332544", "0.5229695", "0.5228748", "0.5228748", "0.5228748", "0.5228748", "0.5228748", "0.5222459", "0.5219819", "0.521938", "0.52088183", "0.52060586", "0.5201255", "0.5200729", "0.51921594", "0.5192097", "0.51862", "0.5174686", "0.5174304", "0.5170027" ]
0.0
-1
def sign_up_page? current_page?(:controller => 'users', :action => 'new') end helper_method :sign_up_page? def login_page? current_page?(:controller => 'sessions', :action => 'new') end helper_method :login_page? def issues_page? current_page?(:controller => 'issues', :action => 'index') end helper_method :issues_page?
def reset_stats redirect_to issue_stats_reset_stats_path end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identity_page?\n active_page? 'accounts' => ['show']\n end", "def profile_show_page?\n controller_name == \"profiles\"\n end", "def profile_show_page?\n controller_name == \"profiles\"\n end", "def home_page\n if current_user.guest?\n user_signup_url\n elsif current_user.administrator?\n admin_films_path\n elsif current_user.judge?\n judging_categories_path\n else\n obejct_url current_user\n end\n end", "def empty_page?\n controller_name == 'sessions'\n end", "def home_page?\n active_page? 'info' => ['index']\n end", "def login_page\n end", "def layout\n \t#is_a?(RegistrationsController)\n if is_a?(Devise::SessionsController) || is_a?(Devise::ConfirmationsController) || is_a?(Devise::PasswordsController)\n \"login\"\n #elsif is_a?(AuthenticationsController)\n #\"first_time\"\n else\n \"application\"\n end\n end", "def check_login_info\n # @signed_up = false\n # something\n # @signed_up = true\n \n # get \"/user_sign_in/\"\n if (User.find_by_name \"#{params[:un]}\")\n redirect_to(\"/user/:#{params[:un]}\")\n else\n redirect_to(\"/sign_up/\")\n end \n end", "def home_page?\n controller_name == 'pages' && %w(home location_name).detect {|x| action_name == x} ? true : false\n end", "def depricated_page?\n b = false\n DEPRICATED_PAGES_WITHOUT_CHECK_ACCOUNT.each do |page|\n b = true if controller_name == page[0] && action_name == page[1]\n end\n b\n end", "def personal_page?\n return false unless current_user\n return true if params[:owner_id].to_i == current_user.id\n return true if @user && current_user == @user\n return true if @quest && current_user.owns?(@quest)\n return true if @offer && current_user.owns?(@offer)\n \n false\n end", "def on_page_portal?\n return (controller.controller_name == \"home\" and controller.action_name == \"portal\") \n end", "def after_sign_up_path_for(resource)\n #super(resource)\n\n #'/pages/monprofil'\n\n if(session[:page_id].present?)\n cours_show_path(session[:page_id])\n else\n '/users/sign_up' \n end\n end", "def current_page?(url); end", "def card_page?\n current_act = params[:action]\n current_ctrl = params[:controller]\n dashboard_ctrl = (current_ctrl == 'dashboard')\n professional_card_act = (current_ctrl == 'professionals' && current_act != 'index')\n !(dashboard_ctrl || professional_card_act)\n end", "def loginpage\n end", "def active_page?(pages = {})\n is_active = pages.include?(params[:controller])\n is_active = pages[params[:controller]].include?(params[:action]) if is_active && !pages[params[:controller]].empty?\n is_active\n end", "def layout\n # only turn it off for login pages:\n # is_a?(Devise::SessionsController) ? \"sign_in_up\" : \"application\"\n # or turn layout off for every devise controller:\n #devise_controller? && \"application\"\n @categories ||= Category.ordered.with_memories \n\n if devise_controller? && params[:controller] == \"sessions\" || params[:controller] == \"registrations\" && params[:action] == \"new\" || \n params[:controller] == \"registrations\" && params[:action] == \"create\" || params[:controller] == \"passwords\" && params[:action] == \"new\" ||\n params[:controller] == \"confirmations\" && params[:action] == \"show\" \n \"sign_in_up\"\n else\n \"application\"\n end\n \n \n end", "def logged_in?\n !!link_to_account_detail_page\n end", "def check_user\n if current_user.blank?\n puts\"false\"\n new_user_session_path\n else\n puts\"true\"\n end\n end", "def should_display_about_and_features\n controller.controller_name == \"static_pages\"\n end", "def profile_form_url\n if (page? 'users', 'edit') || (page? 'users', 'update')\n user_path(@user)\n else\n registration_path(@user)\n end\n end", "def home_page\r\nif self.has_profile?('Admin', 'Faveod User')\r\n {:controller => :system_settings}\r\nelse\r\n {:controller => :users, :action => :show, :id => self.id}\r\nend\r\nend", "def devise_controller?; end", "def current_page?\n form.has_submit_button?\n end", "def login_helper(style = '')\n if current_user.is_a? GuestUser\n _span(link_to('Register', new_user_registration_path, class: style)) +\n _span(link_to('Login', new_user_session_path, class: style))\n else\n _span(link_to('Logout', destroy_user_session_path, method: :delete, class: style))\n end\n end", "def can_manage_pages?\n super\n rescue\n raise \"You need to specify a method named 'can_manage_pages?' in your application.rb. Have it return true if the current user should be able to create/edit pages and false otherwise\"\n end", "def submit_signup_details_without_password\n user = Users.signup_user_without_password\n enter_signup_details(user)\n # @pages.page_home.signup_register_button\n end", "def is_workplace_page? \n return true if controller_name == \"workplaces\" || controller_name ==\"workplace_posts\" || controller_name == \"workplace_map_posts\"\n end", "def unauthenticated_action?(controller, action)\n controller == \"users\" && action == \"create\"\n end", "def auth_controller?\n false\n end", "def show_profile?\n if controller.controller_name == 'hackers'\n true\n else\n false\n end\n end", "def link_to_sign_up()\n link_to('Cadastrar-se', new_user_registration_path) unless user_signed_in?\n end", "def authenticate\n \treturn if controller_name == \"pages\"\n \tif !logged_in?\n \t\tflash[:alert] = \"Must be an admin or a nutritionist\"\n \t\tredirect_to root_path\n \tend\n end", "def new #login page\n end", "def displayLoginPage()\n\t# User Name: \n\t# Password:\n\t# Forgot Password?\tNew User?\n\treturn\nend", "def do_not_check_authorization?\n respond_to?(:devise_controller?) ||\n respond_to?(:home_controller?)\n end", "def index\n return render_logged_in if logged_in?\n return redirect_to_signup_flow_entry_point if connected? && !feature_enabled?('onboarding.create_profile_modal')\n render_logged_out\n end", "def get_layout\n\tlogged_in? and :page_user or :page_visitor\nend", "def is_logged_in\n redirect_to login_path unless logged_in?\n end", "def needs_authenticate_user?\n except_actions = %w[index show]\n !except_actions.include?(action_name)\n end", "def check_user_signup_allowed\n redirect_to root_path unless Rails.configuration.allow_user_signup\n end", "def home_page?\n current_route?('')\n end", "def is_forum_home?\n params[:controller] == 'forums' && params[:action] == 'index'\n end", "def activepage?(path)\n \t\t\"active\" if current_page?(path)\n \tend", "def is_home?\n current_page?('/')\n end", "def selected_create_employee_tab?(params)\n if params[:controller] == \"users\" && params[:action] == \"new_employee\"\n return true\n end\n\n return false\n end", "def logged_in?\n end", "def which_action_button?\n if belongs_to_current_profile_user?\n if controller_name == 'photos'\n link_to \"Add New Photo\", new_profile_photo_path(@profile), class: \"btn btn-primary inline pull-right\"\n elsif controller_name == 'profiles' \n link_to \"Edit Profile\", edit_profile_path(@current_user.profile), class: \"btn btn-info inline pull-right\"\n end\n else\n if friendship_id = friend_of_current_user?\n link_to \"Remove Friend\", profile_friendship_path(:profile_id => @profile, :id => friendship_id), method: :delete, class: \"btn btn-danger inline pull-right\"\n else\n #We don't want to show this on our own profile\n unless belongs_to_current_profile_user?\n link_to \"Add Friend\", profile_friendships_path(@profile), method: :post, class: \"btn btn-success inline pull-right\"\n end\n end\n end\n end", "def logged_in?\n!current_user.nil?\nend", "def logged_in?\n!current_user.nil?\nend", "def logged_in?\n !!getCurrentUser\n end", "def login_page\n prompt.select(\"Login or Sign up\") do |menu|\n menu.choice \"Login\", -> {login_helper}\n menu.choice \"Sign up\", -> {sign_up_helper}\n menu.choice \"Exit\", -> {exit_helper}\n end\n end", "def sidebar_enabled?\n current_page = \"#{controller.controller_name}.#{controller.action_name}\"\n current_controller = controller.controller_name\n pages = %w(report_templates.new report_templates.edit )\n\n return pages.include?(current_page) || pages.include?(current_controller)\n end", "def nav_login_button\r\n \r\n end", "def authorized?\n # if signup_path == true\n # redirect_to signup_path\n # end\n\n redirect_to login_path unless current_user\n end", "def skip_pundit?\n devise_controller? || params[:controller] =~ /(^(rails_)?admin)|(^pages$)/\n end", "def valid_page?\n File.exist?(Pathname.new(Rails.root + \"app/views/welcome/#{params[:page]}.html.erb\"))\n end", "def protect?(action)\n if ['login', 'signup', 'forgot_password'].include?(action)\n return false\n else\n return true\n end\n end", "def signed_in_user\n #call and check on method signed_in from session helper if not user login\n unless signed_in?\n #show message to the user\n flash[:danger]=\"Please sign in\"\n #link to sign in page\n redirect_to signin_url\n end\n end", "def current_user?\n \n end", "def logged_in?\n!current_user.nil?end", "def logged_in?\n !current_user.nil?\nend", "def logged_in?\n !current_user.nil?\nend", "def logged_in?\n !current_user.nil?\nend", "def is_editing_page?\n params[:controller] == 'management/cms' && params[:action] == 'edit_page_content'\n end", "def is_home?\n is_controller_action?('home', 'index')\n end", "def index\n redirect_to(:action => 'signup') unless logged_in? or User.count > 0\n end", "def index\n redirect_to(:action => 'signup') unless logged_in? or User.count > 0\n end", "def active? path \n \"active\" if current_page? path\n end", "def is_allowed?(controller=params[:controller], action=params[:action], id=params[:id])\n case controller\n when \"admin\"\n return is_admin?\n \n when \"user\"\n case action\n when \"register\"\n return !logged_in?\n when \"login\"\n return !logged_in?\n when \"logout\"\n return logged_in?\n when \"show\", \"edit\"\n return ((is_admin?) || (current_user == id))\n when \"list\", \"index\"\n return logged_in?\n when \"pay\"\n return is_beta?\n end\n \n when \"country\", \"grape\", \"apptype\", \"appellation\" #basic ERD viewable to all\n case action \n when \"delete\", \"edit\", \"new\"\n return ((is_admin? || is_full? || is_pro?))\n else\n return true\n end\n \n when \"wine\" #basic ERD viewable ONLY to members\n case action\n when \"index\", \"list\"\n return true\n when \"delete\"\n return is_admin?\n when \"edit\"\n return (is_admin? || is_full? || is_pro?)\n else\n return logged_in?\n end\n \n when \"bottle\" # these two will get more complicated w/ friendship model\n return false unless logged_in?\n if is_free?\n return false\n end\n case action\n when \"index\", \"list\"\n return (is_admin? || is_full?)\n else\n return (is_my_bottle? || is_admin?)\n end\n\n when \"tastingnote\"\n return false unless logged_in?\n case action\n when \"index\", \"list\"\n return (is_admin? || is_full?)\n when \"new_w\"\n return logged_in?\n when \"new_b\"\n return (is_full? && is_my_bottle?(id)) \n else\n return (is_my_tnote? || is_admin?)\n end\n \n else # catch-all\n return is_admin?\n end\n\n end", "def define_action_helpers?; end", "def is_user_authenticate\r\n redirect_to '/users/sign_in' if current_user.nil?\r\n end", "def is_user_authenticate\r\n redirect_to '/users/sign_in' if current_user.nil?\r\n end", "def logged_in?\n !current_user.nil?\n end", "def index\n redirect_to(:action => 'signup') unless logged_in? || User.count > 0\n end", "def index\n redirect_to(:action => 'signup') unless logged_in? || User.count > 0\n end", "def index\n redirect_to(:action => 'signup') unless logged_in? || User.count > 0\n end", "def check_session\n unless (params[:controller] == \"devise/sessions\" || \n params[:controller] == \"devise_invitable/registrations\" || \n params[:controller] == \"devise/invitations\" ||\n params[:controller] == \"devise/confirmations\" ||\n params[:controller] == \"devise/passwords\")\n unless user_signed_in?\n redirect_to root_path\n flash[:error] = \"You need to sign in to access\"\n return\n end\n end\n end", "def signup_admin_if_not_users \r\n redirect_to :signup if User.count==0\r\n end", "def appHelper_ifUserLogged\n if session[:user_name] \n return true\n end\n return false\n end", "def logged_in?\n current_user != nil \nend", "def is_active?(current_page)\n return \"is-active\" if params[:controller] == current_page.to_s\n end", "def is_page_active(page)\n current_page.url == page\n end", "def check_if_current_user_page\n redirect_to('/') and return unless (current_user.id == User.from_param(params[:id])) || current_user.is_admin?\n end", "def members_page(user)\n\t\tcurrent_user?(user) && !current_user.guest?\n\tend", "def url_helpers_module; end", "def front_office_sign_in_page\n @last_page = FrontOfficeSignInPage.new\n end", "def index\n if logged_in?\n redirect_to :controller => 'account', :action => 'mypage'\n else\n if User.count > 0\n redirect_to :controller => 'account', :action => 'signup'\n else\n redirect_to :controller => 'recommend', :action => 'question'\n end\n end\n end", "def new\n #user wants to log in \n end", "def new\n #user wants to log in \n end", "def logged_in_user?\n if logged_in?\n redirect_to user_path(current_user)\n end\n end", "def user_nav\n if @current_user\n items = {'Home' => root_path, 'My Account' => account_path, 'My Submissions' => current_user_submissions_path}\n else\n if ApplicationSettings.config['user_registration']\n end\n items = {'Home' => root_path, 'Signup' => signup_path}\n end\n output_nav(items)\n end", "def navigating_page!\n if current_user.admin?\n redirect_to admin_root_path\n else\n redirect_to current_user.student\n end\n end", "def current_page; end", "def current_page; end", "def landing_page? \n landing_page.present? \n end", "def should_register_first_admin?\n unless User.any?\n redirect_to controller: 'users/registrations', action: 'new_admin'\n end\n end", "def login_required?\n true\n end", "def logged_in?\n current_user\n end" ]
[ "0.656914", "0.6489379", "0.64887154", "0.64642644", "0.64386004", "0.6285159", "0.6172293", "0.6101515", "0.6026966", "0.60103494", "0.60071486", "0.59975964", "0.59882087", "0.59798837", "0.5974045", "0.595959", "0.5858104", "0.5853803", "0.58495694", "0.58186704", "0.5800445", "0.57925326", "0.5772703", "0.5771621", "0.5761252", "0.57591134", "0.57479316", "0.5739636", "0.5737516", "0.5736519", "0.57094014", "0.5703414", "0.56817764", "0.56801456", "0.5678603", "0.5658056", "0.56541103", "0.5650319", "0.5638732", "0.5636323", "0.5626678", "0.5621096", "0.56193525", "0.5616345", "0.5614272", "0.5608143", "0.5607739", "0.5606475", "0.5606339", "0.5592639", "0.5591003", "0.5591003", "0.55896354", "0.55863", "0.55794895", "0.55740404", "0.55663437", "0.55661255", "0.55538034", "0.5548348", "0.55231", "0.5520146", "0.5511563", "0.5507848", "0.5507848", "0.5507848", "0.5505922", "0.5505829", "0.5503801", "0.5503801", "0.5503151", "0.550097", "0.5498361", "0.54976016", "0.54976016", "0.5497083", "0.54873705", "0.54873705", "0.54873705", "0.548398", "0.54817724", "0.5480298", "0.5475506", "0.5459156", "0.545669", "0.5453288", "0.5449947", "0.54431134", "0.54352516", "0.54324335", "0.5431484", "0.5431484", "0.54312974", "0.5417094", "0.54057276", "0.54056406", "0.54056406", "0.54051185", "0.54025996", "0.54013544", "0.5401117" ]
0.0
-1
Delete a google network
def delete_network(name) data = false conn = @ec2_main.environment.connection if conn != nil response = conn.delete_network(name) if response.status == 200 data = response.body else data = {} end else raise "Connection Error" end return data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_network(id)\n fog_service_interface.delete_network(id)\n end", "def delete_network(network)\n return delete_request(address(\"networks/\" + network), @token)\n end", "def delete_network(network_name)\n return if !configured? || !network_exists?(network_name)\n\n @service.delete_network(@gcp_config['project'], network_name)\n rescue StandardError => e\n @logger.error(e.message)\n end", "def delete_network(request, params)\n network = VirtualNetworkOCCI.new(\n VirtualNetwork.build_xml(params[:id]),\n @client)\n\n # --- Delete the VNET ---\n rc = network.delete\n if OpenNebula.is_error?(rc)\n return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]\n end\n\n return \"\", 204\n end", "def delete\n client_opts = {}\n client_opts[:network_interface_id] = network_interface_id\n client.delete_network_interface(client_opts)\n nil\n end", "def destroy\n @network.destroy\n\n respond_to do |format|\n format.html { redirect_to networks_url }\n format.json { head :no_content }\n end\n end", "def delete_network(network)\n attempt = 0\n begin\n network.destroy\n rescue Fog::Compute::RackspaceV2::ServiceError => e\n if attempt == 3\n puts \"Unable to delete #{network.label}\"\n return false\n end\n puts \"Network #{network.label} Delete Fail Attempt #{attempt}- #{e.inspect}\"\n attempt += 1\n sleep 60\n retry\n end\n return true\nend", "def destroy\n @network.destroy\n respond_to do |format|\n format.html { redirect_to networks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @network.destroy\n respond_to do |format|\n format.html { redirect_to networks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @network.destroy\n respond_to do |format|\n format.html { redirect_to networks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @network = params[:network]\n @account = current_user.accounts[@network]\n SocialNetworkAccount.destroy(@account.id)\n flash[:notice] = \"Successfully removed the #{@network} network\"\n redirect_to :back\n end", "def destroy(options={})\n response = service.delete_network(options.merge({'id'=> self.id}))\n service.jobs.new(response[\"deletenetworkresponse\"])\n end", "def destroy\n @network = Network.find(params[:id])\n @network.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_networks_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @network.destroy\n respond_to do |format|\n format.html { redirect_to networks_url, notice: 'Network was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @networking = Networking.find(params[:id])\n @networking.destroy\n RemovedNetworkings.create(net_identifier: Integer(params[:id]))\n\n respond_to do |format|\n format.html { redirect_to networkings_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @play_network.destroy\n respond_to do |format|\n format.html { redirect_to play_networks_url, notice: 'Play network was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @social_network = SocialNetwork.find(params[:id])\n @social_network.destroy\n\n respond_to do |format|\n format.html { redirect_to social_networks_url }\n format.json { head :ok }\n end\n end", "def destroy\n @shared_network.destroy\n respond_to do |format|\n format.html { redirect_to shared_networks_url, notice: \"Shared network was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def leave\n @network = current_organization.networks.find(params[:id])\n\n current_organization.networks.delete(@network)\n redirect_to networks_path\n end", "def delete(network_id, id)\n request(:delete, \"/settings/networks/#{network_id}/ip_addresses/#{id}.json\")\n end", "def destroy\n @network.destroy\n respond_to do |format|\n format.html {\n flash[:notice] = 'Network was successfully destroyed.'\n index\n }\n format.json { head :no_content }\n end\n end", "def destroy\n requires :network_acl_id\n\n service.delete_network_acl(network_acl_id)\n true\n end", "def deleteUserSocial_network( user_id, social_network)\n params = Hash.new\n params['user_id'] = user_id\n params['social_network'] = social_network\n return doCurl(\"delete\",\"/user/social_network\",params)\n end", "def destroy\n @social_network.destroy\n respond_to do |format|\n format.html { redirect_to admin_social_networks_url, notice: 'Social network was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @title = \"Destroy Networks\"\n @network = Network.find(params[:id])\n @network.destroy\n\n respond_to do |format|\n format.html { redirect_to(networks_url) }\n format.xml { head :ok }\n end\n end", "def delete_network(vapp, *network_names)\n raise ArgumentError, \"Must specify a network name to delete.\" if\n network_names.nil? || network_names.length == 0\n unique_network_names = network_names.uniq\n @logger.info(\"Delete networks(s) #{unique_network_names.join(\" \")} \" +\n \"from vApp #{vapp.name}\")\n current_vapp = get_vapp(vapp)\n unique_network_names.each do |n|\n current_vapp.network_config_section.delete_network_config(n)\n end\n task = @connection.put(current_vapp.network_config_section,\n current_vapp.network_config_section,\n Xml::MEDIA_TYPE[:NETWORK_CONFIG_SECTION])\n monitor_task(task)\n end", "def destroy\n @user_network = UserNetwork.find(params[:id])\n @user_network.destroy\n\n respond_to do |format|\n format.html { redirect_to user_path(current_user) }\n format.json { head :no_content }\n end\n end", "def destroy\n @networkgroup.destroy\n respond_to do |format|\n format.html { redirect_to networkgroups_url, notice: 'Networkgroup was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @network_connection = NetworkConnection.find(params[:id])\n @network_connection.destroy\n\n respond_to do |format|\n format.html { redirect_to network_connections_url }\n format.json { head :ok }\n end\n end", "def delete_vapp_network(vAppId, network)\n params = {\n 'method' => :get,\n 'command' => \"/vApp/vapp-#{vAppId}/networkConfigSection\"\n }\n\n netconfig_response, headers = send_request(params)\n\n picked_network = netconfig_response.css(\"NetworkConfig\").select do |net|\n net.attribute('networkName').text == network[:name]\n end.first\n\n raise WrongItemIDError, \"Network #{network[:name]} not found on this vApp.\" unless picked_network\n\n picked_network.remove\n\n params = {\n 'method' => :put,\n 'command' => \"/vApp/vapp-#{vAppId}/networkConfigSection\"\n }\n\n put_response, headers = send_request(params, netconfig_response.to_xml, \"application/vnd.vmware.vcloud.networkConfigSection+xml\")\n\n task_id = headers[:location].gsub(/.*\\/task\\//, \"\")\n task_id\n end", "def delete(id)\n request(:delete, \"/network_zones/#{id}.json\")\n end", "def destroy\n @network_model = NetworkModel.find(params[:id])\n @network_model.destroy\n\n respond_to do |format|\n format.html { redirect_to(network_models_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @networking.destroy\n respond_to do |format|\n format.html { redirect_to networkings_url, notice: 'Networking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @network_detail = NetworkDetail.find(params[:id])\n @network_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to(network_details_url) }\n format.xml { head :ok }\n end\n end", "def delete(name)\n cmd = \"no neighbor #{name}\"\n response = configure_bgp(cmd)\n unless response\n cmd = \"no neighbor #{name} peer-group\"\n response = configure_bgp(cmd)\n end\n response\n end", "def delete(name)\n connect { |connection| connection.delete dn(name) }\n end", "def destroy\n @network_action.destroy\n respond_to do |format|\n format.html { redirect_to network_actions_url, notice: 'Network action was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n ValidNetwork.find_by_guid(valid_network.guid).destroy if valid_network && ValidNetwork.find_by_guid(valid_network.guid)\n super\n end", "def delete\n client.delete(url)\n @deleted = true\n end", "def delete\n rc = NetUseDel.call(nil, @name, USE_NOFORCE)\n if rc != NERR_Success\n raise ArgumentError, get_last_error(rc)\n end\n end", "def destroy_and_undefine\n # Shamb0_TODO_20200609=>POC/WT-bringup\n # old_net = @virt.lookup_network_by_name(@net_name)\n # old_net.destroy if old_net.active?\n # old_net.undefine\n rescue StandardError\n # Nothing to clean up\n end", "def detach\n SocialNetwork.destroy(params[:id])\n redirect_to :settings\n end", "def delete\n delete_from_server single_url\n end", "def delete\n data = Storm::Base::SODServer.remote_call '/Network/Pool/delete',\n :uniq_id => @uniq_id\n data[:deleted]\n end", "def destroy_google_group\n result = Gandalf::GoogleApiClient.delete_google_group(self.apps_id)\n result.data\n end", "def delete_unused_host_only_networks\n end", "def destroy\n requires :id\n\n service.delete_internet_gateway(id)\n true\n end", "def destroy\n @network_dvr.destroy\n respond_to do |format|\n format.html { redirect_to network_dvrs_url, notice: 'Network dvr was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @usernetworkgroup.destroy\n respond_to do |format|\n format.html { redirect_to usernetworkgroups_url, notice: 'Usernetworkgroup was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @asset = NetDevice.find(params[:id])\n asset_destroy(network_url)\n end", "def detach_network \r\n new_network_id = AlnNetworkId.get_network_id \r\n self.reassign_network_id(new_network_id)\r\n self.reload\r\n self.reassign_layer_id_for_network(new_network_id)\r\n self.reload\r\n end", "def destroy\n @aws_network_acl.destroy\n respond_to do |format|\n format.html { redirect_to aws_network_acls_url, notice: 'Aws network acl was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @auth_ip_address_group.destroy\n head :no_content\n end", "def destroy\n @google_analytic.destroy\n end", "def delete(url)\n do_request(\"delete\", url)\n end", "def delete\n client.delete(url)\n @deleted = true\nend", "def remove_netif(opts)\n\n end", "def remove_netif(opts)\n\n end", "def remove_netif(opts)\n\n end", "def delete!\n Recliner.delete(uri)\n end", "def cleanup_network!\n # Abort if a private network has been defined\n machine.config.vm.networks.each do |cfg|\n return if cfg[0] == :private_network\n end\n machine.communicate.sudo(\"rm -f /etc/nixos/vagrant-network.nix\")\n end", "def delete\n execute_request('DELETE') do |uri, headers|\n HTTP.http_client.delete(uri, header: headers)\n end\n end", "def delete(dn)\n @conn.delete :dn => dn\n end", "def delete\n api_client.delete(url)\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 detach(id, network_id)\n request(:post, \"/network_zones/#{id}/networks/#{network_id}/detach.json\")\n end", "def destroy\n @social_networking.destroy\n\n render json: @social_networking, status: :ok\n end", "def delete\n self.class.delete(url)\n end", "def delete_network_sm_target_group(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'network_id' => options['network_id'],\r\n 'target_group_id' => options['target_group_id']\r\n )\r\n # Prepare query url.\r\n _path_url = '/networks/{networkId}/sm/targetGroups/{targetGroupId}'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'networkId' => options['network_id'],\r\n 'targetGroupId' => options['target_group_id']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.delete(\r\n _query_url\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n end", "def destroy\n @access_internet.destroy\n respond_to do |format|\n format.html { redirect_to access_internets_url, notice: 'Access internet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @search_google.destroy\n respond_to do |format|\n format.html { redirect_to search_googles_url, notice: 'Search google was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def evict\n @network = current_organization.owned_networks.find(params[:id])\n @organization = @network.organizations.find(params[:organization_id])\n \n @network.organizations.delete(@organization) if @network.owner != @organization\n \n if @network.save then\n flash[:notice] = \"#{@organization.name} was removed from the network\"\n redirect_to network_path(@network)\n else\n flash[:notice] = \"Unable to remove #{@organization.name} from the network. Please try again later.\"\n redirect_to network_path(@network)\n end\n end", "def networks_del( *networks )\n\t\t\t@networks = @networks.difference( networks.flatten )\n\t\tend", "def del_host(wspace, address, comm='')\n\t\thost = wspace.hosts.find_by_address_and_comm(address, comm)\n\t\thost.destroy if host\n\tend", "def destroy\n @network_setting = NetworkSetting.find(params[:id])\n @network_setting.destroy\n\n respond_to do |format|\n format.html { redirect_to(network_settings_url) }\n format.xml { head :ok }\n end\n end", "def delete\n @connection.call('GRAPH.DELETE', @graphname)\n rescue Redis::CommandError => e\n raise DeleteError, e\n end", "def delete_address_group(id)\n delete(\"addressGroups/#{id}\")\n end", "def deletesecuritygroup\n if not checkRequirements([\"thezone\",\"thefirewall\"])\n return false\n end\n checkToken(@thezone)\n submit = queryGCE(:path => '/compute/v1beta15/projects/#{@thezone.name}/global/firewalls/#{@thefirewall.serial}', :method => 'delete', :options => '', :acces_token => @thezone.token )\n checkQuery(:type => 'global', :token => @thezone.token, :projectname => @thezone.name, :operationname => submit[\"name\"])\n end", "def delete!\n PoolNode.rmdir(@id)\n super\n Address.delete(@id)\n Subnet.delete(@subnet)\n end", "def remove_network_join(id, network_join_id)\n request(:delete, \"/settings/hypervisor_zones/#{id}/network_joins/#{network_join_id}.json\")\n end", "def destroy\n @comment = @network.comments.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n flash[:notice] = 'Comment destroyed.'\n format.html { redirect_to([:admin, @network,:comments]) }\n format.xml { head :ok }\n end\n end", "def delete!\n server.delete(name)\n end", "def delete_gossip\n\n end", "def destroy\n @network_event.destroy\n respond_to do |format|\n format.html { redirect_to network_events_url, notice: 'Event was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @gnode = Gnode.find(params[:id])\n @gnode.destroy\n\n respond_to do |format|\n format.html { redirect_to gnodes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n requires :id\n \n service.delete_nat_gateway(id)\n true\n end", "def delete_gdom_disk(options)\n gdom_dir = $ldom_base_dir+\"/\"+options['name']\n client_disk = gdom_dir+\"/vdisk0\"\n message = \"Information:\\tRemoving disk \"+client_disk\n command = \"rm #{client_disk}\"\n execute_command(options,message,command)\n return\nend", "def test_delete\n g = [22058]\n Group.delete(g)\n end", "def delete(name)\n request(uri = uri(name), Net::HTTP::Delete.new(uri.request_uri))\n end", "def delete_google_ads_link 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_google_ads_link_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::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def delete(type, id)\n http_delete @target, \"#{type_info(type, :path)}/#{Addressable::URI.encode(id)}\", @auth_header, @zone\n end", "def delete(name, _options = {})\n exec(\"delete\", c: name, p: port)\n end", "def delete(request)\n do_request(request) { |client| client.http_delete }\n end", "def destroy\n @botnet.destroy\n respond_to do |format|\n format.html { redirect_to botnets_url, notice: 'Botnet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @client.delete( name )\n end", "def delete()\n\n client.delete(\"/tasks/#{gid}\") && true\n end", "def delete\n request(:delete)\n end", "def delete_google_place_id(name, place_id)\n update_google_place_id(name, from_place_id: place_id, to_place_id: nil)\n end", "def delete_group(client, options)\n if options[:directory].nil? or options[:group].nil?\n puts \"Missing arguments\"\n return\n end\n\n groups = client.groups\n group = groups.get options[:group]\n group.delete\n puts \"Group deleted.\"\n return\nend", "def delete\n\t\tdb.execute{ \"delete edge #{ref_name} #{rrid}\" }\n\tend" ]
[ "0.7768572", "0.7497454", "0.72349966", "0.7036554", "0.6990914", "0.69321114", "0.692941", "0.69169647", "0.69169647", "0.69169647", "0.69126743", "0.6877859", "0.68085796", "0.6730797", "0.6591075", "0.65406287", "0.65344536", "0.653317", "0.6506465", "0.6481593", "0.6462424", "0.6461751", "0.6453129", "0.6442266", "0.64036834", "0.6372137", "0.6330436", "0.6249325", "0.6239329", "0.6226468", "0.6196442", "0.6193291", "0.61744744", "0.6162885", "0.6160835", "0.61355066", "0.6131454", "0.61243516", "0.61243486", "0.61058444", "0.60678136", "0.60335016", "0.6033036", "0.60259944", "0.6002317", "0.5993956", "0.5984004", "0.596583", "0.5958524", "0.5881026", "0.5872746", "0.58697397", "0.586739", "0.58613926", "0.58557844", "0.58554405", "0.5832087", "0.5832087", "0.5832087", "0.5831966", "0.5815133", "0.5811792", "0.5810696", "0.58085144", "0.5796669", "0.579663", "0.57934284", "0.5789931", "0.5774438", "0.5769518", "0.57654387", "0.5700368", "0.56959325", "0.5686032", "0.5679488", "0.5674218", "0.56729424", "0.56707275", "0.56675196", "0.5658988", "0.5658291", "0.5651096", "0.5647934", "0.564153", "0.56411487", "0.5622784", "0.5620227", "0.561804", "0.55913866", "0.55906427", "0.5576426", "0.55715716", "0.5562364", "0.55478084", "0.55467826", "0.5543323", "0.5534773", "0.5534069", "0.5531831", "0.5531698" ]
0.68946576
11
Insert a google network
def insert_network(name, ip_range) data = false conn = @ec2_main.environment.connection if conn != nil response = conn.insert_network(name, ip_range) if response.status == 200 data = response.body else data = {} end else raise "Connection Error" end return data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save\n requires :display_text, :name, :network_offering_id, :zone_id\n\n options = {\n 'displaytext' => display_text,\n 'name' => name,\n 'zoneid' => zone_id,\n 'networkofferingid' => network_offering_id\n }\n\n response = service.create_network(options)\n merge_attributes(response['createnetworkresponse']['network'])\n end", "def create\n @network = params[:network]\n @account = current_user.accounts[@network]\n raise RuntimeError if @account.nil? # TODO: What should we do here?\n # TODO: This stuff not tested yet.\n @account = SocialNetworkAccount.new(params[:user].merge(:network => @network))\n if @network.valid?\n @network.save!\n flash[:notice] = \"Successfully added the #{@network.name} network\"\n redirect_to session[:referrer]\n else\n render 'network/add'\n end\n end", "def insert(short, url)\n raise NotImplementedError\n end", "def create_network(network_hash)\n post(\"cloud-instances/#{guid}/networks\", network_hash.to_json)\n end", "def create\n @network = current_organization.owned_networks.new(params[:network])\n \n if @network.save then\n redirect_to network_path(@network) \n else\n render :action => 'new'\n end\n end", "def create\n @network = current_user.networks.new(network_params)\n\n respond_to do |format|\n if @network.save\n format.html { redirect_to @network, notice: t(:nertwork_created_ok) }\n format.json { render action: 'show', status: :created, location: @network }\n else\n format.html { render action: 'new' }\n format.json { render json: @network.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_user_network\n self.user_networks.build(:network_id => self.primary_network_id, :primary => true).save unless UserNetwork.where(:network_id => self.primary_network_id, :user_id => self.id).first\n\n n = Network.where(:coded_name => 'site', :type => :site).first\n if n\n self.user_networks.build(:network_id => n.id).save unless UserNetwork.where(:network_id => n.id, :user_id => self.id).first\n end\n end", "def insert_dataset new_dataset_gapi\n execute { service.insert_dataset @project, new_dataset_gapi }\n end", "def create_oauth2\n @network = params[:network]\n if params[:denied]\n # User did not allow us access to their OAuth account.\n flash[:notice] = \"You did not authorize us to access your #{@network} account\"\n redirect_to session[:referrer]\n return\n end\n @account = current_user.accounts[@network]\n raise RuntimeError if @account.nil? # TODO: What should we do here?\n params[:callback_url] = network_oauth2_url(:network => @network)\n if @account.verify_oauth_result(@account, params)\n flash[:notice] = \"Successfully added the #{@network} network.\"\n redirect_to session[:referrer]\n else\n flash[:notice] = \"Something went wrong adding the #{@network} network\"\n redirect_to session[:referrer]\n end\n rescue OAuth2::AccessDenied => e # TODO: Handle OAuth2::ErrorWithResponse and OAuth2::HTTPError as well.\n flash[:notice] = \"You did not authorize us to access your #{@network} account!\"\n redirect_to session[:referrer]\n end", "def create_social_network(user)\n user.user_social_networks.create(uid: session[:omniauth]['uid'], provider: session[:omniauth]['provider'])\n sign_in_and_redirect user, event: :authentication\n session.delete(:omniauth)\n end", "def add_to_database\n Link.add({\"assignment_id\" => \"#{self.assignment_id}\", \"link\" => \"#{self.link}\", \"type\" => \"#{self.type}\"})\n end", "def create\n @social_network = SocialNetwork.new(params[:social_network])\n\n respond_to do |format|\n if @social_network.save\n format.html { redirect_to @social_network, notice: 'Social network was successfully created.' }\n format.json { render json: @social_network, status: :created, location: @social_network }\n else\n format.html { render action: \"new\" }\n format.json { render json: @social_network.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_org_network_to_vapp(vAppId, network, config)\n network_section = generate_network_section(vAppId, network, config, :external)\n add_network_to_vapp(vAppId, network_section)\n end", "def new_playgroup(db, name, kids, address)\r\n\t\tdb.execute(\"INSERT INTO playgroups (name, kids, address) VALUES (?,?,?)\", [name, kids, address])\r\n\tend", "def create_oauth\n @network = params[:network]\n if params[:denied]\n # User did not allow us access to their OAuth account.\n flash[:notice] = \"You did not authorize us to access your #{@network} account\"\n redirect_to session[:referrer]\n return\n end\n @account = current_user.accounts[@network]\n raise RuntimeError if @account.nil? # TODO: What should we do here?\n if @account.verify_oauth_result(@account, params)\n flash[:notice] = \"Successfully added the #{@network} network\"\n redirect_to session[:referrer]\n else\n flash[:notice] = \"Something went wrong adding the #{@network} network\"\n redirect_to session[:referrer]\n end\n rescue OAuth::Unauthorized => e # TODO: Handle OAuth::Problem and OAuth:Error as well.\n flash[:notice] = \"You did not authorize us to access your #{@network} account!\"\n redirect_to session[:referrer]\n end", "def insert_url(con,url,irc_handle,channel,title)\n title=con.escape_string(title)\n\turl=con.escape_string(url)\n\tchannel_id=get_channel_id(con,channel)\n irc_handle_id=get_irc_handle_id(con,irc_handle)\n\n sql=\"INSERT into irc_url (url,handleid,channelid,title) VALUES ('#{url}','#{irc_handle_id}','#{channel_id}','#{title}');\"\n res=con.query(sql)\nend", "def add_url(url, shortcode)\n @db.execute \"INSERT INTO pairings VALUES('#{url}', '#{shortcode}')\"\n return true\n rescue SQLite3::Exception => e\n puts 'Unable to add url:'\n puts e\n return false\n end", "def create\n \tuser = User.find(params[:user_id])\n net_cat = NetworkCategory.find(params[:net_cat])\n network = Network.new(name: params[:network_name], desc: params[:desc],\n network_type: params[:network_type])\n network.user = user\n network.network_category = net_cat\n @status = network.save!\n respond_to do |format|\n format.json\n end\n end", "def add_internal_network(network)\n @data['internalNetworkUris'] << network['uri'] unless @data['internalNetworkUris'].include?(network['uri'])\n end", "def insert_address(name,region)\n data = false\n conn = @ec2_main.environment.connection\n if conn != nil\n response = conn.insert_address(name,region)\n if response.status == 200\n data = response.body\n else\n data = {}\n end\n else\n raise \"Connection Error\"\n end\n return data\n end", "def insert_table dataset_id, new_table_gapi\n execute { service.insert_table @project, dataset_id, new_table_gapi }\n end", "def attach(id, network_id)\n request(:post, \"/network_zones/#{id}/networks/#{network_id}/attach.json\")\n end", "def post_network(request)\n # --- Create the new Instance ---\n network = VirtualNetworkOCCI.new(\n VirtualNetwork.build_xml,\n @client,\n request.body,\n @config[:template_location])\n\n # --- Generate the template and Allocate the new Instance ---\n template = network.to_one_template\n return template, 500 if OpenNebula.is_error?(template)\n\n rc = network.allocate(template, @config[:cluster_id]||ClusterPool::NONE_CLUSTER_ID)\n if OpenNebula.is_error?(rc)\n return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]\n end\n\n # --- Prepare XML Response ---\n network.info\n return to_occi_xml(network, :code=>201)\n end", "def insert_firewall(firewall_name, opts = {})\n if opts.key?(:network) && !opts[:network].empty?\n unless opts[:network].start_with?(\"http://\", \"https://\", \"projects/\", \"global/\")\n opts[:network] = \"projects/#{@project}/global/networks/#{opts[:network]}\"\n end\n end\n\n opts = opts.select { |k, _| INSERTABLE_FIREWALL_FIELDS.include? k }\n .merge(:name => firewall_name)\n\n @compute.insert_firewall(\n @project, ::Google::Apis::ComputeV1::Firewall.new(**opts)\n )\n end", "def insert_object g\n @objects.add g\n end", "def connect_games_and_network\n game_results.each do |game|\n game.neural_network_ids << @neural_network.id\n game.save\n @neural_network.game_ids << game.id\n end\n @neural_network.save\n end", "def create\n @network = Network.new(network_params)\n\n respond_to do |format|\n if @network.save\n format.html { redirect_to @network, notice: 'Network was successfully created.' }\n format.json { render :show, status: :created, location: @network }\n else\n format.html { render :new }\n format.json { render json: @network.errors, status: :unprocessable_entity }\n end\n end\n end", "def addurl(uid, loc)\n @conn.exec_prepared(\"insert_url\", [uid, loc])\n end", "def addurl(uid, loc)\n @conn.exec_prepared(\"insert_url\", [uid, loc])\n end", "def create\n @network = Network.new(network_params)\n\n\n respond_to do |format|\n if @network.save\n format.html { redirect_to @network, notice: 'Network was successfully created.' }\n format.json { render action: 'show', status: :created, location: @network }\n else\n format.html { render action: 'new' }\n format.json { render json: @network.errors, status: :unprocessable_entity }\n end\n end\n end", "def insert(**opts)\n add(**opts)\n save!\n end", "def create\n @play_network = PlayNetwork.new(play_network_params)\n\n respond_to do |format|\n if @play_network.save\n format.html { redirect_to @play_network, notice: 'Play network was successfully created.' }\n format.json { render :show, status: :created, location: @play_network }\n else\n format.html { render :new }\n format.json { render json: @play_network.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @network = Network.new(params[:network])\n @network.owner = current_user.person\n\n respond_to do |format|\n if @network.save\n format.html { redirect_to @network, notice: \"#{t('network')} was successfully created.\" }\n format.json { render json: @network, status: :created, location: @network }\n else\n format.html { render action: \"new\" }\n format.json { render json: @network.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_ce_group\n self.refresh_access_token!\n\n haml_template = File.read(File.join(TEMPLATES_DIR, 'group.xml.haml'))\n request_body = Haml::Engine.new(haml_template, remove_whitespace: true).render(Object.new)\n\n @response = @oauth_access_token.post(\n 'https://www.google.com/m8/feeds/groups/default/full',\n {\n body: request_body,\n headers: {\n 'Content-type' => 'application/atom+xml',\n 'GData-Version' => '3.0'\n }\n }\n )\n\n group_id = GROUP_REGEX.match(@response.body)[1]\n\n @response.status == 201 ? group_id : nil\n end", "def create(network_id, options = {})\n response = request(:post, \"/settings/networks/#{network_id}/ip_addresses.json\", default_params(options))\n end", "def create\n @network = Network.new(network_params)\n\n respond_to do |format|\n if @network.save\n format.html { redirect_to @network, notice: 'Network was successfully created.' }\n format.json { render action: 'show', status: :created, location: @network }\n else\n format.html { render action: 'new' }\n format.json { render json: @network.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n \t@title = \"Create Networks\"\n @network = Network.new(params[:network])\n respond_to do |format|\n if @network.save\n flash[:notice] = 'Network was successfully created.'\n format.html { redirect_to(@network) }\n format.xml { render :xml => @network, :status => :created, :location => @network }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @network.errors, :status => :unprocessable_entity }\n end\n end\n end", "def add_geo(db, geo_name, company)\n db.execute(\"INSERT INTO geologists (name, company) \n VALUES (?, ?)\", [geo_name, company])\nend", "def create\n if params[:dhcp_server_id] && @dhcp_server = DhcpServer.find_by_id(params[:dhcp_server_id])\n @shared_network = @dhcp_server.shared_networks.new(shared_network_params)\n end\n\n respond_to do |format|\n if @shared_network.save\n format.html { redirect_to @shared_network, notice: \"Shared network was successfully created.\" }\n format.json { render :show, status: :created, location: @shared_network }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @shared_network.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_host_only_network(options)\n end", "def insert 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_insert_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::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def add_bridged_network_to_vbox_vm(client_name,nic_name)\n message = \"Adding:\\tBridged network \"+nic_name+\" to \"+client_name\n command = \"VBoxManage modifyvm #{client_name} --nic1 bridged --bridgeadapter1 #{nic_name}\"\n execute_command(message,command)\n return\nend", "def insert request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n uri, body, query_string_params = transcode_insert_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 insert request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n uri, body, query_string_params = transcode_insert_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 network(type, options=nil); end", "def network(type, options=nil); end", "def insert()\n\n end", "def network_params\n params.require(:network).permit(:name, :group)\n end", "def add_to_apps_network\n raise \"This method can only be called if apps_network_id is set\" unless apps_network_id\n visit \"#{TestChamber.target_url}/dashboard/tools/apps_network_association/#{apps_network_id}\"\n fill_in('app_ids', :with => id)\n click_button('Add')\n end", "def new_address\n @client.new_address(name)\n end", "def setup_google_group\n result = Gandalf::GoogleApiClient.insert_google_group({\n \"email\" => self.apps_email || self.set_apps_email,\n \"name\" => self.name,\n \"description\" => self.description\n })\n \n # Checks if a conflict exists in the database.\n if result.status == 409\n result = Gandalf::GoogleApiClient.get_google_group(self.apps_email)\n elsif result.status >= 400\n # Do some error handling...\n return false\n end\n # Set the apps_id and apps_email from the returned object.\n self.apps_id = result.data.id\n self.apps_email = result.data.email\n \n end", "def add_site(feed_url,feed_name,feed_type,feed_interval,feed_settings)\n\tnew_site_base = \"insert into feeds values(\"\n\tnew_site_base += \"\\\"\"+feed_url+\"\\\",\\\"\"+feed_name+\"\\\",\"\n\tnew_site_base += feed_type+\",0,\"+feed_interval+\",\"+feed_settings\n\tnew_site_base += \");\"\n\tputs new_site_base\n\t$db.execute(new_site_base)\nend", "def create_fake_network_node(vapp_networks, network_name)\n parent_section = vapp_networks.css('NetworkConfigSection').first\n new_network = Nokogiri::XML::Node.new \"NetworkConfig\", parent_section\n new_network['networkName'] = network_name\n placeholder = Nokogiri::XML::Node.new \"PLACEHOLDER\", new_network\n new_network.add_child placeholder\n parent_section.add_child(new_network)\n vapp_networks\n end", "def associate_address!(conn, server, pool_name = nil)\n pool_name ||= conn.addresses.get_address_pools.first['name']\n ip = conn.addresses.create(:pool => pool_name)\n ip.server = server\n server.reload\n end", "def add_to_apps_network\n visit \"#{TestChamber.target_url}/dashboard/tools/apps_network_association/#{apps_network_id}\"\n fill_in('app_ids', :with => id)\n click_button('Add')\n end", "def ensure_network\n ensure_valid_network\n if network.nil?\n valid_network.build_network(:tag => \"#{self.tag} View\")\n end\n end", "def network(player)\n @networks[player] = true\n end", "def address_for(network); end", "def add_project(db, proj_name, client)\n db.execute(\"INSERT INTO projects (name, client) VALUES (?, ?)\", [proj_name, client])\nend", "def add_nonbridged_network_to_vbox_vm(client_name,nic_name)\n message = \"Adding:\\t\\tNetwork \"+nic_name+\" to \"+client_name\n if nic_name.match(/vboxnet/)\n command = \"VBoxManage modifyvm #{client_name} --hostonlyadapter1 #{nic_name} ; VBoxManage modifyvm #{client_name} --nic1 hostonly\"\n else\n command = \"VBoxManage modifyvm #{client_name} --nic1 #{nic_name}\"\n end\n execute_command(message,command)\n return\nend", "def add_region(db, state,country)\n\tdb.execute(\"INSERT INTO region (state, country) VALUES(?,?)\", [state,country])\nend", "def add_network_to_vapp(vAppId, network_section)\n params = {\n 'method' => :put,\n 'command' => \"/vApp/vapp-#{vAppId}/networkConfigSection\"\n }\n\n response, headers = send_request(params, network_section, \"application/vnd.vmware.vcloud.networkConfigSection+xml\")\n\n task_id = headers[:location].gsub(/.*\\/task\\//, \"\")\n task_id\n end", "def create\n @comment = @network.comments.build(params[:comment])\n\n respond_to do |format|\n if @comment.save\n flash[:notice] = 'Comment was successfully created.'\n format.html { redirect_to([:admin, @network, :comments]) }\n format.xml { render :xml => @comment, :status => :created, :location => @comment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @comment.errors, :status => :unprocessable_entity }\n end\n end\n end", "def createPrivateNetworks(name='')\n opt = @options.merge!({ :body => { :name => name } })\n\n self.class.post(\"/privateNetworks\", opt)\n end", "def network=(value)\n @root[\"network\"] = value\n end", "def create\n @social_network = SocialNetwork.new(admin_social_network_params)\n\n respond_to do |format|\n if @social_network.save\n format.html { redirect_to admin_videos_url, notice: 'Social network was successfully created.' }\n format.json { render :show, status: :created, location: @social_network }\n else\n format.html { render :new }\n format.json { render json: @social_network.errors, status: :unprocessable_entity }\n end\n end\n end", "def ensure_valid_network\n if valid_network.nil?\n self.build_valid_network(:tag => \"#{self.tag} Asset Config Network\")\n end\n end", "def newgroup(g, args)\n\t\tquery(\"\n\t\t\tINSERT INTO newsgroups\n\t\t\tVALUES ('%s', '%s', '%s', '%s', %d, '%s')\n\t\t\", g, args[:mailto], args[:nntp], args[:title],\n\t\targs[:moderated] ? 1 : 0, args[:pgpkey]) {\n\t\t\tyield true\n\t\t}\n\tend", "def add_place(place)\n if place.validate && [email protected]?(place.name) \n @places[place.name] = place.id\n @objects[place.id] = place\n place.net = self\n return place.id\n end\n changed_structure\n return false\n end", "def addhost(config)\n\n uri = URI.parse(\"#{config[\"addurl\"]}\")\n node = { \"EntityType\" => \"Orion.Nodes\", \"IPAddress\" => \"#{config[\"ipaddr\"]}\",\n \"Caption\"=> \"#{config[\"nodename\"]}\", \"DynamicIP\" => \"False\", \"EngineID\" => \"#{config[\"engineid\"]}\", \n \"Status\" => 1, \"UnManaged\" => \"False\", \"Allow64BitCounters\" => \"True\", \n \"SysObjectID\" => \"\", \"MachineType\" => \"\", \"VendorIcon\" => \"\", \n \"ObjectSubType\" => \"SNMP\", \"SNMPVersion\" => 2, \"Community\" => \"#{config[\"community\"]}\",\n }\n\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Post.new(uri.request_uri, initheader = {'Content-Type' =>'application/json'})\n request.body = node.to_json\n request.basic_auth(\"#{config[\"username\"]}\", \"#{config[\"password\"]}\")\n\n response = http.request(request)\nend", "def set_network\n @network = Network.find(params[:id])\n end", "def insert_routine dataset_id, new_routine_gapi\n execute { service.insert_routine @project, dataset_id, new_routine_gapi }\n end", "def add(net_or_name)\n command = ['VBoxManage', 'dhcpserver', 'add', '--ip', ip,\n '--netmask', netmask, '--lowerip', start_ip, '--upperip', end_ip,\n '--enable']\n if net_or_name.kind_of? VirtualBox::Net\n command.push '--ifname', net_or_name.name\n else\n command.push '--netname', net_or_name\n end\n\n VirtualBox.run_command! command\n self\n end", "def insert_link(url, comment)\n open_db { |db|\n db.execute(\"insert into links (url, comment, time) values ('#{url}', '#{comment}', datetime('now', 'localtime'));\") \n }\nend", "def upsert_nodes(conn, gtfs_id, layer_name)\n layer_id = find_layer_id_from_name(conn, layer_name)\n upsert_stop_nodes_and_stop_node_data(conn, gtfs_id, layer_id)\n upsert_route_nodes(conn, gtfs_id, layer_id)\nend", "def create_nonadword_url(url, position)\n\t\tNonAdwordUrl.find_or_create_by(url: url,\n\t\t\t\t\t\t\t\t\t\t position: position,\n\t\t\t\t\t\t\t\t\t\t google_search_page_id: reload.google_search_page.id)\n\tend", "def connect_gplus\n\t auth = request.env[\"omniauth.auth\"]\n\t current_member.gplus_id = auth[\"uid\"]\n current_member.gplus_token = auth.credentials.token\n if auth.info.image.present?\n current_member.username = auth.info.name\n current_member.img_url = auth.info.image\n end\n current_member.gplus_refresh_token = auth.credentials.refresh_token\n current_member.gplus_token_expires_at = auth.credentials.expires_at\n\t current_member.save\n\t GoogleModel.store_urls(current_member)\n\t redirect_to members_social_sign_up_path\t\n end", "def add_site(n, site_name)\n site = Site.new(name: site_name, org_type: 'city', status: 'active')\n lat, lng = Geocoder.coordinates(@zip_xpath[n].text)\n site.contacts.build(city: @city_xpath[n].text, state: @state_xpath[n].text,\n zip: @zip_xpath[n].text, country: @country_xpath[n].text, lat: lat, lng: lng)\n site.save ? site.id : nil\n end", "def add_internal_network_to_vapp(vAppId, network, config)\n network_section = generate_network_section(vAppId, network, config, :internal)\n add_network_to_vapp(vAppId, network_section)\n end", "def create\n @networking = Networking.new(networking_params)\n\n respond_to do |format|\n if @networking.save\n format.html { redirect_to @networking, notice: 'Networking was successfully created.' }\n format.json { render :show, status: :created, location: @networking }\n else\n format.html { render :new }\n format.json { render json: @networking.errors, status: :unprocessable_entity }\n end\n end\n end", "def save\n con = Group.open_connection\n\n if (self.groupid)\n # update\n sql = \"UPDATE groups SET groupname='#{self.groupname}', grouptype='#{self.grouptype}' WHERE groupid = #{self.groupid}\"\n else\n # add\n sql = \"INSERT INTO groups (groupname, grouptype) VALUES ('#{self.groupname}', '#{self.grouptype}')\"\n end\n #\n #\n con.exec(sql)\n #\n end", "def insert_record(name, type, ttl, content)\n records_table.insert(\n :domain_id => domain.id,\n :name => name,\n :type => type, \n :ttl => ttl, \n :content => content,\n :change_date => Time.now.to_i\n )\n end", "def create_network(name, tenant, admin_state_up = true)\n data = {\n 'network' => {\n 'name' => name,\n 'tenant_id' => tenant,\n 'admin_state_up' => admin_state_up\n } \n }\n return post_request(address(\"networks\"), data, @token)\n end", "def create_network_for_import(\n opts\n )\n nic = opts[:nic]\n ccr_ref = opts[:ccr_ref]\n ccr_name = opts[:ccr_name]\n vc_uuid = opts[:vc_uuid]\n vcenter_instance_name = opts[:vcenter_instance_name]\n dc_name = opts[:dc_name]\n template_ref = opts[:template_ref]\n dc_ref = opts[:dc_ref]\n vm_id = opts[:vm_id]\n hpool = opts[:hpool]\n vi_client = opts[:vi_client]\n\n config = {}\n config[:refs] = nic[:refs]\n\n # Let's get the OpenNebula hosts ids\n # associated to the clusters references\n config[:one_ids] = nic[:refs].map do |ref|\n VCenterDriver::VIHelper\n .find_by_ref(\n OpenNebula::HostPool,\n 'TEMPLATE/VCENTER_CCR_REF',\n ref,\n vc_uuid,\n hpool\n )['CLUSTER_ID'] rescue -1\n end\n\n if vm?\n unmanaged = 'wild'\n else\n unmanaged = 'template'\n end\n\n net = VCenterDriver::Network\n .new_from_ref(\n nic[:net_ref],\n vi_client\n )\n if net\n vid = VCenterDriver::Network.retrieve_vlanid(net.item)\n end\n case nic[:pg_type]\n # Distributed PortGroups\n when VCenterDriver::Network::NETWORK_TYPE_DPG\n config[:sw_name] =\n nic[:network]\n .config\n .distributedVirtualSwitch\n .name\n # For DistributedVirtualPortgroups\n # there is networks and uplinks\n config[:uplink] = false\n # NSX-V PortGroups\n when VCenterDriver::Network::NETWORK_TYPE_NSXV\n config[:sw_name] =\n nic[:network]\n .config\n .distributedVirtualSwitch\n .name\n # For NSX-V ( is the same as\n # DistributedVirtualPortgroups )\n # there is networks and uplinks\n config[:uplink] = false\n\n host_id = vi_client.instance_variable_get '@host_id'\n\n begin\n nsx_client = NSXDriver::NSXClient.new_from_id(host_id)\n rescue StandardError\n nsx_client = nil\n end\n\n if !nsx_client.nil?\n nsx_net = NSXDriver::VirtualWire\n .new_from_name(nsx_client, nic[:net_name])\n config[:nsx_id] = nsx_net.ls_id\n config[:nsx_vni] = nsx_net.ls_vni\n config[:nsx_tz_id] = nsx_net.tz_id\n end\n # Standard PortGroups\n when VCenterDriver::Network::NETWORK_TYPE_PG\n # There is no uplinks for standard portgroups,\n # so all Standard\n # PortGroups are networks and no uplinks\n config[:uplink] = false\n config[:sw_name] = VCenterDriver::Network\n .virtual_switch(nic[:network])\n # NSX-T PortGroups\n when VCenterDriver::Network::NETWORK_TYPE_NSXT\n config[:sw_name] = \\\n nic[:network].summary.opaqueNetworkType\n # There is no uplinks for NSX-T networks,\n # so all NSX-T networks\n # are networks and no uplinks\n config[:uplink] = false\n\n host_id = vi_client.instance_variable_get '@host_id'\n\n begin\n nsx_client = NSXDriver::NSXClient.new_from_id(host_id)\n rescue StandardError\n nsx_client = nil\n end\n\n if !nsx_client.nil?\n nsx_net =\n NSXDriver::OpaqueNetwork\n .new_from_name(nsx_client, nic[:net_name])\n\n config[:nsx_id] = nsx_net.ls_id\n config[:nsx_vni] = nsx_net.ls_vni\n config[:nsx_tz_id] = nsx_net.tz_id\n end\n else\n raise \"Unknown network type: #{nic[:pg_type]}\"\n end\n\n import_opts = {\n :network_name=> nic[:net_name],\n :sw_name=> config[:sw_name],\n :network_ref=> nic[:net_ref],\n :network_type=> nic[:pg_type],\n :ccr_ref=> ccr_ref,\n :ccr_name=> ccr_name,\n :vcenter_uuid=> vc_uuid,\n :vcenter_instance_name=> vcenter_instance_name,\n :dc_name=> dc_name,\n :unmanaged=> unmanaged,\n :template_ref=> template_ref,\n :dc_ref=> dc_ref,\n :template_id=> vm_id\n }\n\n if nic[:pg_type] ==\n VCenterDriver::Network::NETWORK_TYPE_NSXV ||\n nic[:pg_type] ==\n VCenterDriver::Network::NETWORK_TYPE_NSXT\n import_opts[:nsx_id] = config[:nsx_id]\n import_opts[:nsx_vni] = config[:nsx_vni]\n import_opts[:nsx_tz_id] = config[:nsx_tz_id]\n end\n\n if vid\n vlanid = VCenterDriver::Network.vlanid(vid)\n\n # we have vlan id\n if /\\A\\d+\\z/.match(vlanid)\n import_opts[:vlanid] = vlanid\n end\n end\n\n # Prepare the Virtual Network template\n one_vnet = VCenterDriver::Network.to_one_template(import_opts)\n\n # always has to be created because of\n # templates when they are instantiated\n ar_tmp = ''\n ar_tmp << \"AR=[\\n\"\n ar_tmp << \"TYPE=\\\"ETHER\\\",\\n\"\n ar_tmp << \"SIZE=255\\n\"\n ar_tmp << \"]\\n\"\n\n if vm?\n ar_tmp << create_ar(nic, false, nic[:ipv4]) if nic[:ipv4]\n\n if nic[:ipv6]\n ar_tmp << create_ar(nic, false, nil, nic[:ipv6])\n end\n\n ar_tmp << create_ar(nic, true) if !nic[:ipv4] && !nic[:ipv6]\n end\n\n one_vnet[:one] << ar_tmp\n config[:one_object] = one_vnet[:one]\n _cluster_id = VCenterDriver::VIHelper\n .get_cluster_id(config[:one_ids])\n\n one_vn = VCenterDriver::Network.create_one_network(config)\n VCenterDriver::VIHelper.clean_ref_hash\n one_vn.info\n\n # Wait until the virtual network is in ready state\n t_start = Time.now\n error = false\n timeout = 30\n\n while Time.now - t_start < timeout\n begin\n if one_vn.short_state_str == 'rdy'\n error = false\n break\n end\n rescue StandardError\n error = true\n end\n\n sleep 1\n one_vn.info\n end\n\n if error\n error_msg = \"VNET #{one_vn.id} in state \"\n error_msg += \"#{one_vn.short_state_str}, aborting import\"\n raise error_msg\n end\n\n one_vn\n end", "def create\n params[:user_network][\"wifi_network_attributes\"][\"postcode\"] = params[:user_network][\"wifi_network_attributes\"][\"postcode\"].delete(' ').upcase\n\n wifi_network_hash = {\n ssid: params[:user_network][\"wifi_network_attributes\"][\"ssid\"],\n postcode: params[:user_network][\"wifi_network_attributes\"][\"postcode\"],\n password: params[:user_network][\"wifi_network_attributes\"][\"password\"]\n }\n existing_wifi_network = WifiNetwork.where(wifi_network_hash).first\n\n @user_network = UserNetwork.new(params[:user_network])\n @user_network.wifi_network_id = existing_wifi_network.id if existing_wifi_network\n\n respond_to do |format|\n if @user_network.save\n format.html { redirect_to @user_network, notice: 'User network was successfully created.' }\n format.json { render json: @user_network, status: :created, location: @user_network }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_network.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_nic(options)\n Nic.create(options.merge(:server_id => self.id))\n end", "def net\n commit_summary(:net)\n end", "def do_insert options = {}\n\t\t\t\tif !options[:local]\n\t\t\t\t\tattr_hash = build_attr_hash\n\t\t\t\t\tid = SecureRandom.hex\n\t\t\t\t\t@@client.call(\"/#{self.class.to_s.downcase}/insert\", self.method(:handle_update), [{_id: id}.merge(attr_hash)])\n\t\t\t\tend\n\n\t\t\t\tsuper\n\t\t\tend", "def create_adword_url(url, position)\n\t\tAdwordUrl.find_or_create_by(url: url,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tposition: position,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgoogle_search_page_id: reload.google_search_page.id)\n\tend", "def set_network\n @network = Network.find(params[:id])\n end", "def set_network\n @network = Network.find(params[:id])\n end", "def set_network\n @network = Network.find(params[:id])\n end", "def set_network\n @network = Network.find(params[:id])\n end", "def set_network\n @network = Network.find(params[:id])\n end", "def update_network(network_id, netinfo)\n logger.debug \"[#{__method__}] #{network_id}, #{netinfo}\"\n #logger.debug \"[#{__method__}] #{netinfo}\"\n logger.info \"[#{__method__}] Network ID ignored (got from URL)\" if netinfo.id\n logger.info \"[#{__method__}] Network owner ignored (change not implemented)\" if netinfo.user\n\n vn_generic = OpenNebula::VirtualNetwork.build_xml(network_id)\n vn = OpenNebula::VirtualNetwork.new(vn_generic, @ctx)\n check(vn.info)\n authz(Set[:update], vn, netinfo)\n\n if netinfo.title\n logger.info \"[#{__method__}] renaming network #{network_id} to '#{netinfo.title}'\"\n check(vn.rename(netinfo.title))\n end\n\n range = netinfo.range\n if range\n ar_id = nil\n vn.each('AR_POOL/AR') do |ar|\n ar_id = ar['AR_ID']\n break\n end\n if ar_id\n template = raw2template_range(range, 'AR_ID' => ar_id)\n logger.debug \"[#{__method__}] address range template: #{template}\"\n logger.info \"[#{__method__}] updating address range #{ar_id} in network #{network_id}\"\n check(vn.update_ar(template))\n else\n # try to add address range if none found (should not happen with NOW-managed networks),\n # but that requires ADMIN NET privileges in OpenNebula\n template = raw2template_range(range, {})\n logger.debug \"[#{__method__}] address range template: #{template}\"\n logger.info \"[#{__method__}] adding address range to network #{network_id}\"\n check(vn.add_ar(template))\n end\n end\n\n # change also all non-OpenNebula attributes inside network template\n template = raw2template_network(netinfo, {}, vn)\n logger.debug \"[#{__method__}] append template: #{template}\"\n\n check(vn.update(template, true))\n id = vn.id.to_s\n logger.info \"[#{__method__}] updated network: #{id}\"\n\n id\n end", "def insert()\n\t\[email protected](\"insert into ausgaben (jahr, monat, name, betrag, gemeinsam, tags) values(:jahr, :monat, :name, :betrag, :gemeinsam, :tags)\", @options)\n\tend", "def create_dpg(one_vnet, dc, cluster, vi_client)\n begin\n # Get parameters needed to create the network\n pnics = one_vnet['TEMPLATE/PHYDEV']\n pg_name = one_vnet['TEMPLATE/BRIDGE']\n sw_name = one_vnet['TEMPLATE/VCENTER_SWITCH_NAME']\n mtu = one_vnet['TEMPLATE/MTU']\n vlan_id = one_vnet['VLAN_ID'] || 0\n\n if one_vnet['TEMPLATE/VCENTER_SWITCH_NPORTS']\n nports = one_vnet['TEMPLATE/VCENTER_SWITCH_NPORTS']\n else\n nports = 8\n end\n\n dc.lock\n net_folder = dc.network_folder\n net_folder.fetch!\n\n # Get distributed port group if it exists\n dpg = dc.dpg_exists(pg_name, net_folder)\n\n # Disallow changes of switch name for existing pg\n if dpg && dc.pg_changes_sw?(dpg, sw_name)\n err_msg = \"The port group's switch name can not be modified\"\\\n \" for OpenNebula's virtual network.\"\n raise CreateNetworkError, err_msg\n end\n\n if !dpg\n # Get distributed virtual switch if it exists\n dvs = dc.dvs_exists(sw_name, net_folder)\n\n if !dvs\n dvs = dc.create_dvs(sw_name, pnics, mtu)\n end\n # Creates distributed port group\n new_dpg = dc.create_dpg(dvs, pg_name, vlan_id, nports)\n # Attach dpg to esxi hosts\n cluster['host'].each do |host|\n begin\n esx_host = VCenterDriver::ESXHost\n .new_from_ref(host._ref, vi_client)\n esx_host.lock\n if dvs\n pnics_available = nil\n if pnics && !pnics.empty?\n pnics_available = esx_host.get_available_pnics\n end\n esx_host.assign_proxy_switch(dvs,\n sw_name,\n pnics,\n pnics_available)\n end\n rescue StandardError => e\n raise e\n ensure\n esx_host.unlock if esx_host\n end\n end\n else\n err_msg = \"Port group #{pg_name} already exists\"\n raise CreateNetworkError, err_msg\n end\n new_dpg\n ensure\n dc.unlock if dc\n end\nend", "def add_to_database\n CONNECTION.execute(\"INSERT INTO assignments (general_info, github_link, co_workers) VALUES ('#{self.general_info}', '#{self.github_link}', '#{self.co_workers}');\")\n @id = CONNECTION.last_insert_row_id\n \n return self\n end", "def createNetwork\n require 'rest_client'\n require 'uri'\n\n if @role.nil? and !current_actor.superadmin\n json_response({ message: \"You don't have permission to create networks\" }, :unauthorized)\n return\n end\n\n # Service name in the query\n networkName = params[\"network_name\"]\n\n # Env variables for Manager host and port\n serviceManagerHost = Settings.service_manager_host\n serviceManagerPort = Settings.service_manager_port.to_s\n serviceManagerURI = 'http://' + serviceManagerHost + ':' + serviceManagerPort + '/v1/network'\n\n # Create request for Service Manager\n stack = {\n 'name' => networkName,\n 'engine-url' => @cluster.endpoint,\n 'ca-cert' => @cluster.ca,\n 'cert' => @cluster.cert,\n 'cert-key' => @cluster.key\n }.to_json\n\n begin\n response = RestClient.post(\n serviceManagerURI,\n stack,\n 'Accept' => 'application/json',\n 'Content-Type' => 'application/json'\n )\n puts \"Deploy Response: \" + response\n json_response(response, :created)\n rescue Exception => e\n # If error, respond with it\n puts e\n json_response({message: e}, :unprocessable_entity)\n end\n end", "def insert\n array = [[@name, @tagline, @github, @twitter, @blog_url, @image_url, @biography]]\n ins = DB[:conn].prepare(\"INSERT INTO students (name, tagline, github, twitter, blog_url, image_url, biography) VALUES (?, ?, ?, ?, ?, ?, ?);\")\n array.each { |s| ins.execute(s)}\n self.id = DB[:conn].execute(\"SELECT last_insert_rowid() FROM students;\")[0][0]\n #ask steven re. index figures\n #inserting data into an instance\n end" ]
[ "0.61276823", "0.57330877", "0.5642036", "0.5594418", "0.5558452", "0.5539666", "0.55309004", "0.5499608", "0.5420942", "0.54077256", "0.5365044", "0.5345096", "0.5337898", "0.53363234", "0.5324854", "0.53011876", "0.5213359", "0.5208594", "0.5203045", "0.51862115", "0.5174618", "0.5171359", "0.51506466", "0.5138879", "0.51137996", "0.50906557", "0.5075881", "0.50664747", "0.50664747", "0.5060696", "0.505843", "0.5053878", "0.5051515", "0.5029156", "0.50278556", "0.5022168", "0.50175244", "0.5013644", "0.50086033", "0.4991836", "0.49866962", "0.49862486", "0.4984432", "0.4984432", "0.49787706", "0.49787706", "0.4974187", "0.4968579", "0.49676478", "0.496718", "0.49514842", "0.49409723", "0.4940363", "0.49326885", "0.4925694", "0.49238497", "0.49090928", "0.4908987", "0.490814", "0.49057657", "0.49042884", "0.48653823", "0.48617086", "0.48590213", "0.48579845", "0.48533124", "0.48494184", "0.48486254", "0.4823134", "0.4822511", "0.4817624", "0.48091355", "0.48089898", "0.4804278", "0.48035192", "0.4802962", "0.48026145", "0.47987545", "0.47907335", "0.47747928", "0.47714093", "0.47699186", "0.4769715", "0.47691318", "0.4766431", "0.47621804", "0.47588533", "0.47567287", "0.47527012", "0.47513226", "0.47513226", "0.47513226", "0.47513226", "0.47513226", "0.4748698", "0.47441965", "0.47428605", "0.47370383", "0.47339004", "0.4732574" ]
0.6110077
1
GET /collections GET /collections.json
def index @gallery = Gallery.find(params["gallery_id"]) @collections = @gallery.collections.active end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collection(slug, options)\n _get(\"v1/collections/\" + slug, options)\n end", "def index\n @collections = current_user.collections.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @collections }\n end\n end", "def list\n @collections = Admin::Collection.names\n\n render json: { collections: @collections }\n end", "def get_user_collections()\n uri = build_uri('info/collections')\n @tools.process_get_request(uri, @user_obj.encrypted_login, @user_pwd).body\n end", "def available_collections\n api = API.new\n params = {:limit => 9999, :preserve_original => true}\n response = api.send_and_receive('collections', {:params => params})\n response.map {|n| [n['title'], n['identifier']]}\n end", "def index\n\t\tif user_signed_in? && (current_user.has_role? :admin)\n\t\t\t@collections = Collection.order(\"created_at DESC\")\n\t\telse\n\t\t\t@collections = Collection.where(published: true).order(\"created_at DESC\")\n\t\tend\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: @collections }\n\t\tend\n\tend", "def index\n @collections = current_user.collections\n end", "def show\n\n @collection = @current_user.collections.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @collection }\n end\n end", "def index\n breadcrumb_for_collections\n @collections = @user.collections.all\n if params[:name].present?\n @collections = @collections.where(\"name = ?\", params[:name])\n end\n @collections = @collections.order(sort_column + \" \" + sort_direction)\n\n respond_to do |format|\n format.html\n format.json {render json:@collections.as_json(only: [:id, :name, :documents_count])}\n end\n end", "def index\n @collections = Collection.all\n respond_with(@collections)\n end", "def index\n @collections = Collection.all\n end", "def index\n @collections = Collection.all\n end", "def index\n @custom_collections = CustomCollection.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @custom_collections }\n end\n end", "def index\n @collections = current_user.collections.ordered\n end", "def index\n respond_with(@collection) do |format|\n format.json { render :json => @collection.to_json(collection_serialization_options) }\n end\n end", "def read_collections\n site.collections.each_value do |collection|\n next if collection.data?\n\n collection.read\n end\n end", "def collection(options={})\n response = client.get(api_path, options)\n\n if response.success?\n collection = []\n\n response.body.each do |json|\n collection << new(json)\n end\n\n collection\n else\n []\n end\n end", "def index\n conditions = { :client_id => @client.id }\n if params[\"tags\"]\n conditions.merge!({:tags => params[\"tags\"]})\n end\n\n @collections = Collection.where(conditions).order('updated_at DESC')\n @collections.reject! { |item| ! item.read?(@user, @client) }\n\n entries = Array.new\n if @collections\n @collections.each do |item|\n entries << item.info_hash(@user, @client)\n end\n end\n render_json :entry => entries and return\n end", "def index\n #@collections = Collection.all\n\tshow_collections\n end", "def list_collections(options = {})\n session = client.send(:get_session, options)\n collections_info(session, ServerSelector.primary, options)\n end", "def list_collections_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CollectionsApi.list_collections ...'\n end\n # resource path\n local_var_path = '/v4/collections'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'page_token'] = opts[:'page_token'] if !opts[:'page_token'].nil?\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\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'ListCollectionsResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['BasicAuth']\n\n new_options = opts.merge(\n :operation => :\"CollectionsApi.list_collections\",\n :header_params => 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(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CollectionsApi#list_collections\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def all(page = 1, per_page = 10)\n params = {\n page: page,\n per_page: per_page\n }\n list = JSON.parse(connection.get(\"/collections/\", params).body)\n list.map { |data| Unsplash::Collection.new(data) }\n end", "def index\n @collections = @institution.collections.order(:name)\n\n respond_to do |format|\n format.html { render layout: 'fluid' }# index.html.erb\n format.json { render json: @collections }\n end\n end", "def collections_coll\n settings.db['collections']\n end", "def getCollections\n Community.getCollections(dso)\n end", "def collections\n response = RequestResponse.new\n name_resp = collection_names\n name_resp.callback do |names|\n collections = names.map do |name|\n EM::Mongo::Collection.new(@db_name, name, @em_connection)\n end\n response.succeed collections\n end\n name_resp.errback { |err| response.fail err }\n response\n end", "def index\n #@collections = Collection.all\n @root_collections = []\n \n #filter by parent collection id if requested\n if params.include?('parent_id')\n #@all_collections = Collection.where(:collection_id => params['parent_id'].to_i)\n #TODO: ancestry?\n else\n #only root collections\n #TODO\n #@all_collections = Collection.where(:collection_id => nil).order('name')\n @all_collections = Collection.roots.order('name')\n end\n \n #add additional data, mostly for json requests\n @all_collections.each do |c|\n c.validated = collection_is_validated(c)\n end\n\n #filter for permission\n @all_collections.each do |c|\n if collection_is_viewable(c, current_user)\n @root_collections << c\n end\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @root_collections }\n end\n end", "def search\n @collections, @total_count = Admin::Collection.search(params[:search], params[:pagination], params[:sorting])\n\n render json: { collections: @collections, totalCount: @total_count }\n end", "def index\n @collections = get_collections(@state);\n respond_to do |format| \n respond_do(format, @collections)\n end \n end", "def index\n @data_collections = DataCollection.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @data_collections }\n end\n end", "def getVertexCollections\r\n result = request(\"GET\", \"vertex\", key: :collections)\r\n return result if return_directly?(result)\r\n result.map do |x|\r\n Arango::Collection.new(name: x, database: @database, graph: self)\r\n end\r\n end", "def index\n @users_collections = Users::Collection.all\n end", "def collection\n return @client.api_helper.collection(\"items\")\n end", "def show\n @collection = Collection.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @collection }\n end\n end", "def getEdgeCollections\r\n result = request(\"GET\", \"edge\", key: :collections)\r\n return result if @database.server.async != false\r\n return result if return_directly?(result)\r\n result.map{|r| Arango::Collection.new(database: @database, name: r, type: :edge)}\r\n end", "def show\n @collection = Collection.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @collection }\n end\n end", "def index\n @user_collections = UserCollection.all\n end", "def index\n Rails.logger.debug(\"collection_id: @collection.id\")\n @categories = @collection.categories.all\n\n # if !@collection\n # @categories = []\n # else\n # @categories = @collection.categories.all\n #\n # #Category.where(shopify_collection_id: session[:shopify_collection_id])\n # end\n\n @collections = Collection.all\n\n\n # Trying Nav\n #@custom_collections = ShopifyAPI::CustomCollection.find(:all, params: { limit: 10 },shopify_collection_id: session[:shopify_collection_id])\n #@smart_collections = ShopifyAPI::SmartCollection.find(:all, params: { limit: 10 }, shopify_collection_id: session[:shopify_collection_id])\n\n end", "def show\n render json: @collection\n end", "def index\n ### WHAT IF ANOTHER USER IS TRYING TO LOOK AT\n # ANOTHER USER'S COLLECTION?\n #\n @collections = @current_user.collections\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @collections }\n end\n end", "def show\n @custom_collection = get_collection\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @custom_collection }\n end\n end", "def show\n @collection = Collection.all.find_by(user_id: params[:id])\n render :json => @collection\n end", "def searchcollections\n @collections = Collection.select{ |collection| collection.name.include?(params[:term]) }\n render json: @collections, status: 200\n\n end", "def get_cluster_collections\n params = {:action => \"LIST\"}\n cluster_collections = solr_collection_api(node['ipaddress'], node['port_no'], params)\n collection_list = cluster_collections[\"collections\"]\n return collection_list\n end", "def index\n @jewelrycollections = Jewelrycollection.all\n end", "def collections\n with_caching({}, 'collections') do\n sibling_nodes_for('collection').map {|n| Collection.new(n, authentication_options) }\n end\n end", "def collections_path; end", "def get_collection(database_id:, collection_id:)\n path = '/databases/{databaseId}/collections/{collectionId}'\n .gsub('{databaseId}', database_id)\n .gsub('{collectionId}', collection_id)\n\n if database_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"databaseId\"')\n end\n\n if collection_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"collectionId\"')\n end\n\n params = {\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'GET',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::Collection\n )\n end", "def index\n @sub_collections = SubCollection.all\n end", "def index\n @glo_collections = GloCollection.all\n end", "def fetch(options = {})\n validate_collection_options(options)\n\n collection_class.new(client.get(base_uri, options).body, client)\n end", "def current_users_collections\n if current_user.respond_to?(:collections)\n current_user.collections.to_a\n else\n Collection.all\n end\n end", "def curation_concerns_collections\n resources :collections, only: :show do\n member do\n get 'page/:page', action: :index\n get 'facet/:id', action: :facet, as: :dashboard_facet\n end\n collection do\n put '', action: :update\n put :remove_member\n end\n end\n end", "def new\n @collection = @user.collections.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @collection }\n end\n end", "def get_provider_collections(params = {})\n collection_params = {\n 'provider' => current_user.provider_id,\n 'page_size' => 25\n }.stringify_keys.merge(params.stringify_keys)\n\n Rails.logger.debug \"Provider Collection Request parameters: #{collection_params}\" unless request.xhr?\n\n if collection_params.key?('short_name')\n collection_params['short_name'].concat('*')\n\n # In order to search with the wildcard parameter we need to tell CMR to use it\n collection_params['options'] = {\n 'short_name' => {\n 'pattern' => true\n }\n }\n end\n\n # Adds wildcard searching\n collection_params['keyword'].concat('*') if collection_params.key?('keyword')\n\n # Retreive the collections from CMR, allowing a few additional parameters\n cmr_client.get_collections_by_post(collection_params, token).body\n end", "def index\n\n get_collections\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @deities }\n format.js {}\n end\n end", "def index\n\n get_collections\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @temples }\n format.js {}\n end\n end", "def get_collections_count()\n uri = build_uri('info/collection_counts')\n @tools.process_get_request(uri, @user_obj.encrypted_login, @user_pwd).body\n end", "def find_collections_with_read_access\n find_collections(:read)\n end", "def find_collections_with_read_access\n find_collections(:read)\n end", "def show_collections\n @user=User.find_by name: session[:user]\n @user_collections = CollectionUser.where('id_user LIKE ? ', \"#{@user.id}\")\n @collections = Array.new\n @user_collections.each do |collections|\n @collections.push(Collection.find(collections.id_collection))\n end\n\n end", "def index\n respond_with Collection.all\n end", "def index\n respond_with Collection.all\n end", "def collection_names\n case config[\"collections\"]\n when Hash\n config[\"collections\"].keys\n when Array\n config[\"collections\"]\n when nil\n []\n else\n raise ArgumentError, \"Your `collections` key must be a hash or an array.\"\n end\n end", "def collection\n resource_class.all\n end", "def solr_collection_api(host_name,port,params,config_name=nil,path=\"/solr/admin/collections\")\n if not config_name.nil?\n path = \"#{path}?\".concat(params.collect { |k,v| \"#{k}=#{CGI::escape(v.to_s)}\" }.join('&'))+\"&collection.configName=\"+config_name+\"&wt=json\"\n else\n path = \"#{path}?\".concat(params.collect { |k,v| \"#{k}=#{CGI::escape(v.to_s)}\" }.join('&'))+\"&wt=json\"\n end\n Chef::Log.info(\" HostName = \" + host_name + \", Port = \" + port + \", Path = \" + path)\n http = Net::HTTP.new(host_name, port)\n req = Net::HTTP::Get.new(path)\n\n unless !SolrAuth::AuthUtils.auth_enabled?\n admin_creds = SolrAuth::AuthUtils.get_solr_admin_credentials\n req.basic_auth(admin_creds['username'], admin_creds['password'])\n end\n response = http.request(req)\n if response != nil then\n return JSON.parse(response.body())\n end\n raise StandardError, \"empty response\"\n end", "def index\n # No authorize! call here to filter viewable items in the list.\n # We're assuming if you can view the index, you can see all published and\n # unpublished collections.\n\n\n # NOTE WELL: To use ransack, all attributes we want ransack to search or sort\n # on NEED TO be listed in Colletion.ransackable_attributes and/or Collection.ransackable_associations\n @q = Collection.ransack(params[:q]).tap do |ransack|\n ransack.sorts = 'title asc' if ransack.sorts.empty?\n end\n\n scope = @q.result\n if params[:title_or_id].present?\n scope = scope.where(id: params[:title_or_id]\n ).or(\n Collection.where(friendlier_id: params[:title_or_id])\n ).or(\n Collection.where(\"title ilike ?\", \"%\" + Collection.sanitize_sql_like(params[:title_or_id]) + \"%\")\n )\n end\n\n if params[:department].present?\n scope = scope.where(\"json_attributes ->> 'department' = :department\", department: params[:department])\n @department = params[:department]\n end\n\n @collections = scope.page(params[:page]).per(100)\n end", "def collection\n @collection ||= Collection.load(self.collection_url)\n end", "def index\n @shared_collections = SharedCollection.all\n end", "def index\n respond_with(@collection) do |format|\n format.html\n format.json { render :json => json_data }\n end\n end", "def existing_collections\n query = \"select $object $title from <#ri> \" +\n \"where $object <fedora-model:label> $title \" +\n \"and $object <fedora-model:hasModel> <info:fedora/islandora:collectionCModel>\"\n\n @repository.itql(query).map{ |row| row[0] }\n end", "def all_collections\n @all_collections ||= Blacklight.solr.select(\n :params => {\n :fq => \"#{blacklight_config.collection_identifying_field}:\\\"#{blacklight_config.collection_identifying_value}\\\"\",\n :rows => \"10\"\n }\n )[\"response\"][\"docs\"].map do |document|\n SolrDocument.new(document)\n end\n end", "def index\n @categories = collections_config.values\n end", "def perform_get_with_objects_from_collection(path, options, klass, collection_name)\n perform_request_with_objects_from_collection(:get, path, options, klass, collection_name)\n end", "def collections\n user = User.find(params[:user_id])\n user_collection = user.my_collections\n # byebug\n user_videos = user_collection.map{|item| Video.all.select{|video| video.id === item.video_id}}\n render json: {name:user.name,mycollection:user_collection,myvideos:user_videos.flatten}\nend", "def find_collections_for_form\n Hyrax::CollectionsService.new(self).search_results(:edit)\n end", "def get_collection_by_url(url)\n\t\tdirs_name = url.split(\"/\")\n\t\tcollection = @session.root_collection\n\t\tdirs_name.each do |dir_name|\n\t\t\tcollection = collection.subcollection_by_title(dir_name)\n\t\tend\n\t\tcollection\n\tend", "def create_collections\n @client[URLS_COLLECTION].create\n @client[DOCUMENTS_COLLECTION].create\n\n nil\n end", "def index\n @rent_collections = current_user.rent_collections\n end", "def list_collections manifest\n list = []\n\n manifest.collections.each do |pid|\n pidparts = pid.split(':')\n pid = pidparts[0].downcase + ':' + pidparts[1]\n list.push pid\n end\n\n return list\n end", "def catalogs\n path = \"#{api_root}/index/catalogs\"\n process_api_request(:get, path)\n end", "def show\n @collection = @institution.collections.find(params[:id])\n\n respond_to do |format|\n format.html { render layout: 'fluid' }# show.html.erb\n format.json { render json: @collection }\n end\n end", "def member_collections\n collections\n end", "def show\n @collection_type = CollectionType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @collection_type }\n end\n end", "def member_collections\n Collection.where(community_id: id)\n end", "def index\n \n get_collections\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @todos }\n format.js {}\n end\n end", "def index\n @men_shop_collections = MenShopCollection.all\n end", "def index\n @image_collections = ImageCollection.all\n end", "def show\n @collection = Collection.find(params[:id])\n end", "def show\n authorize! :show, params[:id]\n @collection = Collection.find(params[:id])\n respond_with(@collection)\n end", "def collection_names\n response = RequestResponse.new\n name_resp = collections_info.defer_as_a\n name_resp.callback do |docs|\n names = docs.collect{ |doc| doc['name'] || '' }\n names = names.delete_if {|name| name.index(self.name).nil? || name.index('$')}\n names = names.map{ |name| name.sub(self.name + '.','')}\n response.succeed(names)\n end\n name_resp.errback { |err| response.fail err }\n response\n end", "def index\n @resume_collections = ResumeCollection.all\n end", "def search\n if params[:collection_ids]\n data = {:sites => [], :clusters => []}\n params[:collection_ids].each do |id|\n result = search_by_collection id, params\n data[:sites].concat result[:sites] if result[:sites]\n data[:clusters].concat result[:clusters] if result[:clusters]\n end\n render json: data\n else\n render json: []\n end\n end", "def show\n @collections = @content_provider.collections(true, @state) \n respond_to do |format| \n respond_do(format, @content_provider)\n end \n end", "def find_collection\n @collection = Collection.find(params[:id])\n end", "def collections(what)\n list = []\n collections = what == 'all' ? all_collections() : local_collections()\n collections.each do |collection|\n model = collection.classify.constantize rescue nil\n next if model.nil?\n next unless model.respond_to?(:mongo_client)\n record = {'id' => collection, 'description' => I18n.t(\"helpers.label.#{collection}.tabletitle\") } \n list << [record, model_fields(collection)]\n end\n list\nend", "def collections; end", "def find_collections_for_form\n query = list_search_builder.with(q: '').query\n response = repository.search(query)\n response.documents\n end", "def index\n @all_collections = Collection.all\n @current_user = User.find_by username: session[:user]\n @collections = []\n @all_collections.each do |collection|\n if collection.owner.id == @current_user.id or collection.user_ids.include? @current_user.id\n @collections.push(collection)\n end\n end\n end", "def collections\n respond_to?(:articleHasCollection) ? articleHasCollection : []\n end" ]
[ "0.7903878", "0.7902042", "0.7901478", "0.7798958", "0.76547277", "0.74742806", "0.7404062", "0.73411196", "0.73396087", "0.7331687", "0.7301158", "0.7301158", "0.7140841", "0.70761335", "0.7036882", "0.70322394", "0.70099014", "0.6999159", "0.6996238", "0.6944972", "0.69432664", "0.6920187", "0.6914603", "0.6898231", "0.68630373", "0.6860555", "0.6859882", "0.6855213", "0.6822155", "0.68109167", "0.68100274", "0.680003", "0.6730994", "0.67303866", "0.67051363", "0.66425276", "0.6631181", "0.66277426", "0.6610596", "0.6609354", "0.6603708", "0.6599523", "0.659761", "0.6587786", "0.65743005", "0.65645796", "0.6560733", "0.65412545", "0.65347034", "0.6532806", "0.6512906", "0.65106165", "0.65068114", "0.6493414", "0.6467566", "0.64656323", "0.6462013", "0.6455954", "0.6422661", "0.6422661", "0.6420458", "0.6414494", "0.6414494", "0.64120036", "0.6410603", "0.6403182", "0.640302", "0.63647354", "0.63616186", "0.63419414", "0.6341896", "0.63380086", "0.63086534", "0.62989146", "0.6296655", "0.6292097", "0.6287779", "0.6284416", "0.6274938", "0.62736076", "0.6267753", "0.6263421", "0.6257947", "0.624907", "0.62473494", "0.6246289", "0.6240289", "0.62369573", "0.62319136", "0.6228745", "0.622425", "0.62240607", "0.62228763", "0.6220629", "0.6217543", "0.61992306", "0.619855", "0.61967146", "0.61901224", "0.6166499" ]
0.6413606
63
GET /collections/1 GET /collections/1.json
def show @gallery = Gallery.find(@collection.gallery_id) # p "collections controller" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collection(slug, options)\n _get(\"v1/collections/\" + slug, options)\n end", "def index\n @collections = current_user.collections.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @collections }\n end\n end", "def show\n\n @collection = @current_user.collections.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @collection }\n end\n end", "def list\n @collections = Admin::Collection.names\n\n render json: { collections: @collections }\n end", "def index\n breadcrumb_for_collections\n @collections = @user.collections.all\n if params[:name].present?\n @collections = @collections.where(\"name = ?\", params[:name])\n end\n @collections = @collections.order(sort_column + \" \" + sort_direction)\n\n respond_to do |format|\n format.html\n format.json {render json:@collections.as_json(only: [:id, :name, :documents_count])}\n end\n end", "def show\n @collection = Collection.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @collection }\n end\n end", "def index\n @collections = current_user.collections\n end", "def index\n @collections = Collection.all\n end", "def index\n @collections = Collection.all\n end", "def get_user_collections()\n uri = build_uri('info/collections')\n @tools.process_get_request(uri, @user_obj.encrypted_login, @user_pwd).body\n end", "def index\n @collections = Collection.all\n respond_with(@collections)\n end", "def show\n @collection = Collection.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @collection }\n end\n end", "def available_collections\n api = API.new\n params = {:limit => 9999, :preserve_original => true}\n response = api.send_and_receive('collections', {:params => params})\n response.map {|n| [n['title'], n['identifier']]}\n end", "def index\n\t\tif user_signed_in? && (current_user.has_role? :admin)\n\t\t\t@collections = Collection.order(\"created_at DESC\")\n\t\telse\n\t\t\t@collections = Collection.where(published: true).order(\"created_at DESC\")\n\t\tend\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: @collections }\n\t\tend\n\tend", "def index\n @custom_collections = CustomCollection.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @custom_collections }\n end\n end", "def index\n respond_with(@collection) do |format|\n format.json { render :json => @collection.to_json(collection_serialization_options) }\n end\n end", "def show\n @collection = Collection.all.find_by(user_id: params[:id])\n render :json => @collection\n end", "def index\n @collections = @institution.collections.order(:name)\n\n respond_to do |format|\n format.html { render layout: 'fluid' }# index.html.erb\n format.json { render json: @collections }\n end\n end", "def index\n #@collections = Collection.all\n\tshow_collections\n end", "def show\n @collection = Collection.find(params[:id])\n end", "def show\n render json: @collection\n end", "def show\n @collection_type = CollectionType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @collection_type }\n end\n end", "def new\n @collection = @user.collections.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @collection }\n end\n end", "def index\n @collections = get_collections(@state);\n respond_to do |format| \n respond_do(format, @collections)\n end \n end", "def show\n @custom_collection = get_collection\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @custom_collection }\n end\n end", "def get_collection(database_id:, collection_id:)\n path = '/databases/{databaseId}/collections/{collectionId}'\n .gsub('{databaseId}', database_id)\n .gsub('{collectionId}', collection_id)\n\n if database_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"databaseId\"')\n end\n\n if collection_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"collectionId\"')\n end\n\n params = {\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'GET',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::Collection\n )\n end", "def index\n ### WHAT IF ANOTHER USER IS TRYING TO LOOK AT\n # ANOTHER USER'S COLLECTION?\n #\n @collections = @current_user.collections\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @collections }\n end\n end", "def show\n render json: Collection.find(params.require(:id))\n end", "def index\n conditions = { :client_id => @client.id }\n if params[\"tags\"]\n conditions.merge!({:tags => params[\"tags\"]})\n end\n\n @collections = Collection.where(conditions).order('updated_at DESC')\n @collections.reject! { |item| ! item.read?(@user, @client) }\n\n entries = Array.new\n if @collections\n @collections.each do |item|\n entries << item.info_hash(@user, @client)\n end\n end\n render_json :entry => entries and return\n end", "def index\n @data_collections = DataCollection.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @data_collections }\n end\n end", "def show\n @collection = @institution.collections.find(params[:id])\n\n respond_to do |format|\n format.html { render layout: 'fluid' }# show.html.erb\n format.json { render json: @collection }\n end\n end", "def index\n @collections = current_user.collections.ordered\n end", "def show\n authorize! :show, params[:id]\n @collection = Collection.find(params[:id])\n respond_with(@collection)\n end", "def list_collections_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CollectionsApi.list_collections ...'\n end\n # resource path\n local_var_path = '/v4/collections'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'page_token'] = opts[:'page_token'] if !opts[:'page_token'].nil?\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\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'ListCollectionsResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['BasicAuth']\n\n new_options = opts.merge(\n :operation => :\"CollectionsApi.list_collections\",\n :header_params => 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(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CollectionsApi#list_collections\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def collections_coll\n settings.db['collections']\n end", "def find_collection\n @collection = Collection.find(params[:id])\n end", "def collection(options={})\n response = client.get(api_path, options)\n\n if response.success?\n collection = []\n\n response.body.each do |json|\n collection << new(json)\n end\n\n collection\n else\n []\n end\n end", "def fetch(options = {})\n validate_collection_options(options)\n\n collection_class.new(client.get(base_uri, options).body, client)\n end", "def [](collection_name)\n collection(collection_name)\n end", "def index\n #@collections = Collection.all\n @root_collections = []\n \n #filter by parent collection id if requested\n if params.include?('parent_id')\n #@all_collections = Collection.where(:collection_id => params['parent_id'].to_i)\n #TODO: ancestry?\n else\n #only root collections\n #TODO\n #@all_collections = Collection.where(:collection_id => nil).order('name')\n @all_collections = Collection.roots.order('name')\n end\n \n #add additional data, mostly for json requests\n @all_collections.each do |c|\n c.validated = collection_is_validated(c)\n end\n\n #filter for permission\n @all_collections.each do |c|\n if collection_is_viewable(c, current_user)\n @root_collections << c\n end\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @root_collections }\n end\n end", "def read_collections\n site.collections.each_value do |collection|\n next if collection.data?\n\n collection.read\n end\n end", "def all(page = 1, per_page = 10)\n params = {\n page: page,\n per_page: per_page\n }\n list = JSON.parse(connection.get(\"/collections/\", params).body)\n list.map { |data| Unsplash::Collection.new(data) }\n end", "def search\n @collections, @total_count = Admin::Collection.search(params[:search], params[:pagination], params[:sorting])\n\n render json: { collections: @collections, totalCount: @total_count }\n end", "def index\n @users_collections = Users::Collection.all\n end", "def collections_path; end", "def solr_collection_api(host_name,port,params,config_name=nil,path=\"/solr/admin/collections\")\n if not config_name.nil?\n path = \"#{path}?\".concat(params.collect { |k,v| \"#{k}=#{CGI::escape(v.to_s)}\" }.join('&'))+\"&collection.configName=\"+config_name+\"&wt=json\"\n else\n path = \"#{path}?\".concat(params.collect { |k,v| \"#{k}=#{CGI::escape(v.to_s)}\" }.join('&'))+\"&wt=json\"\n end\n Chef::Log.info(\" HostName = \" + host_name + \", Port = \" + port + \", Path = \" + path)\n http = Net::HTTP.new(host_name, port)\n req = Net::HTTP::Get.new(path)\n\n unless !SolrAuth::AuthUtils.auth_enabled?\n admin_creds = SolrAuth::AuthUtils.get_solr_admin_credentials\n req.basic_auth(admin_creds['username'], admin_creds['password'])\n end\n response = http.request(req)\n if response != nil then\n return JSON.parse(response.body())\n end\n raise StandardError, \"empty response\"\n end", "def index\n\n get_collections\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @temples }\n format.js {}\n end\n end", "def collection\n return @client.api_helper.collection(\"items\")\n end", "def get_collection(name)\n @data[name]\n end", "def show\n @item = Item.all.where(collection_id: params[:id])\n render :json => @item\n end", "def index\n @jewelrycollections = Jewelrycollection.all\n end", "def find(id)\n fail(ArgumentError, \"Missing id/slug\") unless id\n id = OAuth::Helper.escape(id)\n result = access_token.get(\"#{API_BASE}/collection/#{id}\")\n fail(ArgumentError, \"Bad request\") unless result.code == \"200\"\n\n Collection.new(result.body)\n end", "def index\n @gallery = Gallery.find(params[\"gallery_id\"])\n @collections = @gallery.collections.active\n end", "def index\n @user_collections = UserCollection.all\n end", "def index\n @sub_collections = SubCollection.all\n end", "def list_collections(options = {})\n session = client.send(:get_session, options)\n collections_info(session, ServerSelector.primary, options)\n end", "def perform_get_with_objects_from_collection(path, options, klass, collection_name)\n perform_request_with_objects_from_collection(:get, path, options, klass, collection_name)\n end", "def show\n @collection = Collection.find(params[:id])\n @products = Product.find(:all, :conditions => {:collection_id => @collection.id})\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @collection }\n end\n end", "def index\n @glo_collections = GloCollection.all\n end", "def existing_collections\n query = \"select $object $title from <#ri> \" +\n \"where $object <fedora-model:label> $title \" +\n \"and $object <fedora-model:hasModel> <info:fedora/islandora:collectionCModel>\"\n\n @repository.itql(query).map{ |row| row[0] }\n end", "def index\n respond_with(@collection) do |format|\n format.html\n format.json { render :json => json_data }\n end\n end", "def curation_concerns_collections\n resources :collections, only: :show do\n member do\n get 'page/:page', action: :index\n get 'facet/:id', action: :facet, as: :dashboard_facet\n end\n collection do\n put '', action: :update\n put :remove_member\n end\n end\n end", "def show\n @collection = current_user.collections.find(params[:collection_id])\n @entity_type = @collection.entity_types.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @entity_type }\n end\n end", "def index\n Rails.logger.debug(\"collection_id: @collection.id\")\n @categories = @collection.categories.all\n\n # if !@collection\n # @categories = []\n # else\n # @categories = @collection.categories.all\n #\n # #Category.where(shopify_collection_id: session[:shopify_collection_id])\n # end\n\n @collections = Collection.all\n\n\n # Trying Nav\n #@custom_collections = ShopifyAPI::CustomCollection.find(:all, params: { limit: 10 },shopify_collection_id: session[:shopify_collection_id])\n #@smart_collections = ShopifyAPI::SmartCollection.find(:all, params: { limit: 10 }, shopify_collection_id: session[:shopify_collection_id])\n\n end", "def show\n @collections = @content_provider.collections(true, @state) \n respond_to do |format| \n respond_do(format, @content_provider)\n end \n end", "def index\n\n get_collections\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @deities }\n format.js {}\n end\n end", "def collection\n @collection ||= Collection.load(self.collection_url)\n end", "def index\n @shared_collections = SharedCollection.all\n end", "def show\n respond_to do |format|\n format.html {\n redirect_to collection_documents_path(@collection)\n }\n format.json\n end\n end", "def find_collections_with_read_access\n find_collections(:read)\n end", "def find_collections_with_read_access\n find_collections(:read)\n end", "def show\n @village = Village.find(params[:id])\n @collections = @village.collections\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @village }\n end\n end", "def index\n respond_with Collection.all\n end", "def index\n respond_with Collection.all\n end", "def index\n @item_type = params[:type] = \"C\"\n \n params[:id] = nil\n \n # 찜한 상품, 콜렉션\n @collections = Collection.itemList(params)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @collections }\n end\n \n end", "def collections\n response = RequestResponse.new\n name_resp = collection_names\n name_resp.callback do |names|\n collections = names.map do |name|\n EM::Mongo::Collection.new(@db_name, name, @em_connection)\n end\n response.succeed collections\n end\n name_resp.errback { |err| response.fail err }\n response\n end", "def get_collection_by_url(url)\n\t\tdirs_name = url.split(\"/\")\n\t\tcollection = @session.root_collection\n\t\tdirs_name.each do |dir_name|\n\t\t\tcollection = collection.subcollection_by_title(dir_name)\n\t\tend\n\t\tcollection\n\tend", "def perform_get_with_object_from_collection(path, options, klass, collection_name)\n perform_request_with_object_from_collection(:get, path, options, klass, collection_name)\n end", "def get_collection_with_http_info(collection_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CollectionsApi.get_collection ...'\n end\n # verify the required parameter 'collection_id' is set\n if @api_client.config.client_side_validation && collection_id.nil?\n fail ArgumentError, \"Missing the required parameter 'collection_id' when calling CollectionsApi.get_collection\"\n end\n # resource path\n local_var_path = '/v4/collections/{collection_id}'.sub('{' + 'collection_id' + '}', CGI.escape(collection_id.to_s))\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\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'Collection'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['BasicAuth']\n\n new_options = opts.merge(\n :operation => :\"CollectionsApi.get_collection\",\n :header_params => 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(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CollectionsApi#get_collection\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n \n get_collections\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @todos }\n format.js {}\n end\n end", "def show\n @collection ||= Collection.shareds.find(params[:id])\n fail ActiveRecord::RecordNotFound if @collection.nil?\n end", "def index\n # No authorize! call here to filter viewable items in the list.\n # We're assuming if you can view the index, you can see all published and\n # unpublished collections.\n\n\n # NOTE WELL: To use ransack, all attributes we want ransack to search or sort\n # on NEED TO be listed in Colletion.ransackable_attributes and/or Collection.ransackable_associations\n @q = Collection.ransack(params[:q]).tap do |ransack|\n ransack.sorts = 'title asc' if ransack.sorts.empty?\n end\n\n scope = @q.result\n if params[:title_or_id].present?\n scope = scope.where(id: params[:title_or_id]\n ).or(\n Collection.where(friendlier_id: params[:title_or_id])\n ).or(\n Collection.where(\"title ilike ?\", \"%\" + Collection.sanitize_sql_like(params[:title_or_id]) + \"%\")\n )\n end\n\n if params[:department].present?\n scope = scope.where(\"json_attributes ->> 'department' = :department\", department: params[:department])\n @department = params[:department]\n end\n\n @collections = scope.page(params[:page]).per(100)\n end", "def getVertexCollections\r\n result = request(\"GET\", \"vertex\", key: :collections)\r\n return result if return_directly?(result)\r\n result.map do |x|\r\n Arango::Collection.new(name: x, database: @database, graph: self)\r\n end\r\n end", "def get_collections_count()\n uri = build_uri('info/collection_counts')\n @tools.process_get_request(uri, @user_obj.encrypted_login, @user_pwd).body\n end", "def collection\n @collection ||= PublicEarth::Db::Collection.find_by_id!(collection_id)\n end", "def index\n @image_collections = ImageCollection.all\n end", "def searchcollections\n @collections = Collection.select{ |collection| collection.name.include?(params[:term]) }\n render json: @collections, status: 200\n\n end", "def collection\n Rails.logger.info \"XXXXX COLLECTION NAME #{collection_hash['collection name']}\"\n\n @collection ||= CollectionCreator.find_or_create_collection(\n collection_hash['collection name'],\n collection_hash['unit name'],\n collection_hash['collection description'],\n submitter_user_key\n )\n end", "def collection; @opts['collection'] end", "def set_collection\n @collection = Collection.find(params[:id])\n end", "def set_collection\n @collection = Collection.find(params[:id])\n end", "def set_collection\n @collection = Collection.find(params[:id])\n end", "def find_collections_for_form\n Hyrax::CollectionsService.new(self).search_results(:edit)\n end", "def show_collections\n @user=User.find_by name: session[:user]\n @user_collections = CollectionUser.where('id_user LIKE ? ', \"#{@user.id}\")\n @collections = Array.new\n @user_collections.each do |collections|\n @collections.push(Collection.find(collections.id_collection))\n end\n\n end", "def create\n collection = Collection.create(collection_params)\n\n render json: collection\n end", "def new\n @collection = Collection.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @collection }\n end\n end", "def show\n @collection = Collection.find(params[:id])\n @authorLoggedIn = current_user == @collection.user\n\n if (@collection.private? && !current_user) || (@collection.private? && @collection.collection_users.include?(current_user) == false)\n respond_to do |format|\n format.html {redirect_to errors_unauthorized_path}\n end\n else\n step_ids = Step.joins(:project => :collectifies).where(collectifies: { collection_id: @collection.id }).pluck(:'steps.id')\n\n @questions = Question.where(:step_id => step_ids).where(:featured => nil).order(\"created_at DESC\")\n @activities = PublicActivity::Activity.where(:trackable_type => \"Step\").where(\"trackable_id\" => step_ids).where(\"key\" => \"step.create\").order(\"created_at DESC\").first(5)\n @contributors = @collection.projects.flat_map {|p| p.users}.uniq\n\n respond_to do |format|\n format.html {\n if request.path != collection_path(@collection)\n redirect_to @collection, status: :moved_permanently\n end\n }\n format.json { render :json => @collections }\n end\n\n end\n end", "def get_collection(collection_id, opts = {})\n data, _status_code, _headers = get_collection_with_http_info(collection_id, opts)\n data\n end", "def get_collection_key(args)\n\tapi_url = \"#{base_url}/#{args[:collection]}/#{args[:key]}\"\n\tdo_the_get_call( url: api_url, user: @user )\nend", "def index\n @collections = PostCategory.all\n @items = Post.all\n\n if params[:id]\n @collection = PostCategory.find(params[:id])\n \n @items = @collection.posts\n end\n end", "def getCollections\n Community.getCollections(dso)\n end" ]
[ "0.7678446", "0.76061696", "0.75371283", "0.7443003", "0.72130686", "0.7119864", "0.7102526", "0.7100734", "0.7100734", "0.709121", "0.7061903", "0.704557", "0.70365316", "0.7006357", "0.6956208", "0.6920214", "0.6828716", "0.6815708", "0.68125314", "0.6763249", "0.6738598", "0.6730276", "0.67294204", "0.6727587", "0.668597", "0.66801524", "0.66776234", "0.6676627", "0.66462386", "0.6644807", "0.6629522", "0.6621473", "0.66153973", "0.66076684", "0.6584299", "0.656275", "0.6554976", "0.65244687", "0.6518477", "0.6517449", "0.65019876", "0.6492906", "0.64482343", "0.6445925", "0.64127433", "0.6392067", "0.639118", "0.6370018", "0.6369841", "0.6368942", "0.63545346", "0.6348735", "0.6345229", "0.63324666", "0.6328691", "0.63199914", "0.63144207", "0.6307586", "0.63052046", "0.62864465", "0.6271083", "0.62674797", "0.62583447", "0.6249584", "0.624691", "0.62311524", "0.62294495", "0.62250215", "0.62195385", "0.62187463", "0.62187463", "0.6198541", "0.619821", "0.619821", "0.61956936", "0.6188959", "0.6175699", "0.61583436", "0.6154204", "0.6141677", "0.6140593", "0.6127905", "0.6109603", "0.60982704", "0.60908616", "0.60905594", "0.6086091", "0.6082647", "0.6072938", "0.6057787", "0.6057787", "0.6057787", "0.60383487", "0.6030984", "0.60277957", "0.601856", "0.60178864", "0.6004345", "0.59966695", "0.59923434", "0.5992163" ]
0.0
-1
POST /collections POST /collections.json
def create @gallery = Gallery.find(params["gallery_id"]) @collection = @gallery.collections.build(collection_params) @collection.thumbnail = 9999 respond_to do |format| if @collection.save format.html { redirect_to @collection, notice: 'Collection was successfully created.' } format.json { render :show, status: :created, location: @collection } else format.html { render :new } format.json { render json: @collection.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n collection = Collection.create(collection_params)\n\n render json: collection\n end", "def create\n @collection = Admin::Collection.new(collection_params)\n\n if @collection.save\n render json: @collection, status: :created#, location: @collection\n else\n render json: @collection.errors, status: :unprocessable_entity\n end\n end", "def create_collections\n @client[URLS_COLLECTION].create\n @client[DOCUMENTS_COLLECTION].create\n\n nil\n end", "def create\n @collection = Collection.new(params[:collection])\n\n respond_to do |format|\n if @collection.save\n format.html { redirect_to @collection, :notice => 'Collection was successfully created.' }\n format.json { render :json => @collection, :status => :created, :location => @collection }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @collection.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @collection = current_user.collections.new(collection_params)\n\n respond_to do |format|\n if @collection.save\n format.html { redirect_to @collection, notice: 'Collection was successfully created.' }\n format.json { render :show, status: :created, location: @collection }\n else\n format.html { render :new }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @collection = Collection.new(params[:collection])\n\n respond_to do |format|\n if @collection.save\n format.html { redirect_to @collection, notice: 'Collection was successfully created.' }\n format.json { render json: @collection, status: :created, location: @collection }\n else\n format.html { render action: \"new\" }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @collection = Collection.new(params[:collection])\n\n respond_to do |format|\n if @collection.save\n format.html { redirect_to @collection, notice: 'Collection was successfully created.' }\n format.json { render json: @collection, status: :created, location: @collection }\n else\n format.html { render action: \"new\" }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @collection = Collection.new(collection_params)\n\n respond_to do |format|\n if @collection.save\n format.html { redirect_to root_path, notice: 'Collection was successfully created.' }\n format.json { render :show, status: :created, location: @collection }\n else\n format.html { render :new }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @collection = current_user.collections.new(collection_params)\n respond_to do |format|\n if @collection.save\n format.html { redirect_to account_collections_url, notice: 'Collection was successfully created.' }\n format.json { render action: 'show', status: :created, location: @collection }\n else\n format.html { render action: 'new' }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n collection = @current_user.collections.create\n collection.set_attributes(params)\n \n if not collection.valid?\n collection_errors(collection)\n redirect_to :back and return\n else\n collection.save\n end\n redirect_to collection_path(:id => collection.id)\n end", "def create\n @collection = current_user.collections.build(params[:collection])\n\n # set some default values - set collection value to the number of current collections\n if Collection.where(\"name like ?\", \"%Untitled%\").count > 0\n count = Collection.where(\"name like ?\", \"%Untitled%\").order(\"created_at DESC\").first.name.sub('Untitled-Collection-','').to_i + 1\n else\n count = 1\n end\n \n @collection.name = \"Untitled-Collection-\"+count.to_s()\n @collection.user = current_user\n @collection.challenge = false\n @collection.privacy = \"unlisted\"\n\n respond_to do |format|\n if @collection.save\n @collection.update_attributes(:name => \"Untitled-Collection-\" + @collection.id.to_s)\n format.html { redirect_to @collection }\n format.json { render :json => @collection, :status => :created, :location => @collection }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @collection.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @collection = @current_user.collections.new(params[:collection])\n\n respond_to do |format|\n if @collection.save\n format.html { redirect_to [@current_user, @collection],\n\t\t notice: 'Collection was successfully created.' }\n format.json { render json: [@current_user, @collection], \n\t\t status: :created, \n location: [@current_user, @collection] }\n else\n format.html { render action: \"new\" }\n format.json { render json: @collection.errors, \n\t\t status: :unprocessable_entity }\n end\n end\n end", "def create\n collection = @current_user.collections.create\n collection.set_attributes(params)\n\n if not collection.valid?\n collection_errors(collection)\n redirect_to :back and return\n else\n collection.save\n end\n redirect_to collection_path(:id => collection.id)\n end", "def create\n @collection = Collection.new(collection_params)\n authorize! :create, @collection\n respond_to do |format|\n if @collection.save\n format.html { redirect_to admin_collections_url, notice: \"Collection '#{@collection.title}' was successfully created.\" }\n format.json { render :show, status: :created, location: @collection }\n else\n format.html { render :new }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @collection = Collection.new(collection_params)\n\n respond_to do |format|\n if @collection.save\n format.html { redirect_to @collection, notice: 'Collection was successfully created.' }\n format.json { render action: 'show', status: :created, location: @collection }\n\n\n else\n format.html { render action: 'new' }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @users_collection = Users::Collection.new(users_collection_params)\n\n respond_to do |format|\n if @users_collection.save\n format.html { redirect_to @users_collection, notice: 'Collection was successfully created.' }\n format.json { render action: 'show', status: :created, location: @users_collection }\n else\n format.html { render action: 'new' }\n format.json { render json: @users_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if params[:collection]\n @collection = Collection.new( params[:collection] )\n # Check: if user submitted an id, but it is not set, there was an error\n if params[:collection][:id] && params[:collection][:id] != @collection.id\n render_json :status => :bad_request, :messages => @collection.errors.full_messages and return\n end\n\n if @user && params[:collection][:owner_id]\n if @collection.indestructible\n render_json :status => :bad_request, :messages => \"Cannot set both: owner and indestructible\" and return\n elsif params[:collection][:owner_id] != @user.guid\n render_json :status => :bad_request, :messages => \"Owner cannot be different than logged in user.\" and return\n else\n @collection.owner = @user\n end\n else\n if params[:collection][:priv]\n render_json :status => :bad_request, :messages => \"Cannot set a collection private without an owner.\" and return\n end\n end\n else\n @collection = Collection.new\n end\n @collection.client = @client\n @collection.updated_by = @user ? @user.guid : @client.id\n\n if @collection.save\n render_json :status => :created, :entry => @collection.to_hash(@user, @client) and return\n else\n render_json :status => :bad_request, :messages => @collection.errors.full_messages and return\n end\n end", "def create_collections\n self.collections.each do |c|\n self.add_collection(c)\n end\n end", "def save(collection_name, json)\n collection = get_db.create_collection(collection_name)\n collection.save(json)\n end", "def save(collection_name, json)\n collection = get_db.create_collection(collection_name)\n collection.save(json)\n end", "def save\n @item = Collection.new(collection_params)\n @collection.collections << @item\n @collection.save\n\n @collections = @collection.collections\n\n # return_to = @collection.is_root? ? collections_path : collection_path\n #\n # respond_to do |format|\n # if @item.save\n # format.html { redirect_to return_to, notice: 'Collection was successfully created.' }\n # format.json { render :show, status: :created, location: @collection }\n # else\n # format.html { render :new }\n # format.json { render json: @collection.errors, status: :unprocessable_entity }\n # end\n # end\n end", "def post(attrs = {}, request_opts = {})\n # assumes that the current collection is a singleton, and the uri_spec\n # has no components that require resolution.\n if @uri_spec.include?(\":\")\n UriError.new(\"Singleton collection expected, \" +\n \"but collection URI requires resolution: #{@uri_spec}\")\n end\n\n self.new().post(attrs, request_opts)\n end", "def create\n @item_collection = ItemCollection.new(item_collection_params)\n\n respond_to do |format|\n if @item_collection.save\n format.html { redirect_to @item_collection, notice: \"La collection a été correctement créée\" }\n format.json { render :show, status: :created, location: @item_collection }\n else\n format.html { render :new }\n format.json { render json: @item_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @collection = Collection.new(collection_params)\n build_kiosks(params)\n respond_to do |format|\n if @collection.save\n format.html { redirect_to @collection, notice: 'Collection was successfully created.' }\n format.json { render :show, status: :created, location: @collection }\n else\n format.html { render :new }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def perform_post_with_objects_from_collection(path, options, klass, collection_name)\n perform_request_with_objects_from_collection(:post, path, options, klass, collection_name)\n end", "def publish\n type = params[:type]\n collection_id = params[:id]\n\n if type==\"collect\"\n drowCollect(params)\n else\n #drowSet(params[:items], params[:info])\n drowSet(params)\n end\n \n respond_to do |format|\n #format.json { render json: @collection.to_json }\n format.json { render :json => { status: true, location: \"/collections/#{@collection.id}\", msg: \"콜렉션을 등록하였습니다.\" }.to_json }\n end\n end", "def new\n @collection = @user.collections.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @collection }\n end\n end", "def create\n @collection = Collection.new(collection_params)\n ensure_default_editors\n ensure_default_viewers\n authorize! :create, @collection\n flash[:notice] = 'Collection was successfully created.' if @collection.save\n respond_with(@collection)\n end", "def create\n @collection = Collection.new(collection_params)\n @collection.owner = User.find_by username: session[:user]\n respond_to do |format|\n if @collection.save\n format.html { redirect_to @collection, success: 'Collection was successfully created.' }\n format.json { render :show, status: :created, location: @collection }\n else\n format.html { redirect_to @collection, alert: 'Collection was not created.' }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @collection = Collection.new(params[:collection])\n\n # scrape each resource URL to add those fields\n @collection.collectionizes.each do |each_collectionize|\n resource_object = Resource.scrape_data(each_collectionize.resource.raw_url)\n\n each_collectionize.resource\n resource_object = Resource.scrape_data(@resource.raw_url)\n each_collectionize.resource.keywords_scraped = resource_object[:keywords_scraped] ? resource_object[:keywords_scraped] : nil\n each_collectionize.resource.description_scraped = resource_object[:description_scraped] ? resource_object[:description_scraped] : nil\n each_collectionize.resource.title_scraped = resource_object[:title_scraped] ? resource_object[:title_scraped] : nil\n each_collectionize.resource.raw_html = resource_object[:raw_html] ? resource_object[:raw_html] : nil\n end\n\n respond_to do |format|\n if @collection.save\n redirect_to @collection, notice: 'Collection was successfully created.'\n else\n render action: \"new\"\n end\n end\n end", "def create\n @root_collection = RootCollection.new(root_collection_params)\n\n respond_to do |format|\n if @root_collection.save\n format.html { redirect_to @root_collection, notice: 'Root collection was successfully created.' }\n format.json { render :show, status: :created, location: @root_collection }\n else\n format.html { render :new }\n format.json { render json: @root_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @collection = @user.collections.new(collection_params)\n @collection.order_no = @user.collections.size\n respond_to do |format|\n if @collection.save\n format.html { redirect_to collection_documents_path(@collection), notice: 'The collection was successfully created.' }\n format.json { render :show, status: :created, location: @collection }\n else\n format.html { render :new }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @data_collection = DataCollection.new(params[:data_collection])\n\n respond_to do |format|\n if @data_collection.save\n format.html { redirect_to @data_collection, notice: 'Data collection was successfully created.' }\n format.json { render json: @data_collection, status: :created, location: @data_collection }\n else\n format.html { render action: \"new\" }\n format.json { render json: @data_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @collection = @institution.collections.new(params[:collection])\n\n respond_to do |format|\n if @collection.save\n format.html { redirect_to [@collection.institution, @collection], notice: 'Collection was successfully created.' }\n format.json { render json: @collection, status: :created, location: @collection }\n else\n format.html { render layout: 'form', action: \"new\" }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @jewelrycollection = Jewelrycollection.new(jewelrycollection_params)\n\n respond_to do |format|\n if @jewelrycollection.save\n format.html { redirect_to @jewelrycollection, notice: 'Jewelrycollection was successfully created.' }\n format.json { render :show, status: :created, location: @jewelrycollection }\n else\n format.html { render :new }\n format.json { render json: @jewelrycollection.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @user = User.find(params[:user_id])\n \n #@product = Product.find(params[:product_id])\n \n @collection = @user.collections.build(params[:collection])\n\n respond_to do |format|\n if @collection.save\n format.html { redirect_to user_path(@user.id), notice: 'Collection was successfully created.' }\n format.json { render json: @collection, status: :created, location: @collection }\n else\n format.html { render action: \"new\" }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @collection = Collection.new(collection_params)\n\n respond_to do |format|\n action_message_for('new')\n if create_collection\n format.html { redirect_to redirect_target(@collection), flash: @feedback_flash }\n format.json { render :show, status: :created, location: @collection }\n else\n format.html { render :new }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_collection\n return if collection\n\n google_session.root_collection.create_subcollection('riskcovry_uploads')\n end", "def collection_params\n params.require(:collection).permit(:name)\n end", "def create\n @collection = Collection.new(params[:collection])\n @collection.account_id = session[:account].id\n\n respond_to do |format|\n if @collection.save\n save_activity(@collection, \"created collection\")\n \n flash[:notice] = \"Collection #{@collection.name} was successfully created.\"\n format.html { redirect_to(dashboard_path) }\n format.xml { render :xml => @collection, :status => :created, :location => @collection }\n else\n flash[:error] = \"Collection #{@collection.name} was not created.\"\n format.html { render :action => \"new\" }\n format.xml { render :xml => @collection.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @user_collection = UserCollection.new(user_collection_params)\n\n respond_to do |format|\n if @user_collection.save\n format.html { redirect_to @user_collection}\n format.json { render action: 'show', status: :created, location: @user_collection }\n else\n format.html { render action: 'new' }\n format.json { render json: @user_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @collection_post = CollectionPost.new(collection_post_params)\n\n respond_to do |format|\n if @collection_post.save\n format.html { redirect_to @collection_post, notice: 'Collection post was successfully created.' }\n # format.json { render :show, status: :created, location: @collection_post }\n format.json { render json: {collection_post: @collection_post}, status: :ok }\n else\n format.html { render :new }\n format.json { render json: @collection_post.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_collection(client, collection_name)\n client[collection_name].drop\n client[collection_name].create\n end", "def create\n @category_collection = CategoryCollection.new(params[:category_collection])\n @collection = @category_collection.collection\n\n respond_to do |format|\n if @category_collection.save\n flash[:notice] = 'CategoryCollection was successfully created.'\n format.html { redirect_to(@collection) }\n format.xml { render :xml => @category_collection, :status => :created, :location => @category_collection }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @category_collection.errors, :status => :unprocessable_entity }\n end\n end\n end", "def collection_params\n params.require(:collection).permit(:name, :description, :categories, :tag_list)\n end", "def add_to_collection\n\n if request.post?\n # Actually add the item to the collection\n ids = request.params[:id].split(',')\n ids.each do |id|\n add_to_collection_action(request.params[:collection], id)\n end\n\n # Don't render the default \"Add to Collection\" dialog - render the \"Success!\" dialog contents\n flash[:success] ||= \"The item has been added to the collection\"\n render 'catalog/add_to_collection_success'\n end\n\n end", "def create(title: \"\", description: \"\", private: false)\n params = {\n title: title,\n description: description,\n private: private\n }\n Unsplash::Collection.new JSON.parse(connection.post(\"/collections\", params).body)\n end", "def add_to_collection_action (collection, item)\n\n api = Harvard::LibraryCloud::API.new\n path = 'collections/' + collection\n\n connection = Faraday.new(:url => api.get_base_uri + path) do |faraday|\n faraday.request :url_encoded\n faraday.response :logger\n faraday.adapter Faraday.default_adapter\n faraday.headers['Content-Type'] = 'application/json'\n faraday.headers['X-LibraryCloud-API-Key'] = ENV[\"LC_API_KEY\"]\n end\n\n raw_response = begin\n response = connection.post do |req|\n req.body = '[{\"item_id\": \"' + item + '\"}]'\n end\n { status: response.status.to_i, headers: response.headers, body: response.body.force_encoding('utf-8') }\n rescue Errno::ECONNREFUSED, Faraday::Error => e\n raise RSolr::Error::Http.new(connection, e.response)\n end\n end", "def post(path, collection)\n # remove the leading slash\n path = path.gsub(/\\A\\//, '')\n\n headers = self.class.headers.clone\n headers['Content-Type'] = @media_type\n\n response = case @media_type\n when 'application/occi+json'\n self.class.post(@endpoint + path,\n :body => collection.to_json,\n :headers => headers)\n when 'text/occi'\n self.class.post(@endpoint + path,\n :headers => collection.to_header.merge(headers))\n else\n self.class.post(@endpoint + path,\n :body => collection.to_text,\n :headers => headers)\n end\n\n response_msg = response_message response\n\n case response.code\n when 200\n collection = Occi::Parser.parse(response.header[\"content-type\"].split(\";\").first, response)\n if collection.empty?\n Occi::Parser.locations(response.header[\"content-type\"].split(\";\").first, response.body, response.header).first\n else\n collection.resources.first.location if collection.resources.first\n end\n when 201\n Occi::Parser.locations(response.header[\"content-type\"].split(\";\").first, response.body, response.header).first\n else\n raise \"HTTP POST failed! #{response_msg}\"\n end\n end", "def collection_params\n params.require(:collection).permit(:title, :identifier, :description, :discoverable, :rights, creator: [], publisher: [])\n end", "def create\n create! do |success, failure|\n success.html { redirect_to collection_path }\n end\n end", "def collection_params\n params.require(:collection).permit(:name, :kind)\n end", "def create\n book = Book.find(params[:book_id])\n @collection = current_user.collections.build(book: book)\n\n respond_to do |format|\n if @collection.save\n format.html { redirect_to collections_path, notice: 'Book added to your collection.' }\n format.json { render json: @collection, status: :created, location: @collection }\n else\n format.html { render action: \"new\" }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @glo_collection = GloCollection.new(glo_collection_params)\n\n respond_to do |format|\n if @glo_collection.save\n format.html { redirect_to @glo_collection, notice: 'Glo collection was successfully created.' }\n format.json { render action: 'show', status: :created, location: @glo_collection }\n else\n format.html { render action: 'new' }\n format.json { render json: @glo_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def collection_params\n params.require(:collection).permit(:name, :code, :description, user_ids: [])\n end", "def create_collection(database_id:, collection_id:, name:, permissions: nil, document_security: nil)\n path = '/databases/{databaseId}/collections'\n .gsub('{databaseId}', database_id)\n\n if database_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"databaseId\"')\n end\n\n if collection_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"collectionId\"')\n end\n\n if name.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"name\"')\n end\n\n params = {\n collectionId: collection_id,\n name: name,\n permissions: permissions,\n documentSecurity: document_security,\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'POST',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::Collection\n )\n end", "def perform_post_with_object_from_collection(path, options, klass, collection_name)\n perform_request_with_object_from_collection(:post, path, options, klass, collection_name)\n end", "def create\n # Manual load and authorize necessary because Cancan will pass in all\n # form attributes. When `permissions_attributes` are present the\n # collection is saved without a value for `has_model.`\n @collection = ::Collection.new\n authorize! :create, @collection\n # Coming from the UI, a collection type gid should always be present. Coming from the API, if a collection type gid is not specified,\n # use the default collection type (provides backward compatibility with versions < Hyrax 2.1.0)\n @collection.collection_type_gid = params[:collection_type_gid].presence || default_collection_type.gid\n @collection.id = Californica::IdGenerator.id_from_ark(collection_params[\"ark\"])\n @collection.attributes = collection_params.except(:members, :parent_id, :collection_type_gid)\n @collection.apply_depositor_metadata(current_user.user_key)\n add_members_to_collection unless batch.empty?\n @collection.visibility = Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE unless @collection.discoverable?\n if @collection.save\n after_create\n else\n after_create_error\n end\n end", "def collection_params\n params.require(:collection).permit(:name, :user_id)\n end", "def create\n @tweet_collection = TweetCollection.new(tweet_collection_params)\n Tweet.tweets.each {|t| @tweet_collection.tweets << t}\n \n respond_to do |format|\n if @tweet_collection.save\n format.html { redirect_to @tweet_collection, notice: 'Tweet collection was successfully created.' }\n format.json { render :show, status: :created, location: @tweet_collection }\n else\n format.html { render :new }\n format.json { render json: @tweet_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def add\n if ! @collection.write?(@user, @client)\n render_json :status => :forbidden, :messages => \"This collection belongs to another client.\" and return\n end\n render_json :status => :bad_request and return unless @collection.create_item(params[:item], @user, @client)\n @item = @collection.items[-1]\n entry = ( @item.class == Collection ? @item.to_hash(@user, @client) : @item )\n render_json :status => :created, :entry => entry and return\n end", "def create\n @collection = Collection.new(params[:collection])\n @collection.user = current_user\n\n #Checks collection for parent, inherits permissions\n if ( params[:collection].include?(\"parent_id\") and params[:collection][\"parent_id\"] != \"\" )\n parent_collection = Collection.find(params[:collection][\"parent_id\"])\n inherit_collection(parent_collection)\n else\n puts \"### Collection has no parent\"\n end\n\n respond_to do |format|\n if @collection.save\n #format.html { redirect_to @collection, notice: 'Collection was successfully created.' }\n format.html { redirect_to collections_path, notice: 'Collection was successfully created.' }\n #format.json { render json: @collection, status: :created, location: @collection }\n format.json { render json: collections_path, status: :created, location: collections_path }\n else\n format.html { render action: \"new\" }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def make_collection\n @resource.make_collection\n end", "def create\n @collection_type = CollectionType.new(params[:collection_type])\n\n respond_to do |format|\n if @collection_type.save\n format.html { redirect_to @collection_type, notice: 'Collection type was successfully created.' }\n format.json { render json: @collection_type, status: :created, location: @collection_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @collection_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def collection_params\n params.require(:collection).permit(:title)\n end", "def collection_params\n params.require(:collection).permit(:title)\n end", "def create\n @product = @collection.products.build(product_params)\n\n if @product.save\n render json: @product, status: :created#, location: @collection\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end", "def add\n @collection = Collection.find(params[:col_id])\n\n if params.has_key?(:method_id)\n @method = DesignMethod.find(params[:method_id])\n @collection.design_methods.push(@method)\n end\n if params.has_key?(:cs_id)\n @case_study = CaseStudy.find(params[:cs_id])\n @collection.case_studies.push(@case_study)\n end\n\n respond_to do |format|\n if @collection.save\n format.html { redirect_to :back, notice: 'Successfully added to Collection.'}\n format.json { render json: @collection, status: :created, location: @collection }\n else\n format.html { redirect_to :back, :flash => { :warning => \"Not added to Collection due to errors.\" } }\n format.json { render json: @collection, status: :created, location: @collection }\n end\n end\n end", "def collection_params\n params.require(:collection).permit(:name, :public)\n end", "def update\n render_json :status => :forbidden and return unless @collection.write?(@user, @client)\n if !params[:collection]\n render_json :status => :bad_request, :messages => \"Tried to update collection with no data.\" and return\n end\n @collection.update_attributes(params[:collection].slice(:metadata, :read_only, :title, :tags, :priv))\n render_json :entry => @collection.to_hash(@user, @client) and return\n end", "def populate_collection(args)\n\targs[:keys].each do |key|\n\t\tapi_url = \"#{@base_url}/#{args[:collection]}/#{key}\"\n\t\tputs do_the_put_call({ url: api_url, user: @user, json: args[:json][key] })\n\tend\nend", "def collection_params\n params.require(:collection).permit(:name, :description, :featured_label, :slug)\n end", "def create\n @collection = Collection.new(collection_params)\n\n respond_to do |format|\n if @collection.save\n format.html { redirect_to '/collections'}#@collection, notice: 'Collection was successfully created.' }\n format.json { render :show, status: :created, location: @collection }\n @user=User.find_by name: session[:user]\n\n @collection_user = CollectionUser.new\n @collection_user.id_collection = @collection.id\n @collection_user.id_user = @user.id\n @collection_user.save\n else\n format.html { render :new }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n\n end\n end\n end", "def post(path, collection)\n # remove the leading slash\n path = path.gsub(/\\A\\//, '')\n\n headers = self.class.headers.clone\n headers['Content-Type'] = @media_type\n\n response = case @media_type\n when 'application/occi+json'\n self.class.post(@endpoint + path,\n :body => collection.to_json,\n :headers => headers)\n when 'text/occi'\n self.class.post(@endpoint + path,\n :headers => collection.to_header.merge(headers))\n else\n self.class.post(@endpoint + path,\n :body => collection.to_text,\n :headers => headers)\n end\n\n response_msg = response_message response\n\n case response.code\n when 200\n collection = Occi::Parser.parse(response.header[\"content-type\"].split(\";\").first, response.body)\n\n if collection.empty?\n Occi::Parser.locations(response.header[\"content-type\"].split(\";\").first, response.body, response.headers).first\n else\n collection.resources.first.location if collection.resources.first\n end\n when 201\n # TODO: OCCI-OS hack, look for header Location instead of uri-list\n # This should be probably implemented in Occi::Parser.locations\n if response.header['location']\n response.header['location']\n else\n Occi::Parser.locations(response.header[\"content-type\"].split(\";\").first, response.body, response.headers).first\n end\n else\n raise \"HTTP POST failed! #{response_msg}\"\n end\n end", "def create\n @collection = current_user.collections.find(params[:collection_id])\n @entity_type = @collection.entity_types.new(params[:entity_type])\n\n respond_to do |format|\n if @entity_type.save\n format.html { redirect_to collection_entity_types_path(@collection), notice: 'Type was successfully created.' }\n format.json { render json: @entity_type, status: :created, location: @entity_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @entity_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @collections = current_user.collections.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @collections }\n end\n end", "def list\n @collections = Admin::Collection.names\n\n render json: { collections: @collections }\n end", "def create\n # if we are here, then the user has already been authorized per call to\n # load_and_authorize_resource (see above).\n # For now, we are not allowing non-admin users to create CustomCollection owned by an Org\n # and they can only create CustomCollections for themselves, so go ahead and assign @current_user.\n params[:custom_collection][:owner] = @current_user\n\n @custom_collection = CustomCollection.new(params[:custom_collection])\n\n respond_to do |format|\n if @custom_collection.save\n format.html {\n if cookies[:redirect_to]\n target = cookies[:redirect_to]\n cookies[:redirect_to] = nil\n else\n target = @custom_collection\n end\n redirect_to target, notice: 'Custom collection was successfully created.'\n }\n format.json { render json: @custom_collection, status: :created, location: @custom_collection }\n else\n format.html { render action: \"new\" }\n format.json { render json: @custom_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def collection(slug, options)\n _get(\"v1/collections/\" + slug, options)\n end", "def index\n breadcrumb_for_collections\n @collections = @user.collections.all\n if params[:name].present?\n @collections = @collections.where(\"name = ?\", params[:name])\n end\n @collections = @collections.order(sort_column + \" \" + sort_direction)\n\n respond_to do |format|\n format.html\n format.json {render json:@collections.as_json(only: [:id, :name, :documents_count])}\n end\n end", "def collection\n Rails.logger.info \"XXXXX COLLECTION NAME #{collection_hash['collection name']}\"\n\n @collection ||= CollectionCreator.find_or_create_collection(\n collection_hash['collection name'],\n collection_hash['unit name'],\n collection_hash['collection description'],\n submitter_user_key\n )\n end", "def collection_params\n list = %i[\n crt mod scm ver dty usn ls tags\n ]\n list << {conf: {}, dconf: {}, decks: {}, models: {}}\n params.require(:collection).permit(*list)\n end", "def create_collection_with_http_info(collection_id, collection, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CollectionsApi.create_collection ...'\n end\n # verify the required parameter 'collection_id' is set\n if @api_client.config.client_side_validation && collection_id.nil?\n fail ArgumentError, \"Missing the required parameter 'collection_id' when calling CollectionsApi.create_collection\"\n end\n # verify the required parameter 'collection' is set\n if @api_client.config.client_side_validation && collection.nil?\n fail ArgumentError, \"Missing the required parameter 'collection' when calling CollectionsApi.create_collection\"\n end\n # resource path\n local_var_path = '/v4/collections'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'collection_id'] = collection_id\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\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(collection)\n\n # return_type\n return_type = opts[:debug_return_type] || 'Collection'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['BasicAuth']\n\n new_options = opts.merge(\n :operation => :\"CollectionsApi.create_collection\",\n :header_params => 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: CollectionsApi#create_collection\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @image_collection = ImageCollection.new(image_collection_params)\n\n respond_to do |format|\n if @image_collection.save\n image_collection_params[:attached_images].reject(&:empty?).each do |id|\n @image_collection.images << Image.find(id)\n end\n\n @image_collection.save\n\n format.html { redirect_to @image_collection, notice: 'Image collection was successfully created.' }\n format.json { render :show, status: :created, location: @image_collection }\n else\n format.html { render :new }\n format.json { render json: @image_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @men_shop_collection = MenShopCollection.new(men_shop_collection_params)\n\n respond_to do |format|\n if @men_shop_collection.save\n format.html { redirect_to @men_shop_collection, notice: 'Men shop collection was successfully created.' }\n format.json { render :show, status: :created, location: @men_shop_collection }\n else\n format.html { render :new }\n format.json { render json: @men_shop_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def collection_params\n params.require(:collection).permit(:name, :note, :source, :cdate, :key)\n end", "def create\n @book_collection = current_user.book_collections.build(book_collection_params)\n\n respond_to do |format|\n begin\n if @book_collection.save\n format.html { redirect_to book_collections_path, notice: \"Book collection was successfully created.\" }\n format.json { render :show, status: :created, location: @book_collection }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @book_collection.errors, status: :unprocessable_entity }\n end\n rescue ActiveRecord::RecordNotUnique\n format.html { redirect_to @book_collection, status: :unprocessable_entity }\n format.json { render json: @book_collection.errors, status: :unprocessable_entity }\n end\n end\n\n end", "def create\n #@visit = params[:visits]\n Visit.collection.insert_many(params[:visits]) #save to batch to database mongoid awesome\n \n end", "def create_container(collection, container = nil)\n active_container = container\n if active_container.nil?\n active_container = {\n \"metadata\": [\n {\n \"key\": \"dc.title\",\n \"language\": \"en_US\",\n \"value\": \"Empty Container Document\"\n },\n {\n \"key\": \"dc.contributor.author\",\n \"language\": \"en_US\",\n \"value\": \"Data Services, Bobst Library\"\n }\n ]\n }\n end\n cmd = `curl -X POST -H \"Content-Type: application/json\" -H \"Accept: application/json\" -H \"rest-dspace-token: #{@token}\" -d '#{JSON.generate(active_container)}' #{ENV[\"FDA_REST_ENDPOINT\"]}/collections/#{collection}/items --insecure -s`\n return JSON.parse(cmd)\n end", "def create_example_collection(user)\n collection = Collection.create(\n name: 'Examples',\n user_id: user.id\n )\n req_a = Request.create(\n title: 'GET with params and api_key',\n method: 'GET',\n url: 'https://calendarific.com/api/v2/holidays',\n collection_id: collection.id\n )\n attr_a = [{attr_type: 'params', key: 'country', value: 'US', description: 'get all US holidays'},\n {attr_type: 'params', key: 'year', value: '2020', description: 'for 2020'},\n {attr_type: 'auth', key: 'api_key', value: '823747516d829b140ef9807ad001d167526c64bf', description: 'params'}]\n attr_a.each do |atr|\n Attrib.create(\n attr_type: atr[:attr_type],\n key: atr[:key],\n value: atr[:value],\n description: atr[:description],\n request_id: req_a.id\n )\n end\n\n req_b = Request.create(\n title: 'GET User not found 404',\n method: 'GET',\n url: 'https://reqres.in/api/users/23',\n collection_id: collection.id\n )\n\n req_c = Request.create(\n title: 'POST Create user',\n method: 'POST',\n url: 'https://reqres.in/api/users',\n collection_id: collection.id\n )\n Attrib.create(\n attr_type: 'headers',\n key: 'Content-type',\n value: 'application/json',\n description: '',\n request_id: req_c.id\n )\n Body.create(\n body_type: 'Raw',\n key: '',\n value: '',\n description: '',\n raw_body: \n'{\n \"name\": \"morpheus\",\n \"job\": \"leader\"\n}',\n request_id: req_c.id\n )\n\n req_d = Request.create(\n title: 'UPDATE an employee record',\n method: 'PUT',\n url: 'http://dummy.restapiexample.com/api/v1/update/21',\n collection_id: collection.id\n )\n Attrib.create(\n attr_type: 'headers',\n key: 'Content-type',\n value: 'application/json',\n description: '',\n request_id: req_d.id\n )\n Body.create(\n body_type: 'Raw',\n key: '',\n value: '',\n description: '',\n raw_body: \n'{\n \"name\":\"test1\",\n \"salary\":\"1123\",\n \"age\":\"23\"\n}',\n request_id: req_d.id\n )\n \n req_e = Request.create(\n title: 'DELETE a resource',\n method: 'DELETE',\n url: 'https://jsonplaceholder.typicode.com/posts/1',\n collection_id: collection.id\n )\n end", "def index\n respond_with(@collection) do |format|\n format.json { render :json => @collection.to_json(collection_serialization_options) }\n end\n end", "def new\n @collection = Collection.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @collection }\n end\n end", "def sub_collection_params\n params.require(:sub_collection).permit(:name, :description, :collection, :collection_id)\n end", "def create\n @resume_collection = ResumeCollection.new(resume_collection_params)\n\n respond_to do |format|\n if @resume_collection.save\n format.html { redirect_to @resume_collection, notice: 'Resume collection was successfully created.' }\n format.json { render action: 'show', status: :created, location: @resume_collection }\n else\n format.html { render action: 'new' }\n format.json { render json: @resume_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def collections\n response = RequestResponse.new\n name_resp = collection_names\n name_resp.callback do |names|\n collections = names.map do |name|\n EM::Mongo::Collection.new(@db_name, name, @em_connection)\n end\n response.succeed collections\n end\n name_resp.errback { |err| response.fail err }\n response\n end", "def new\n @collection = Collection.new\n respond_to do |format|\n format.html { create }\n format.json { render :json => @collection }\n end\n end", "def create\n @audio_collection = AudioCollection.new(audio_collection_params)\n\n respond_to do |format|\n if @audio_collection.save\n format.html { redirect_to @audio_collection, notice: 'Audio collection was successfully created.' }\n format.json { render :show, status: :created, location: @audio_collection }\n else\n format.html { render :new }\n format.json { render json: @audio_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @collections = Collection.all\n end", "def index\n @collections = Collection.all\n end", "def new\n @collection = Collection.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @collection }\n end\n end" ]
[ "0.7406109", "0.73826146", "0.7293025", "0.70655507", "0.70375437", "0.6995771", "0.6995771", "0.69555485", "0.6955021", "0.6950639", "0.6943942", "0.6942102", "0.69265264", "0.6894755", "0.6851965", "0.6742832", "0.67059416", "0.6694796", "0.6656791", "0.6656791", "0.65599173", "0.6536105", "0.65153337", "0.65092415", "0.649355", "0.64821213", "0.6479584", "0.64563113", "0.6455857", "0.644941", "0.6444761", "0.64442337", "0.6440465", "0.6406747", "0.6406358", "0.64034224", "0.63253695", "0.6316057", "0.6307466", "0.63043886", "0.62962365", "0.62937325", "0.62644726", "0.62560314", "0.6246722", "0.62355256", "0.622459", "0.6219397", "0.6202452", "0.61645716", "0.61606044", "0.6155576", "0.61510515", "0.6119772", "0.6106857", "0.61061144", "0.60685587", "0.6068355", "0.6048269", "0.6042177", "0.6030343", "0.6027329", "0.60229903", "0.6021424", "0.59779507", "0.59779507", "0.59741294", "0.59732157", "0.5971091", "0.5957066", "0.5941418", "0.5935099", "0.5929038", "0.5921157", "0.59173244", "0.5915762", "0.5912566", "0.5879821", "0.5864007", "0.5858691", "0.5840074", "0.5831428", "0.5814778", "0.5807588", "0.5807464", "0.5793094", "0.5792995", "0.5787605", "0.57839584", "0.5783793", "0.5781424", "0.5758323", "0.57474744", "0.5739015", "0.57359135", "0.5704973", "0.5704781", "0.5702602", "0.5702602", "0.5686111" ]
0.5710844
95
PATCH/PUT /collections/1 PATCH/PUT /collections/1.json
def update respond_to do |format| if @collection.update(collection_params) format.html { redirect_to @collection, notice: 'Collection was successfully updated.' } format.json { render :show, status: :ok, location: @collection } else format.html { render :edit } format.json { render json: @collection.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n render_json :status => :forbidden and return unless @collection.write?(@user, @client)\n if !params[:collection]\n render_json :status => :bad_request, :messages => \"Tried to update collection with no data.\" and return\n end\n @collection.update_attributes(params[:collection].slice(:metadata, :read_only, :title, :tags, :priv))\n render_json :entry => @collection.to_hash(@user, @client) and return\n end", "def update\n @collection = Collection.find(params[:id])\n\n respond_to do |format|\n if @collection.update_attributes(params[:collection])\n format.html { redirect_to @collection, :notice => 'Collection was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @collection.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @collection = Collection.find(params[:id])\n\n respond_to do |format|\n if @collection.update_attributes(params[:collection])\n format.html { redirect_to @collection, notice: 'Collection was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @collection = Collection.find(params[:id])\n\n respond_to do |format|\n if @collection.update_attributes(params[:collection])\n format.html { redirect_to @collection, notice: 'Collection was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @collection = Collection.find(params[:id])\n\n respond_to do |format|\n if @collection.update_attributes(params[:collection])\n format.html { redirect_to @collection, notice: 'Collection was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @collection.update(collection_params)\n render json: @collection, status: :ok#, location: @collection\n else\n render json: @collection.errors, status: :unprocessable_entity\n end\n end", "def update\n authorize! :update, @collection\n respond_to do |format|\n if @collection.update(collection_params)\n format.html { redirect_to collection_url(@collection), notice: \"Collection '#{@collection.title}' was successfully updated.\" }\n format.json { render :show, status: :ok, location: @collection }\n else\n format.html { render :edit }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @collection = @current_user.collections.find(params[:id])\n\n respond_to do |format|\n if @collection.update_attributes(params[:collection])\n format.html { redirect_to [@current_user, @collection],\n notice: 'Collection was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @collection.errors, \n status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @collection.update(collection_params)\n format.html { redirect_to account_collections_url, notice: 'Collection was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n return_to = @collection.is_root? ? collections_path : collection_path\n respond_to do |format|\n if @collection.update(collection_params)\n format.html { redirect_to return_to, notice: 'Collection was successfully updated.' }\n format.json { render :show, status: :ok, location: @collection }\n else\n format.html { render :edit }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @collection.update(collection_params)\n format.html { redirect_to collection_documents_path(@collection), notice: 'The collection was successfully updated.' }\n format.json { render :show, status: :ok, location: @collection }\n else\n format.html { render :edit }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @custom_collection = CustomCollection.find(params[:id])\n\n respond_to do |format|\n if @custom_collection.update_attributes(params[:custom_collection])\n format.html { redirect_to @custom_collection, notice: 'Custom collection was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @custom_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize! :update, params[:id]\n @collection = Collection.find(params[:id])\n flash[:notice] = 'Collection was successfully updated.' if @collection.update(collection_params)\n respond_with(@collection)\n end", "def update\n respond_to do |format|\n if @collection.update(collection_params)\n format.html { redirect_to '/collections'}#@collection, notice: 'Collection was successfully updated.' }\n format.json { render :show, status: :ok, location: @collection }\n else\n format.html { render :edit }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @collection = Collection.find(params[:id])\n\n respond_to do |format|\n if @collection.update_attributes(params[:collection])\n flash[:notice] = 'Collection was successfully updated.'\n format.html { redirect_to(@collection) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @collection.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @collection.update(collection_params)\n format.html { redirect_to @collection, success: 'Collection was successfully updated.' }\n format.json { render :show, status: :ok, location: @collection }\n else\n format.html { redirect_to @collection, alert: 'Collection was not updated.' }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @collection = Collection.find(params[:id])\n @user = User.find(params[:user_id])\n\n respond_to do |format|\n if @collection.update_attributes(params[:collection])\n format.html { redirect_to @collection, notice: 'Collection was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @collection = args[:collection] if args.key?(:collection)\n end", "def update\n @collection = Collection.find(params[:id])\n expire_front\n\n\n respond_to do |format|\n if @collection.update_attributes(params[:collection])\n format.html { redirect_to @collection, notice: 'Collection was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @collection = Collection.find(params[:id])\n\n respond_to do |format|\n if @collection.update_attributes(params[:collection])\n save_activity(@collection, \"updated collection\")\n \n flash[:notice] = \"Collection #{@collection.name} was successfully updated.\"\n format.html { redirect_to(:action=>:show, :id => @collection) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @collection.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @data_collection = DataCollection.find(params[:id])\n\n respond_to do |format|\n if @data_collection.update_attributes(params[:data_collection])\n format.html { redirect_to @data_collection, notice: 'Data collection was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @data_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @item_collection = ItemCollection.find(params[:id])\n\n respond_to do |format|\n if @item_collection.update(item_collection_params)\n format.html { redirect_to @item_collection, notice: 'La collection a été mise à jour ' }\n format.json { render :show, status: :ok, location: @item_collection }\n else\n format.html { render :edit }\n format.json { render json: @item_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def perform_put_with_objects_from_collection(path, options, klass, collection_name)\n perform_request_with_objects_from_collection(:put, path, options, klass, collection_name)\n end", "def update\n respond_to do |format|\n if @users_collection.update(users_collection_params)\n format.html { redirect_to @users_collection, notice: 'Collection was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @users_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @glo_collection.update(glo_collection_params)\n format.html { redirect_to @glo_collection, notice: 'Glo collection was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @glo_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @user_collection.update(user_collection_params)\n format.html { redirect_to @user_collection }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @collection_ids = args[:collection_ids] if args.key?(:collection_ids)\n @input_uri_prefix = args[:input_uri_prefix] if args.key?(:input_uri_prefix)\n end", "def put_collection_key(args)\n\tapi_url = \"#{@base_url}/#{args[:collection]}/#{args[:key]}\"\n\tputs do_the_put_call( url: api_url, user: @user, json: args[:json] )\nend", "def update!(**args)\n @collection = args[:collection] if args.key?(:collection)\n @remodelings = args[:remodelings] if args.key?(:remodelings)\n end", "def update\n update! do |success, failure|\n success.html { redirect_to collection_path }\n end\n end", "def update\n respond_to do |format|\n if @root_collection.update(root_collection_params)\n format.html { redirect_to @root_collection, notice: 'Root collection was successfully updated.' }\n format.json { render :show, status: :ok, location: @root_collection }\n else\n format.html { render :edit }\n format.json { render json: @root_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @collection = @institution.collections.find(params[:id])\n\n respond_to do |format|\n if @collection.update_attributes(params[:collection])\n format.html { redirect_to [@collection.institution, @collection], notice: 'Collection was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render layout: 'form', action: \"edit\" }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @collection_type = CollectionType.find(params[:id])\n\n respond_to do |format|\n if @collection_type.update_attributes(params[:collection_type])\n format.html { redirect_to @collection_type, notice: 'Collection type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @collection_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_collection(collection)\n # Take the name out of the list of keys so that all that remains are fields to\n # be updated\n name = collection.delete(:name)\n # Because the name may come in many forms we must use something like titlecase to help\n # account for variations\n name = name.last.titleize\n \n # Due to the way that batches are handled a collection may appear multiple times. Presume\n # that if it has already been processed it is safe to skip any duplicates\n if (@successful_updates.include?(name) or \n @failed_updates.include?(name))\n log_message(\"Skipping duplicate collection entry\")\n return\n end\n\n coll = Collection.where(title: name).first\n \n if (coll.present? and (coll.title == name))\n log_message(\"Processing #{coll.title}\")\n update_and_save_metadata(coll, collection) \n @successful_updates << name\n else\n log_message(\"Could not locate #{name}\", Logger::WARN)\n @failed_updates << name\n end\n end", "def update_collection(database_id:, collection_id:, name:, permissions: nil, document_security: nil, enabled: nil)\n path = '/databases/{databaseId}/collections/{collectionId}'\n .gsub('{databaseId}', database_id)\n .gsub('{collectionId}', collection_id)\n\n if database_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"databaseId\"')\n end\n\n if collection_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"collectionId\"')\n end\n\n if name.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"name\"')\n end\n\n params = {\n name: name,\n permissions: permissions,\n documentSecurity: document_security,\n enabled: enabled,\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'PUT',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::Collection\n )\n end", "def put\n if(resource.collection?)\n Forbidden\n elsif(!resource.parent_exists? || !resource.parent_collection?)\n Conflict\n else\n resource.lock_check if resource.supports_locking?\n status = resource.put(request, response)\n response['Location'] = \"#{scheme}://#{host}:#{port}#{url_format(resource)}\" if status == Created\n response.body = response['Location']\n status\n end\n end", "def update\n upload_slides(params)\n build_kiosks(params)\n respond_to do |format|\n if @collection.update(collection_params)\n format.html { redirect_to @collection, notice: 'Collection was successfully updated.' }\n format.json { render :show, status: :ok, location: @collection }\n else\n format.html { render :edit }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @jewelrycollection.update(jewelrycollection_params)\n format.html { redirect_to @jewelrycollection, notice: 'Jewelrycollection was successfully updated.' }\n format.json { render :show, status: :ok, location: @jewelrycollection }\n else\n format.html { render :edit }\n format.json { render json: @jewelrycollection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @shared_collection.update(shared_collection_params)\n format.html { redirect_to @shared_collection, notice: 'Shared collection was successfully updated.' }\n format.json { render :show, status: :ok, location: @shared_collection }\n else\n format.html { render :edit }\n format.json { render json: @shared_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category_collection = CategoryCollection.find(params[:id])\n @collection = @category_collection.collection\n\n respond_to do |format|\n if @category_collection.update_attributes(params[:category_collection])\n flash[:notice] = 'CategoryCollection was successfully updated.'\n format.html { redirect_to(@collection) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @category_collection.errors, :status => :unprocessable_entity }\n end\n end\n end", "def perform_put_with_object_from_collection(path, options, klass, collection_name)\n perform_request_with_object_from_collection(:put, path, options, klass, collection_name)\n end", "def update_collection_with_http_info(collection_id, update_mask, collection, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CollectionsApi.update_collection ...'\n end\n # verify the required parameter 'collection_id' is set\n if @api_client.config.client_side_validation && collection_id.nil?\n fail ArgumentError, \"Missing the required parameter 'collection_id' when calling CollectionsApi.update_collection\"\n end\n # verify the required parameter 'update_mask' is set\n if @api_client.config.client_side_validation && update_mask.nil?\n fail ArgumentError, \"Missing the required parameter 'update_mask' when calling CollectionsApi.update_collection\"\n end\n # verify the required parameter 'collection' is set\n if @api_client.config.client_side_validation && collection.nil?\n fail ArgumentError, \"Missing the required parameter 'collection' when calling CollectionsApi.update_collection\"\n end\n # resource path\n local_var_path = '/v4/collections/{collection_id}'.sub('{' + 'collection_id' + '}', CGI.escape(collection_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'update_mask'] = update_mask\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\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(collection)\n\n # return_type\n return_type = opts[:debug_return_type] || 'Collection'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['BasicAuth']\n\n new_options = opts.merge(\n :operation => :\"CollectionsApi.update_collection\",\n :header_params => 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(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CollectionsApi#update_collection\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n respond_to do |format|\n if @resume_collection.update(resume_collection_params)\n format.html { redirect_to @resume_collection, notice: 'Resume collection was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @resume_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @collection = args[:collection] if args.key?(:collection)\n @method_map = args[:method_map] if args.key?(:method_map)\n @options = args[:options] if args.key?(:options)\n end", "def update(attributes, collection)\n #collection[0].model.last_query = [attributes, collection]\n fm_params = prepare_fmp_attributes(attributes)\n counter = 0\n collection.each do |resource|\n rslt = layout(resource.model).edit(resource.instance_variable_get(:@_record_id), fm_params)\n merge_fmp_response(resource, rslt[0])\n resource.persistence_state = DataMapper::Resource::PersistenceState::Clean.new resource\n counter +=1\n end\n counter \n end", "def update\n respond_to do |format|\n if @book_collection.update(book_collection_params)\n format.html { redirect_to @book_collection, notice: \"Book collection was successfully updated.\" }\n format.json { render :show, status: :ok, location: @book_collection }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @book_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @collection = args[:collection] if args.key?(:collection)\n @excluded_collection = args[:excluded_collection] if args.key?(:excluded_collection)\n @id = args[:id] if args.key?(:id)\n @identifier = args[:identifier] if args.key?(:identifier)\n @in_all_collections = args[:in_all_collections] if args.key?(:in_all_collections)\n @include_geolocation_data = args[:include_geolocation_data] if args.key?(:include_geolocation_data)\n @remodelings = args[:remodelings] if args.key?(:remodelings)\n end", "def populate_collection(args)\n\targs[:keys].each do |key|\n\t\tapi_url = \"#{@base_url}/#{args[:collection]}/#{key}\"\n\t\tputs do_the_put_call({ url: api_url, user: @user, json: args[:json][key] })\n\tend\nend", "def update\n respond_to do |format|\n if @fine_collection.update(fine_collection_params)\n format.html { redirect_to @fine_collection, notice: 'Fine collection was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @fine_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n begin\n @collection = Collection.find(params[:id])\n if params[:collection][:invite_only] && params[:invitations]\n @collection.invited_user_ids = params[:invitations][:user_ids] \n end\n @collection.assign_attributes(params[:collection])\n\n @collection.transaction do\n @collection.save!\n end\n\n render \"show\", handlers: [:rabl]\n \n rescue ActiveRecord::RecordInvalid => invalid\n render :json => @collection.errors.full_messages, status: 422\n end\n end", "def update(attributes, collection)\n @log.debug(\"Update called with:\\nAttributes #{attributes.inspect} \\nCollection: #{collection.inspect}\")\n updated = 0\n the_properties = {}\n attributes.each{|property, value| the_properties[property.field] = value}\n collection.each do |resource|\n model = resource.model\n class_name = class_name(model)\n id = model.serial.get(resource)\n @log.debug(\"Building edit URL with #{model} and #{id}\")\n edit_url = build_edit_url(class_name, id)\n begin\n page = @agent.get(edit_url) \n form_id = build_form_id(class_name, :update_form_id, id)\n @log.debug(\"Form id is #{form_id}\")\n the_form = page.form_with(:id => form_id)\n update_form = fill_form(the_form, the_properties, class_name)\n @log.debug(\"Update form is #{update_form.inspect}\")\n response = @agent.submit(update_form)\n @log.debug(\"Result of actual update call is #{response.code}\")\n if response.code.to_i == 302\n updated += 1\n end\n rescue => e\n @log.error(\"Failure while updating #{e.inspect}\")\n end\n end\n\n updated\n end", "def update\n respond_to do |format|\n if @image_collection.update(image_collection_params)\n format.html { redirect_to @image_collection, notice: 'Image collection was successfully updated.' }\n format.json { render :show, status: :ok, location: @image_collection }\n else\n format.html { render :edit }\n format.json { render json: @image_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @special_collection_request.update(special_collection_request_params)\n format.html { redirect_to @special_collection_request, notice: 'Special collection request was successfully updated.' }\n format.json { render :show, status: :ok, location: @special_collection_request }\n else\n format.html { render :edit }\n format.json { render json: @special_collection_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @note_collection.update(note_collection_params)\n format.html { redirect_to @note_collection, notice: 'Note collection was successfully updated.' }\n format.json { render :show, status: :ok, location: @note_collection }\n else\n format.html { render :edit }\n format.json { render json: @note_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @collection_post.update(collection_post_params)\n format.html { redirect_to @collection_post, notice: 'Collection post was successfully updated.' }\n format.json { render :show, status: :ok, location: @collection_post }\n else\n format.html { render :edit }\n format.json { render json: @collection_post.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(attributes, collection)\n return 0 unless collection.query.valid?\n adapter.update(attributes, collection)\n end", "def update\n params[:collection][:archive] = Archive.find_by_title(params[:collection][:archive])\n params[:collection][:plugin] = Plugin.find_by_name(params[:collection][:plugin]) || \n @collection.plugin;\n params[:collection].delete(:plugin_name_other)\n params[:collection][:plugin] ||= @collection.plugin;\n params[:collection][:base_url] ||= @collection.base_url; \n \n respond_to do |format|\n if @collection.update_attributes(params[:collection])\n flash[:notice] = 'Collection was successfully updated.'\n format.html { redirect_to(@collection) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @collection.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @collection = @document.collection\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_back fallback_location: collection_documents_path(@collection), notice: 'The document was successfully updated.' }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit }\n format.json { render json: {error: @document.errors}, status: :unprocessable_entity }\n end\n end\n end", "def put(path, collection)\n # remove the leading slash\n path = path.gsub(/\\A\\//, '')\n\n headers = self.class.headers.clone\n headers['Content-Type'] = @media_type\n\n response = case @media_type\n when 'application/occi+json'\n self.class.post(@endpoint + path,\n :body => collection.to_json,\n :headers => headers)\n when 'text/occi'\n self.class.post(@endpoint + path,\n :headers => collection.to_header.merge(headers))\n else\n self.class.post(@endpoint + path,\n :body => collection.to_text,\n :headers => headers)\n end\n\n response_msg = response_message response\n\n case response.code\n when 200, 201\n Occi::Parser.parse(response.header[\"content-type\"].split(\";\").first, response)\n else\n raise \"HTTP POST failed! #{response_msg}\"\n end\n end", "def update!(**args)\n @collection_ids = args[:collection_ids] if args.key?(:collection_ids)\n @output_uri_prefix = args[:output_uri_prefix] if args.key?(:output_uri_prefix)\n end", "def update\n @collection = current_user.collections.find(params[:collection_id])\n @entity_type = @collection.entity_types.find(params[:id])\n \n if session[:edit_referrer].nil? \n success_path = collection_entity_types_path(@collection)\n else\n success_path = session[:edit_referrer]\n session[:edit_referrer] = nil\n end\n \n respond_to do |format|\n if @entity_type.update_attributes(params[:entity_type])\n format.html { redirect_to success_path, notice: 'Type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @entity_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @audio_collection.update(audio_collection_params)\n format.html { redirect_to @audio_collection, notice: 'Audio collection was successfully updated.' }\n format.json { render :show, status: :ok, location: @audio_collection }\n else\n format.html { render :edit }\n format.json { render json: @audio_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @stock_collection.update(stock_collection_params)\n format.html { redirect_to @stock_collection, notice: 'Stock collection was successfully updated.' }\n format.json { render :show, status: :ok, location: @stock_collection }\n else\n format.html { render :edit }\n format.json { render json: @stock_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @collection_attribute = CollectionAttribute.find(params[:id])\n\n respond_to do |format|\n if @collection_attribute.update_attributes(params[:collection_attribute])\n flash[:notice] = 'CollectionAttribute was successfully updated.'\n format.html { redirect_to(@collection_attribute) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @collection_attribute.errors, :status => :unprocessable_entity }\n end\n end\n end", "def put(path, collection)\n # remove the leading slash\n path = path.gsub(/\\A\\//, '')\n\n headers = self.class.headers.clone\n headers['Content-Type'] = @media_type\n\n response = case @media_type\n when 'application/occi+json'\n self.class.post(@endpoint + path,\n :body => collection.to_json,\n :headers => headers)\n when 'text/occi'\n self.class.post(@endpoint + path,\n :headers => collection.to_header.merge(headers))\n else\n self.class.post(@endpoint + path,\n :body => collection.to_text,\n :headers => headers)\n end\n\n response_msg = response_message response\n\n case response.code\n when 200, 201\n Occi::Parser.parse(response.header[\"content-type\"].split(\";\").first, response.body)\n else\n raise \"HTTP POST failed! #{response_msg}\"\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(attributes, collection)\n raise NotImplementedError, \"#{self.class}#update not implemented\"\n end", "def update_attributes\n return transform_attributes.except(:id) if klass == Collection\n if attributes[:collection].present?\n transform_attributes.except(:id).except(:collection).merge(member_of_collections_attributes: { 0 => { id: collection.id } })\n elsif attributes[:collections].present?\n collection_ids = attributes[:collections].each.with_index.each_with_object({}) do |(element, index), ids|\n ids[index] = element\n end\n transform_attributes.except(:id).except(:collections).merge(member_of_collections_attributes: collection_ids)\n else\n transform_attributes.except(:id)\n end\n end", "def update(collection, entity)\n command(collection).update(entity)\n end", "def update!(**args)\n @collection_id = args[:collection_id] if args.key?(:collection_id)\n @collection_score = args[:collection_score] if args.key?(:collection_score)\n end", "def patch!\n request! :patch\n end", "def update!(**args)\n @collection_overrides = args[:collection_overrides] if args.key?(:collection_overrides)\n @credential = args[:credential] if args.key?(:credential)\n @custom_certificate_authority_roots = args[:custom_certificate_authority_roots] if args.key?(:custom_certificate_authority_roots)\n @description = args[:description] if args.key?(:description)\n @descriptor_url = args[:descriptor_url] if args.key?(:descriptor_url)\n @id = args[:id] if args.key?(:id)\n @insert_time = args[:insert_time] if args.key?(:insert_time)\n @labels = args[:labels] if args.key?(:labels)\n @name = args[:name] if args.key?(:name)\n @operation = args[:operation] if args.key?(:operation)\n @options = args[:options] if args.key?(:options)\n @self_link = args[:self_link] if args.key?(:self_link)\n end", "def update!(**args)\n @collection_id = args[:collection_id] if args.key?(:collection_id)\n @locking_user = args[:locking_user] if args.key?(:locking_user)\n end", "def update\n respond_to do |format|\n action_message_for(@collection.content_item.status)\n if update_collection\n format.html { redirect_to redirect_target(@collection), flash: @feedback_flash }\n format.json { render :show, status: :ok, location: @collection }\n else\n 1.times { @collection.collection_sections.new } if @collection.collection_sections.empty?\n @collection.collection_sections.each do |section|\n (6 - section.section_items.size).times { section.section_items.new }\n end\n @collection.content_item.status = session[:content_item_status]\n format.html { render :edit }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @collection = @entity_type.collection\n respond_to do |format|\n if @entity_type.update(entity_type_params)\n format.html { redirect_to collection_entity_types_path(@collection), notice: 'The entity type was successfully updated.' }\n format.json { render :show, status: :ok, location: @entity_type }\n else\n format.html { render :edit }\n format.json { render json: @entity_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def operations\n { \"$set\" => { path => documents } }\n end", "def update options={}\n client.put(\"/#{id}\", options)\n end", "def update\n respond_to do |format|\n if @tweet_collection.update(tweet_collection_params)\n format.html { redirect_to @tweet_collection, notice: 'Tweet collection was successfully updated.' }\n format.json { render :show, status: :ok, location: @tweet_collection }\n else\n format.html { render :edit }\n format.json { render json: @tweet_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update # PATCH\n raise NotImplementedError\n end", "def update\n @collection = Atrium::Exhibit.find(params[:id])\n @collection.facet_order = params[:collection]\n\n respond_to do |format|\n format.json { render :json => @collection.facet_order }\n end\n end", "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend", "def put!\n request! :put\n end", "def update(options = {}, &block)\n object = get_resource_ivar || find_and_update_resource\n\n options[:location] = collection_path if object.errors.empty?\n\n respond_with_dual(object, options, &block)\n end", "def update!(**args)\n @collection_id = args[:collection_id] if args.key?(:collection_id)\n @label = args[:label] if args.key?(:label)\n end", "def update\n @collection = Collection.find(params[:id])\n authorize! :update, @collection\n\n respond_to do |format|\n if @collection.update_attributes(params[:collection])\n # create a new activity if the project is now published\n if @collection.published?\n # if collection is being published for the first time, add a public activity for it\n if @collection.published == false\n if @collection.unlisted?\n @collection.update_attributes(:privacy => \"public\")\n end\n @collection.create_activity :create, owner: current_user, primary: true\n # create notifications for the projects that are part of the collection\n collectifies = Collectify.where(:collection_id => @collection)\n collectifies.each do |collectify|\n if PublicActivity::Activity.where(\"trackable_type = ? AND trackable_id = ?\", \"Collectify\", collectify.id).blank? \n # add public activity\n collectify.project.users.each do |user|\n collectify.create_activity :create, owner: current_user, recipient: user, primary: true\n if current_user != @collection.user and user != @collection.user\n collectify.create_activity :owner_create, owner: current_user, recipient: @collection.user, primary: true\n end\n end\n end\n end\n end\n @collection.update_attributes(:published=>true)\n else\n collectifies = Collectify.where(:collection_id=>@collection)\n collectifies.each do |collectify|\n PublicActivity::Activity.where(\"trackable_type = ? AND trackable_id = ?\", \"Collectify\", collectify.id).destroy_all \n end\n PublicActivity::Activity.where(\"trackable_type = ? AND trackable_id = ?\", \"Collection\", @collection.id).destroy_all\n end\n\n format.html { redirect_to @collection }\n format.js\n format.json { head :no_content }\n else\n Rails.logger.debug \"#{@collection.errors.inspect}\"\n format.js { render :action=> \"edit\"}\n format.html { render :action => \"edit\" }\n format.json { render :json => @collection.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update_collections_for(user, collections, options = {})\n not_owned_collection = collections.find { |c| not c.owned_by?(user) }\n if not_owned_collection\n raise Exception.new(\"Tried to save listing to collection #{not_owned_collection.id}, which is not owned by user #{user.id}\")\n end\n already_saved_collections = self.collections_owned_by(user)\n to_save_collections = collections - already_saved_collections\n to_remove_collections = already_saved_collections - collections\n self.class.transaction do\n self.collections += to_save_collections\n self.collections -= to_remove_collections\n @saves_count = nil\n end\n end", "def update\n unless params[:update_collection].nil?\n process_banner_input\n process_logo_input\n end\n\n process_member_changes\n @collection.visibility = Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE unless @collection.discoverable?\n # we don't have to reindex the full graph when updating collection\n @collection.reindex_extent = Hyrax::Adapters::NestingIndexAdapter::LIMITED_REINDEX\n if @collection.update(collection_params.except(:members))\n # This is the reason for the monkey patch.\n redirect_to hyrax.dashboard_collection_path, notice: t('hyrax.dashboard.my.action.collection_update_success')\n else\n after_update_error\n end\n end", "def update\n respond_to do |format|\n if @cash_collection.update(cash_collection_params)\n format.html { redirect_to @cash_collection, notice: 'Cash collection was successfully updated.' }\n format.json { render :show, status: :ok, location: @cash_collection }\n else\n format.html { render :edit }\n format.json { render json: @cash_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(title: nil, description: nil, private: nil)\n params = {\n title: title,\n description: description,\n private: private\n }.select { |k,v| v }\n updated = JSON.parse(connection.put(\"/collections/#{id}\", params).body)\n self.title = updated[\"title\"]\n self.description = updated[\"description\"]\n self\n end", "def update attributes, collection #:nodoc:\n 0\n end", "def update\n @ipack = Ipack.find(params[:id])\n\n respond_to do |format|\n if @ipack.update_attributes(params[:ipack])\n format.html { redirect_to ipacks_url, notice: 'Collection successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ipack.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @survey = Survey.find(params[:id])\n json = params[:survey]\n json[:questions] = JSON.parse(json[:questions])\n json[:questions].each_with_index do |question, idx|\n json[:questions][idx]['id'] = idx + 1\n end\n\n respond_to do |format|\n if @survey.update_attributes(json)\n format.html { redirect_to @survey, notice: 'Survey was successfully updated.' }\n format.json { render json: @survey }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end", "def curation_concerns_collections\n resources :collections, only: :show do\n member do\n get 'page/:page', action: :index\n get 'facet/:id', action: :facet, as: :dashboard_facet\n end\n collection do\n put '', action: :update\n put :remove_member\n end\n end\n end", "def update\n respond_to do |format|\n if @ticketprice_collection.update(ticketprice_collection_params)\n format.html { redirect_to @ticketprice_collection, notice: 'Ticketprice collection was successfully updated.' }\n format.json { render :show, status: :ok, location: @ticketprice_collection }\n else\n format.html { render :edit }\n format.json { render json: @ticketprice_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @pending_titles_for_collection = PendingTitlesForCollection.find(params[:id])\n\n respond_to do |format|\n if @pending_titles_for_collection.update_attributes(params[:pending_titles_for_collection])\n format.html { redirect_to(@pending_titles_for_collection, :notice => 'Pending titles for collection was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @pending_titles_for_collection.errors, :status => :unprocessable_entity }\n end\n end\n end", "def mutate(single, collection, selection, update)\n assert_arr_types([selection, update], Hash)\n\n collection = collection.to_sym\n unless %i[urls documents].include?(collection)\n raise \"Invalid collection: #{collection}\"\n end\n\n result = if single\n @client[collection].update_one(selection, update)\n else\n @client[collection].update_many(selection, update)\n end\n raise 'DB write (update) failed' unless write_succeeded?(result)\n\n result.n\n end", "def update\n Rails.logger.debug params.inspect\n respond_to do |format|\n if @audio_collection.update(audio_collection_params)\n format.html { redirect_to @audio_collection, notice: 'Audio collection was successfully updated.' }\n format.json { render json: @audio_collection, status: :ok }\n else\n format.html { render text: @audio_collection.errors.to_json }\n format.json { render json: @audio_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_collection_with_http_info(application_id, campaign_id, collection_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementApi.update_collection ...'\n end\n # verify the required parameter 'application_id' is set\n if @api_client.config.client_side_validation && application_id.nil?\n fail ArgumentError, \"Missing the required parameter 'application_id' when calling ManagementApi.update_collection\"\n end\n # verify the required parameter 'campaign_id' is set\n if @api_client.config.client_side_validation && campaign_id.nil?\n fail ArgumentError, \"Missing the required parameter 'campaign_id' when calling ManagementApi.update_collection\"\n end\n # verify the required parameter 'collection_id' is set\n if @api_client.config.client_side_validation && collection_id.nil?\n fail ArgumentError, \"Missing the required parameter 'collection_id' when calling ManagementApi.update_collection\"\n end\n # verify the required parameter 'body' is set\n if @api_client.config.client_side_validation && body.nil?\n fail ArgumentError, \"Missing the required parameter 'body' when calling ManagementApi.update_collection\"\n end\n # resource path\n local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'collectionId' + '}', CGI.escape(collection_id.to_s))\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 header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(body) \n\n # return_type\n return_type = opts[:return_type] || 'Collection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['management_key', 'manager_auth']\n\n new_options = opts.merge(\n :header_params => 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(:PUT, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementApi#update_collection\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end" ]
[ "0.72595423", "0.7024464", "0.6988568", "0.6988568", "0.6988568", "0.6967083", "0.69305056", "0.6921532", "0.6830486", "0.67997783", "0.6757201", "0.6719196", "0.6689609", "0.6638305", "0.6585662", "0.6583257", "0.65761065", "0.65675074", "0.651061", "0.64499813", "0.639242", "0.6320666", "0.6314561", "0.631433", "0.62621164", "0.62411124", "0.62188244", "0.62002593", "0.61631763", "0.61536217", "0.6150662", "0.61462134", "0.6142542", "0.612273", "0.6121604", "0.6121511", "0.6108127", "0.608976", "0.6073885", "0.6070525", "0.6062584", "0.6034732", "0.60341716", "0.60132205", "0.6005387", "0.5944466", "0.5940477", "0.5937297", "0.59249806", "0.58911055", "0.587606", "0.5871832", "0.5867767", "0.58531815", "0.5798542", "0.5788934", "0.5781608", "0.5777322", "0.57763165", "0.5775046", "0.57610226", "0.5726919", "0.57213795", "0.5718014", "0.5709625", "0.5701867", "0.57001954", "0.56878084", "0.56810385", "0.5654894", "0.5649889", "0.5637772", "0.5621004", "0.56190854", "0.5617037", "0.55963254", "0.5586263", "0.5584925", "0.5578884", "0.55787367", "0.55760485", "0.5574785", "0.5560226", "0.5552504", "0.55366826", "0.55258614", "0.55216914", "0.55077255", "0.5503207", "0.5478617", "0.54639536", "0.5463461", "0.5463302", "0.54544944", "0.54543716", "0.54522425", "0.5444199", "0.5440909" ]
0.6771792
11
DELETE /collections/1 DELETE /collections/1.json
def destroy gallery = @collection.gallery_id if @collection.destroy message = "Collection destroyed successfully" else message = "Collection could not be destroyed because it has images in it" end respond_to do |format| format.html { redirect_to gallery_collections_path(gallery), notice: message } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n response = connection.delete(\"/collections/#{id}\")\n (200..299).include?(response.status)\n end", "def destroy\n @collection = Collection.find(params[:id])\n @collection.destroy\n\n respond_to do |format|\n format.html { redirect_to collections_url }\n format.json { head :ok }\n end\n end", "def destroy\n @collection = Collection.find(params[:id])\n @collection.destroy\n\n respond_to do |format|\n format.html { redirect_to collections_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @collection = Collection.find(params[:id])\n @collection.destroy\n\n respond_to do |format|\n format.html { redirect_to collections_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @collection = Collection.find(params[:id])\n @collection.destroy\n\n respond_to do |format|\n format.html { redirect_to collections_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @collection = Collection.find(params[:id])\n @collection.destroy\n\n respond_to do |format|\n format.html { redirect_to collections_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @collection.destroy\n\n render json: @collection, status: :ok#, location: @collection\n end", "def destroy\n @collection.destroy\n respond_to do |format|\n format.html { redirect_to collections_url, notice: 'The collection was successfully removed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @collection = Collection.find(params[:id])\n @collection.destroy\n\n respond_to do |format|\n format.html { redirect_to(collections_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @collection.destroy\n \n respond_to do |format|\n format.html { redirect_to(collections_mine_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @glo_collection.destroy\n respond_to do |format|\n format.html { redirect_to glo_collections_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @collection.destroy\n respond_to do |format|\n format.html { redirect_to account_collections_url }\n format.json { head :no_content }\n end\n end", "def destroy\n authorize! :destroy, @collection\n\n @collection.destroy\n respond_to do |format|\n format.html { redirect_to admin_collections_url, notice: \"Collection '#{@collection.title}' was successfully deleted.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @collection = @current_user.collections.find(params[:id])\n @collection.destroy\n\n respond_to do |format|\n format.html { redirect_to user_collections_path,\n \t\t notice: 'Collection sucessfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @collection.destroy\n respond_to do |format|\n format.html { redirect_to collections_url, notice: 'Collection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @collection.destroy\n respond_to do |format|\n format.html { redirect_to collections_url, notice: 'Collection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @collection.destroy\n respond_to do |format|\n format.html { redirect_to collections_url, notice: 'Collection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @collection.destroy\n respond_to do |format|\n format.html { redirect_to :delete, flash: { message: 'Collection was successfully deleted.' } }\n format.json { head :no_content }\n end\n end", "def destroy\n @data_collection = DataCollection.find(params[:id])\n @data_collection.destroy\n\n respond_to do |format|\n format.html { redirect_to data_collections_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @item_collection.destroy\n respond_to do |format|\n format.html { redirect_to item_collections_url, notice: 'La collection a été détruite' }\n format.json { head :no_content }\n end\n end", "def destroy\n @users_collection.destroy\n respond_to do |format|\n format.html { redirect_to users_collections_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @sub_collection.destroy\n respond_to do |format|\n format.html { redirect_to sub_collections_url, notice: 'Sub collection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @collection = Collection.find(params[:id])\n \n #destroy all child documents\n @collection.documents.each do |d|\n upload_remove(d) #Removes upload record if file is deleted\n d.destroy\n end\n \n #destroy all child collections\n @collection.collections.each do |c|\n collection_recursive_destroy(c)\n end\n \n @collection.destroy\n\n respond_to do |format|\n format.html { redirect_to collections_url }\n format.json { head :ok }\n end\n end", "def destroy\n @root_collection.destroy\n respond_to do |format|\n format.html { redirect_to root_collections_url, notice: 'Root collection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @collection = Collection.find(params[:id])\n @collection.destroy\n redirect_to collections_path\n\n end", "def destroy\n @user_collection.destroy\n respond_to do |format|\n format.html { redirect_to user_collections_url }\n format.json { head :no_content }\n end\n end", "def destroy\n collection = Collection.find(params.require(:id))\n\n collection.destroy\n\n respond_with collection, location: ''\n end", "def destroy\n\n DataField.destroy_all :data_collection_id => @data_collection.id\n\n if not @data_collection.collection_name.nil?\n mongo_collection = MongoConnection.instance.get_collection @data_collection.collection_name\n mongo_collection.drop\n end\n\n @data_collection.destroy\n\n respond_to do |format|\n format.html { redirect_to data_collections_url }\n format.json { head :no_content }\n end\n end", "def delete\n @collection = Collection.find(params[:id])\n @collection.destroy\n redirect_to action: \"index\"\n end", "def delete\n if ! @collection.delete?(@user, @client)\n render_json :status => :forbidden and return\n end\n @collection.destroy\n render_json :entry => @collection.to_hash(@user, @client)\n end", "def destroy\n @fine_collection.destroy\n respond_to do |format|\n format.html { redirect_to fine_collections_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @collection = @institution.collections.find(params[:id])\n @collection.destroy\n\n respond_to do |format|\n format.html { redirect_to institution_collections_url(@institution) }\n format.json { head :no_content }\n end\n end", "def destroy\n @collection = Collection.find(params[:id])\n\n Product.delete_all(:collection_id => @collection.id)\n\n save_activity(@collection, \"deleted collection\")\n \n @collection.destroy\n\n respond_to do |format|\n format.html { redirect_to(dashboard_path) }\n format.xml { head :ok }\n end\n end", "def destroy\n @shared_collection.destroy\n respond_to do |format|\n format.html { redirect_to shared_collections_url, notice: 'Shared collection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @collection_type = CollectionType.find(params[:id])\n @collection_type.destroy\n\n respond_to do |format|\n format.html { redirect_to collection_types_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @jewelrycollection.destroy\n respond_to do |format|\n format.html { redirect_to jewelrycollections_url, notice: 'Jewelrycollection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n begin\n @collection = baseCollections.find(params[:collection_id]) \n rescue ActiveRecord::RecordNotFound\n redirect_to collections_url, :alert => \"Not exist collection or you are not allowed to see.\"\n return\n end\n @document = @collection.documents.find_by_id(params[:id])\n @document.destroy\n\n respond_to do |format|\n format.html { redirect_to @collection, notice: 'Document was successfully removed.'}\n format.json { head :no_content }\n end\n end", "def deleteCollection _args\n \"deleteCollection _args;\" \n end", "def destroy\n @user = User.find(params[:user_id])\n @collection = Collection.find(params[:id])\n @collection.destroy\n \n\n respond_to do |format|\n format.html { redirect_to @user }\n format.json { head :no_content }\n end\n end", "def destroy\n @image_collection.destroy\n respond_to do |format|\n format.html { redirect_to image_collections_url, notice: 'Image collection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def on_collection_deleted(event)\n return unless resource?(event.payload[:collection])\n Hyrax.index_adapter.delete(resource: event[:collection])\n end", "def destroy\n @collection.destroy\n end", "def destroy\n @resume_collection.destroy\n respond_to do |format|\n format.html { redirect_to resume_collections_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @audio_collection.destroy\n respond_to do |format|\n format.html { redirect_to audio_collections_url, notice: 'Audio collection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @audio_collection.destroy\n respond_to do |format|\n format.html { redirect_to audio_collections_url, notice: 'Audio collection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @category_collection = CategoryCollection.find(params[:id])\n @collection = @category_collection.collection\n @category_collection.destroy\n\n respond_to do |format|\n format.html { redirect_to(@collection) }\n format.xml { head :ok }\n end\n end", "def destroy\n collection = Collection.find(@mlog_entry[:collection_id])\n @mlog_entry.destroy\n respond_to do |format|\n format.html { redirect_to collection}\n format.json { head :no_content }\n end\n end", "def destroy\n @note_collection.destroy\n respond_to do |format|\n format.html { redirect_to note_collections_url, notice: 'Note collection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @collection = Collection.find(params[:id])\n authorize! :destroy, @collection\n\n collectifies = Collectify.where(:collection_id=>@collection)\n collectifies.each do |collectify|\n PublicActivity::Activity.where(\"trackable_type = ? AND trackable_id = ?\", \"Collectify\", collectify.id).destroy_all \n end\n\n PublicActivity::Activity.where(\"trackable_type = ? AND trackable_id = ?\", \"Collection\", @collection.id).destroy_all\n\n @collection.destroy\n\n respond_to do |format|\n format.html { redirect_to user_path(current_user.username) }\n format.json { head :no_content }\n end\n end", "def delete_collection(database_id:, collection_id:)\n path = '/databases/{databaseId}/collections/{collectionId}'\n .gsub('{databaseId}', database_id)\n .gsub('{collectionId}', collection_id)\n\n if database_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"databaseId\"')\n end\n\n if collection_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"collectionId\"')\n end\n\n params = {\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'DELETE',\n path: path,\n headers: headers,\n params: params,\n )\n end", "def destroy\n @rent_collection.destroy\n respond_to do |format|\n format.html { redirect_to dashboard_rent_collections_url, notice: 'Rent collection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @tag_collection = TagCollection.find(params[:id])\n @tag_collection.destroy\n render json: {}\n \n end", "def destroy\n @tweet_collection.destroy\n respond_to do |format|\n format.html { redirect_to tweet_collections_url, notice: 'Tweet collection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @relassigncollection.destroy\n respond_to do |format|\n format.html { redirect_to relassigncollections_url, notice: 'Relassigncollection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @book_collection.destroy\n respond_to do |format|\n format.html { redirect_to book_collections_url, notice: \"Book collection was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def delete_collection(db, coll_name)\n if db.collection('__METADATA__').find_one('_id' => coll_name) == nil\n raise \"collection does not exist\"\n end\n\n db.collection(coll_name).drop\n db.collection_names.keep_if {|c| c.start_with? coll_name+'__'}.each {|related_collection| db.collection(related_collection).drop}\n\n db.collection('__METADATA__').remove('_id' => coll_name)\n end", "def destroy\n @cash_collection.destroy\n respond_to do |format|\n format.html { redirect_to cash_collections_url, notice: 'Cash collection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @collection_post.destroy\n respond_to do |format|\n format.html { redirect_to collection_posts_url, notice: 'Collection post was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @tx_land_grants_special_collection.destroy\n respond_to do |format|\n format.html { redirect_to tx_land_grants_special_collections_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @special_collection_request.destroy\n respond_to do |format|\n format.html { redirect_to special_collection_requests_url, notice: 'Special collection request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n authorize! :destroy, params[:id]\n @collection = Collection.find(params[:id])\n if @collection.nyucores.size == 0\n @collection.destroy\n msg = 'Collection was successfully deleted.'\n else\n msg = 'Collection has associated records and can not be deleted'\n end\n flash[:notice] = msg\n redirect_to collections_url\n end", "def destroy\n @stock_collection.destroy\n respond_to do |format|\n format.html { redirect_to stock_collections_url, notice: 'Stock collection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @collection_attribute = CollectionAttribute.find(params[:id])\n @collection_attribute.destroy\n\n respond_to do |format|\n format.html { redirect_to(collection_attributes_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @collection = @entity_type.collection\n @entity_type.destroy\n respond_to do |format|\n format.html { redirect_to collection_entity_types_path(@collection), notice: 'The entity type was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @men_shop_collection.destroy\n respond_to do |format|\n format.html { redirect_to men_shop_collections_url, notice: 'Men shop collection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @collection_group.destroy\n respond_to do |format|\n format.html { redirect_to collection_groups_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @brmcollection.destroy\n respond_to do |format|\n format.html { redirect_to brmcollections_url, notice: 'Brmcollection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @collect.destroy\n respond_to do |format|\n format.html { redirect_to collects_url, notice: 'Coleta foi removida com sucesso.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @user=User.find_by name: session[:user]\n if CollectionUser.where('id_collection LIKE ?', \"#{@collection.id}\").count == 1\n CollectionNote.where('id_collection LIKE ?', \"#{@collection.id}\" ).destroy_all\n CollectionUser.where('id_collection LIKE ?', \"#{@collection.id}\" ).destroy_all\n\n @collection.destroy\n end\n\n CollectionUser.where('id_collection LIKE ? AND id_user LIKE ?', \"#{@collection.id}\" , \"#{@user.id}\" ).destroy_all\n redirect_to :collections\n #@collection.destroy\n #respond_to do |format|\n # format.html { redirect_to collections_url, notice: 'Collection was successfully destroyed.' }\n # 3format.json { head :no_content }\n #end\n end", "def destroy\n @collection_user.destroy\n respond_to do |format|\n format.html { redirect_to collection_users_url, notice: 'Collection user was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @document = Document.find(params[:id])\n collection = Collection.find(@document.collection_id)\n upload_remove(@document) #Removes upload record if file is deleted\n @document.destroy\n\n respond_to do |format|\n #format.html { redirect_to collections_path }\n format.html { redirect_to collection }\n format.json { head :ok }\n end\n end", "def destroy\n @ticketprice_collection.destroy\n respond_to do |format|\n format.html { redirect_to ticketprice_collections_url, notice: 'Ticketprice collection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def delete(collection)\n return 0 unless collection.query.valid?\n adapter.delete(collection)\n end", "def delete(collection, key)\n @data[collection].delete(key)\n end", "def destroy\n @collection_invoice = CollectionInvoice.find(params[:id])\n @collection_invoice.destroy\n\n respond_to do |format|\n format.html { redirect_to collection_invoices_url }\n format.json { head :no_content }\n end\n end", "def delete_child_collection(name)\r\n #Delete collection = delete all documents in it and than delete field in envId:collections key\r\n coll_id = nil\r\n begin\r\n coll_id = get_child_collection_id(name)\r\n rescue Transformer::MappingException => ex\r\n ex.message\r\n return\r\n end\r\n collection = RedXmlApi::Collection.new(@env_id, coll_id)\r\n collection.delete_all_documents\r\n collection.delete_all_child_collections\r\n @db_interface.delete_from_hash @certain_coll_key, [name]\r\n #We have to delete all keys of collection, e.g. <info, <documents, <collections\r\n del_keys = [Transformer::KeyBuilder.collection_info(@env_id, coll_id), Transformer::KeyBuilder.documents_key(@env_id, coll_id), Transformer::KeyBuilder.child_collections_key(@env_id, coll_id)]\r\n @db_interface.delete_keys del_keys\r\n end", "def destroy\n @couch.destroy\n respond_to do |format|\n format.html { redirect_to couches_url, notice: 'Couch was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete(collection)\n @log.debug(\"Delete called with: #{collection.inspect}\")\n deleted = 0\n model = collection.first.model\n class_name = class_name(model)\n all_url = build_all_url(class_name)\n page = @agent.get(all_url) \n @log.debug(\"Page was #{page.inspect}\")\n records = parse_collection(page, model)\n \n collection.each do |resource|\n begin\n id = model.serial.get(resource)\n delete_link = build_delete_link(class_name, id)\n @log.debug(\"Delete link is #{delete_link}\")\n #actual_delete_link = page.link_with(:href => delete_link, :text => 'Destroy')\n # No can do Javascript prompts, so...\n response = @agent.delete(delete_link)\n @log.debug(\"Result of actual delete call is #{response.code}\")\n if response.code.to_i == 302\n deleted += 1\n else\n @log.error(\"Failure while deleting #{response.inspect}\")\n end\n rescue => e\n @log.error(\"Failure while deleting #{e.inspect}\")\n end\n end\n\n deleted\n end", "def delete\n if params[:id]\n result = backend_instance.compute_delete(params[:id])\n else\n result = backend_instance.compute_delete_all\n end\n\n if result\n respond_with(Occi::Collection.new)\n else\n respond_with(Occi::Collection.new, status: 304)\n end\n end", "def destroy\n @category = @collection.category.find(params[:id])\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @collection = current_user.collections.find(params[:collection_id])\n @entity_type = @collection.entity_types.find(params[:id])\n @entity_type.destroy\n logger.debug(@entity_type.errors.inspect)\n respond_to do |format|\n if @entity_type.errors.size == 0\n format.html { redirect_to collection_entity_types_path(@collection)}\n format.json { head :no_content }\n else\n format.html { redirect_to collection_entity_types_path(@collection), alert: \"Cannot be destroyed: #{@entity_type.errors[:base].to_s}\"}\n format.json { head :no_content }\n end\n end\n end", "def destroy\n @pending_titles_for_collection = PendingTitlesForCollection.find(params[:id])\n @pending_titles_for_collection.destroy\n\n respond_to do |format|\n format.html { redirect_to(pending_titles_for_collections_url) }\n format.xml { head :ok }\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\n @collection = @document.collection\n @document.destroy\n @collection.update_annotation_count\n respond_to do |format|\n format.html { redirect_back fallback_location: collection_documents_path(@collection), notice: 'The document was successfully removed.' }\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 delete\n# if stat.directory?\n# FileUtils.rm_rf(file_path)\n# else\n# File.unlink(file_path)\n# end\n if collection?\n @collection.find({:filename => /^#{Regexp.escape(@bson['filename'])}/}).each do |bson|\n @collection.remove(bson)\n end\n else\n @collection.remove(@bson)\n end\n NoContent\n end", "def destroy\n @plastic_collection_event.destroy\n respond_to do |format|\n format.html { redirect_to plastic_collection_events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @collection_point = CollectionPoint.find(params[:id])\n @collection_point.destroy\n\n respond_to do |format|\n format.html { redirect_to collection_points_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 delete_item\n item_id = params[\"item_id\"]\n\n item = TextItem.find_by_id(item_id)\n item = Image.find_by_id(item_id) if item.nil?\n item = Collection.find_by_id(item_id) if item.nil?\n render_json :status => :not_found, :messages => \"Could not find the item with id #{item_id}.\" and return if item.nil?\n\n if item.class == Collection\n if params[\"id\"].nil?\n render_json :status => :bad_request, :messages => \"Can't delete a collection reference without providing the parent collection id. Please use the longer url for item deletion.\" and return\n end\n collection = Collection.find_by_id(params[\"id\"])\n else\n collection = Ownership.find_by_item_id(item_id).parent\n end\n;\n render_json :status => :not_found, :messages => \"Could not find parent collection for the item.\" and return if (collection.nil?)\n render_json :status => :forbidden, :messages => \"The user is not allowed to delete from this collection.\" and return if (!collection.delete?(@user, @client))\n\n collection.delete_item(item_id)\n render_json :entry => {} and return\n end", "def destroy\n @couch.destroy\n respond_to do |format|\n format.html { redirect_to couches_url, notice: 'Couche was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n Rails.logger.debug {\"destroying #{self}\"}\n\n self.class.collection\n .find(_id:@id)\n .delete_one\n end", "def destroy\n Rails.logger.debug {\"destroying #{self}\"}\n\n self.class.collection\n .find(_id:@id)\n .delete_one \n end", "def destroy\n @collab = Collab.find(params[:id])\n @collab.destroy\n\n respond_to do |format|\n format.html { redirect_to collabs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @collector.destroy\n respond_to do |format|\n format.html { redirect_to collectors_url }\n format.json { head :no_content }\n end\n end", "def delete endpoint\n do_request :delete, endpoint\n end", "def destroy\n @verb.destroy\n\n head :no_content\n end", "def destroy\n @api_version = ApiVersion.find(params[:id])\n @api_version.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_api_versions_url, flash: {success: t('app.msgs.success_deleted', :obj => t('mongoid.models.api_version.one'))} }\n format.json { head :no_content }\n end\n end", "def destroy\n @verb.destroy\n respond_to do |format|\n format.html { redirect_to verbs_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.7955601", "0.76791966", "0.7664679", "0.7664679", "0.7664679", "0.7664679", "0.75711703", "0.7557922", "0.7541033", "0.7540196", "0.7532294", "0.74901825", "0.74650514", "0.7449756", "0.7449204", "0.7449204", "0.7449204", "0.74310577", "0.7296184", "0.7282262", "0.7269583", "0.7265296", "0.7258112", "0.72529256", "0.7202734", "0.71976453", "0.7169675", "0.71611553", "0.713204", "0.71091384", "0.7104405", "0.71030974", "0.7100023", "0.7078943", "0.70700824", "0.70692307", "0.6998071", "0.6958099", "0.6954257", "0.6940994", "0.69136816", "0.69008714", "0.68836147", "0.68402225", "0.68402225", "0.68282646", "0.68181556", "0.6786631", "0.6780913", "0.6766842", "0.67654043", "0.6744334", "0.67365074", "0.67232555", "0.67056626", "0.6699034", "0.66978735", "0.66929555", "0.664563", "0.6595121", "0.65947354", "0.6577243", "0.653757", "0.65341336", "0.65258366", "0.6523667", "0.6522791", "0.64913815", "0.6488801", "0.648228", "0.6481621", "0.64802396", "0.6467286", "0.64262384", "0.64255553", "0.6416192", "0.63996446", "0.6395761", "0.6370795", "0.63628995", "0.63393724", "0.6323755", "0.63171685", "0.62928665", "0.6290537", "0.6266066", "0.6259623", "0.6255683", "0.6255495", "0.62529236", "0.62471837", "0.62359154", "0.62231845", "0.6218907", "0.62139344", "0.6209756", "0.6206538", "0.62026715", "0.62013257", "0.6192474" ]
0.66093147
59
GET /rants/1 GET /rants/1.xml
def show @rant = Rant.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @rant } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rest_get(uri)\n \n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n return doc\n \n end\n \nend", "def read(id=nil)\r\n request = Net::HTTP.new(@uri.host, @uri.port)\r\n if id.nil?\r\n response = request.get(\"#{@uri.path}.xml\") \r\n else\r\n response = request.get(\"#{@uri.path}/#{id}.xml\") \r\n end\r\n response.body\r\n end", "def show\n @rute = Rute.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @rute }\n end\n end", "def get_xml\n response = @api.request(:get, @location, type: 'xml')\n response.body if response.status == 200\n end", "def xml(id)\n http.get(\"/nfse/#{id}/xml\") do |response|\n response.headers.fetch(\"Location\") { \"\" }\n end\n end", "def show\n @realtor = Realtor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @realtor }\n end\n end", "def index\n @realtors = Realtor.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @realtors }\n end\n end", "def read(id=nil)\n request = Net::HTTP.new(@uri.host, @uri.port)\n if id.nil?\n response = request.get(\"#{@uri.path}.xml\")\n else\n response = request.get(\"#{@uri.path}/#{id}.xml\")\n end\n\n response.body\n end", "def show\n @rede = Rede.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @rede }\n end\n end", "def show\n @revendedor = Revendedor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @revendedor }\n end\n end", "def index\n @meant_it_rels = MeantItRel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @meant_it_rels }\n end\n end", "def show\n @uri_type = UriType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @uri_type }\n end\n end", "def show\n @relatorios = Relatorio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @relatorios }\n end\n end", "def index\n @borrower_residences = BorrowerResidence.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @borrower_residences.to_xml }\n end\n end", "def show\n @rip = Rip.find params[:id]\n respond_to do |format|\n format.html\n format.xml { render :xml => @rip.to_xml }\n end\n end", "def show\n @roaster = Roaster.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @roaster }\n end\n end", "def show\r\n @razdel1 = Razdel1.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.xml { render :xml => @razdel1 }\r\n end\r\n end", "def show\n @lore = Lore.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lore }\n end\n end", "def index\n @revenus = @foyer.revenus\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @revenus }\n end\n end", "def index\n @node = Fedora.rest('rest/')\n end", "def api_xml(path,method=:get,options={})\n xml_message(amee,\"/data\"+path,method,options)\n end", "def show\n @rtype = Rtype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @rtype }\n end\n end", "def show\n @rig = Rig.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @rig }\n end\n end", "def new\n @rant = Rant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rant }\n end\n end", "def show\n @rdv = Rdv.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @rdv }\n end\n end", "def show\n \n@clicker = Clicker.find(params[:id])\n\n \nrespond_to do |format|\n \nformat.html # show.html.erb\n \nformat.xml { render :xml => @clicker+\"yyyyy\" }\n \n end\n \nend", "def index\n @restaurants = Restaurant.all_by_name\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @restaurants }\n end\n end", "def show\n @meant_it_rel = MeantItRel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @meant_it_rel }\n end\n end", "def index\n @restaurants = Restaurant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @restaurants }\n end\n end", "def show\n @respuestum = Respuestum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @respuestum }\n end\n end", "def show\n @revenu = @foyer.revenus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @revenu }\n end\n end", "def show\n @rendezvouz = Rendezvouz.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @rendezvouz }\n end\n end", "def show\n @recommand = Recommand.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @recommand }\n end\n end", "def show\n @borrower_residence = BorrowerResidence.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @borrower_residence.to_xml }\n end\n end", "def show\n @analisis = Analisis.find(params[:id])\n\n respond_to do |format|\n format.xml { render :xml => @analisis }\n end\n end", "def show\n @direccion = Direccion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @direccion }\n end\n end", "def show\n @reviewer = Reviewer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @reviewer }\n end\n end", "def show\n @tipo_restaurante = TipoRestaurante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tipo_restaurante }\n end\n end", "def show\n @rink = Rink.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @rink }\n end\n end", "def show\n @Roc = Roc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @Roc }\n end\n end", "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @remuneration_type }\n end\n end", "def show\n @regroupement = Regroupement.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @regroupement.to_xml }\n end\n end", "def show\n @relatestagiario = Relatestagiario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @relatestagiario }\n end\n end", "def show\n @clicker = Clicker.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @clicker }\n end\n end", "def show\n @klant = Klant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @klant }\n end\n end", "def show\n @receita = Receita.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @receita }\n end\n end", "def show\n @receita = Receita.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @receita }\n end\n end", "def index\n @annees = Annee.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @annees }\n end\n end", "def show\n @refferalmaster = Refferalmaster.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @refferalmaster }\n end\n end", "def show\n @rulereminderlink = Rulereminderlink.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @rulereminderlink }\n end\n end", "def show\n @wrestler = Wrestler.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @wrestler }\n end\n end", "def index\n @tenants = Tenant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tenants }\n end\n end", "def route_xml(route_id, query_params = nil)\n get(\"/routes/#{route_id}/xml\", query_params)\n end", "def show\n @node = Node.scopied.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @node }\n end\n end", "def show\n @reclamo = Reclamo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @reclamo }\n end\n end", "def show\n @estudiante = Estudiante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @estudiante }\n end\n end", "def show\n @estudiante = Estudiante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @estudiante }\n end\n end", "def retrieve \n if !check_auth()\n render text: { \"message\" => \"401 Unauthorized\" }.to_json(), status: :unauthorized\n else\n uri = params[:uri]\n type = params[:type]\n doc = Document.find_by_uri(uri)\n if doc.present?\n case type\n when 'gale'\n render :text => doc.get_corrected_gale_xml()\n when 'text'\n render :text => doc.get_corrected_text()\n when 'tei-a'\n render :text => doc.get_corrected_tei_a(false)\n when 'tei-a-words'\n render :text => doc.get_corrected_tei_a(true)\n when 'original-gale'\n render :text => doc.get_original_gale_xml()\n when 'original-text'\n render :text => doc.get_original_gale_text()\n end\n else\n render text: { \"message\" => \"Document #{uri} not found\" }.to_json(), status: :not_found\n end\n end\n end", "def index\n debugger\n @receitas = Receita.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @receitas }\n end\n end", "def test_articlerss\n get :articlerss, :id => 1 \n assert_response :success\n assert_nothing_raised do\n assert REXML::Document.new(@response.body)\n end\n end", "def show\n @cantor = Cantor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cantor }\n end\n end", "def show\n @allergen = Allergen.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @allergen }\n end\n end", "def show\n @restaurant = Restaurant.find(params[:id])\n\n @resenya = Resenya.new\n @critics = Critic.find(:all, :order=>'nom')\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @restaurant }\n end\n end", "def show\n @hydrant = Hydrant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :partial => 'show_xml' }\n end\n end", "def show\n @restaurant_page = RestaurantPage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @restaurant_page }\n end\n end", "def index\n @wants = Want.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @wants }\n end\n end", "def show\n @recycling_site = RecyclingSite.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @recycling_site }\n end\n end", "def show\n @solicitation = Solicitation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @solicitation }\n end\n end", "def show\n @agent = Agent.find(params[:id], query)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @agent }\n end\n end", "def index\n @tournaments = @resource_finder.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tournaments }\n end\n end", "def show\n @want = Want.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @want }\n end\n end", "def show\n\t\t #@[email protected]\n\t\t if !request.accept || request.accept == \"*/*\"\n\t\t\t\trender plain: \"/api/racers/#{params[:id]}\"\n\t\t\telse\n\t\t\t\t#real implementation ...\n\t\t\tend\n\t\tend", "def show\n @lyric = Lyric.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lyric }\n end\n end", "def show\n @lyric = Lyric.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lyric }\n end\n end", "def index\n @tipo_restaurantes = TipoRestaurante.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tipo_restaurantes }\n end\n end", "def show\n @researcher = Researcher.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @researcher }\n end\n end", "def show\n @renewal = Renewal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @renewal }\n end\n end", "def show\n @response = Response.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @response }\n end\n end", "def show\n @tur = Tur.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tur }\n end\n end", "def show\n @lek = Lek.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lek }\n end\n end", "def index\n @relationships = Relationship.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @relationships }\n end\n end", "def show\n @daily_grr = DailyGrr.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @daily_grr }\n end\n end", "def show\n @lr45 = Lr45.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lr45 }\n end\n end", "def show\n @retirada = Retirada.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @retirada }\n end\n end", "def index\n @referrals = Referral.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @referrals }\n end\n end", "def show\n @allergy = Allergy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @allergy }\n end\n end", "def show\n @needle = Needle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @needle }\n end\n end", "def index\n @requests = Request.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @requests }\n end\n end", "def show\n @detailed_retrofit = DetailedRetrofit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @detailed_retrofit }\n end\n end", "def show\n @referral = Referral.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @referral }\n end\n end", "def show\n @referral = Referral.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @referral }\n end\n end", "def show\n @brothers = Brother.all\n @brother = Brother.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @brother }\n end\n end", "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tenders }\n end\n end", "def show\n @visarequest = Visarequest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @visarequest }\n end\n end", "def show\n @variate = Variate.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @variate.to_xml }\n end\n end", "def show\n @norma = Norma.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @norma }\n end\n end", "def show\n @r2d2 = R2d2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @r2d2 }\n end\n end", "def show\n @remocao = Remocao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @remocao }\n end\n end", "def show\n @crna = Crna.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @crna }\n end\n end", "def show\n @loan = Loan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @loan }\n end\n end" ]
[ "0.6563115", "0.6412381", "0.6379286", "0.63558936", "0.6348562", "0.631062", "0.6255079", "0.6253695", "0.6190788", "0.6178475", "0.6168402", "0.61354077", "0.61206174", "0.6091785", "0.6091137", "0.6074826", "0.6072125", "0.6066851", "0.60651684", "0.60115874", "0.6005408", "0.5979475", "0.5973548", "0.5969873", "0.5967504", "0.59566975", "0.5945732", "0.59345776", "0.5933746", "0.5925605", "0.59232223", "0.59180504", "0.5908995", "0.5892817", "0.58824635", "0.58804053", "0.5873551", "0.58638513", "0.5862817", "0.58493596", "0.58441854", "0.584039", "0.5836922", "0.5835546", "0.58306414", "0.58299065", "0.58299065", "0.582259", "0.58156025", "0.58026576", "0.5795227", "0.57906127", "0.5788087", "0.57797384", "0.57755053", "0.574905", "0.5747996", "0.5746081", "0.5744008", "0.5739087", "0.5738672", "0.57386404", "0.57354444", "0.5734914", "0.5733017", "0.57326716", "0.57325864", "0.57324994", "0.5729846", "0.5729391", "0.57275635", "0.57235456", "0.5720967", "0.5720967", "0.57131255", "0.57096523", "0.57090205", "0.57071984", "0.57056415", "0.5703242", "0.57019824", "0.5694864", "0.5694406", "0.5693679", "0.5690916", "0.56855696", "0.56829965", "0.5680841", "0.5678962", "0.56728107", "0.56728107", "0.56693345", "0.5667656", "0.5667199", "0.5665612", "0.56656116", "0.56591016", "0.56586075", "0.56575745", "0.56546557" ]
0.6738103
0
GET /rants/new GET /rants/new.xml
def new @rant = Rant.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @rant } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @node = Node.scopied.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end", "def new\n @uri_type = UriType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @uri_type }\n end\n end", "def new\n @realtor = Realtor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @realtor }\n end\n end", "def new\n @lore = Lore.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lore }\n end\n end", "def new\n @rtype = Rtype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rtype }\n end\n end", "def new\n @novel = Novel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @novel }\n end\n end", "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "def new\n @patron = Patron.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @patron }\n end\n end", "def new\n @want = Want.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @want }\n end\n end", "def new\n @revendedor = Revendedor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @revendedor }\n end\n end", "def new\n @recurso = Recurso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @recurso }\n end\n end", "def new\n @rute = Rute.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rute }\n end\n end", "def new\n @omatsuri = Omatsuri.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @omatsuri }\n end\n end", "def new\n @rink = Rink.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rink }\n end\n end", "def new\n @relatorios = Relatorio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @relatorios }\n end\n end", "def new\n respond_to do |format|\n format.html { render :layout => 'application' }\n format.xml { render :xml => @recommand }\n end\n end", "def new\n @plantilla = Plantilla.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @plantilla }\n end\n end", "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end", "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end", "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end", "def new\n @request = Request.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end", "def new\n @brother = Brother.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @brother }\n end\n end", "def new\n @rede = Rede.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rede }\n end\n end", "def new\n @roaster = Roaster.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @roaster }\n end\n end", "def new\n @loan = Loan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @loan }\n end\n end", "def new\n @receita = Receita.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @receita }\n end\n end", "def new\n @cantor = Cantor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cantor }\n end\n end", "def new\n @lien = Lien.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lien }\n end\n end", "def new\n @test_plant = TestPlant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @test_plant }\n end\n end", "def new_rest\n @instrument_version = InstrumentVersion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instrument_version }\n end\n end", "def new\n @relationship = Relationship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @relationship }\n end\n end", "def new\n @hydrant = Hydrant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @hydrant }\n end\n end", "def new\n @restaurant = Restaurant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @restaurant }\n end\n end", "def new\n @restaurant = Restaurant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @restaurant }\n end\n end", "def new\n @partytype = Partytype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @partytype }\n end\n end", "def new\n @meant_it_rel = MeantItRel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meant_it_rel }\n end\n end", "def new\n @renewal = Renewal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @renewal }\n end\n end", "def new\n @simperson = Simperson.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @simperson }\n end\n end", "def new_rest\n @entry_instrument = EntryInstrument.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry_instrument }\n end\n end", "def new\n @patrimonio = Patrimonio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @patrimonio }\n end\n end", "def new\n @needle = Needle.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @needle }\n end\n end", "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nomina }\n end\n end", "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end", "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end", "def new\n respond_to do |format|\n format.html\n format.xml\n end\n end", "def new\n @town = Town.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @town }\n end\n end", "def new\n @resource = Resource.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @newz = Newz.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @newz }\n end\n end", "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml \n end\n end", "def new\n @norma = Norma.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @norma }\n end\n end", "def new\n @pneighbour = Pneighbour.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pneighbour }\n end\n end", "def new\n @people = People.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @people }\n end\n end", "def new\n @nostro = Nostro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nostro }\n end\n end", "def new\n @thing = Thing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @thing }\n end\n end", "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tender }\n end\n end", "def new\n @monkey = Monkey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @monkey }\n end\n end", "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @location }\n end\n end", "def new\n @Roc = Roc.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @Roc }\n end\n end", "def new\n @lease = Lease.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lease }\n end\n end", "def new\n @ref = Ref.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ref }\n end\n end", "def new\n @atom = Atom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @atom }\n end\n end", "def new\n @partyrelationship = Partyrelationship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @partyrelationship }\n end\n end", "def new\n @partyrole = Partyrole.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @partyrole }\n end\n end", "def new\n @bottle = Bottle.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bottle }\n\t\t\tformat.json { render :json => @bottle }\n end\n end", "def new\n @annee = Annee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @annee }\n end\n end", "def new\n @origin = Origin.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @origin }\n end\n end", "def new\n @resp = Response.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resp }\n end\n end", "def new\n @borrow = Borrow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @borrow }\n end\n end", "def new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @coating }\n end\n end", "def new\n @trial = Trial.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @trial }\n end\n end", "def new\n @retain_node = RetainNode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @retain_node }\n format.json { render :json => @retain_node }\n end\n end", "def new\n @entry = @resource_finder.new\n initialize_new_resource\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry }\n end\n end", "def new\n @party_type = PartyType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @party_type }\n end\n end", "def new\n @solicitud = Solicitud.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @solicitud }\n end\n end", "def new_rest\n @entry_item = EntryItem.new\n\n respond_to do |format|\n #format.html # new.html.erb\n format.xml { render :xml => @entry_item }\n end\n end", "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ontology }\n end\n end", "def new\n @recipe = Recipe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @recipe }\n end\n end", "def new\n @lancamento = Lancamento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lancamento }\n end\n end", "def new\n @discovery = Discovery.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @discovery }\n end\n end", "def new\n @venture = Venture.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @venture }\n end\n end", "def new\n @route = Route.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @route }\n end\n end", "def new\n @route = Route.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @route }\n end\n end", "def new\n @relatestagiario = Relatestagiario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @relatestagiario }\n end\n end", "def new\n @dossier = Dossier.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @dossier }\n end\n end", "def new\n @direccion = Direccion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @direccion }\n end\n end", "def new\n @restaurant_page = RestaurantPage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @restaurant_page }\n end\n end", "def new\n head :status => 405\n return\n \n @participant = Participant.new\n\n respond_to do |format|\n format.html # new.html.erb\n #format.xml { render :xml => @participant }\n end\n end", "def new\n @screw = Screw.new\n\n respond_to do |wants|\n wants.html # new.html.erb\n wants.xml { render :xml => @screw }\n end\n end" ]
[ "0.7358266", "0.7260429", "0.725598", "0.7205338", "0.71587896", "0.71106416", "0.710072", "0.7089057", "0.7089057", "0.7077673", "0.7076395", "0.70757353", "0.7064889", "0.70575297", "0.70433474", "0.70415646", "0.70298064", "0.7022948", "0.7012879", "0.70019037", "0.70019037", "0.70019037", "0.6998738", "0.6990551", "0.6985377", "0.695261", "0.69363266", "0.6929843", "0.6918923", "0.69167614", "0.69164264", "0.6896769", "0.68936217", "0.68904656", "0.6885855", "0.6885855", "0.6876256", "0.68729687", "0.6868785", "0.68680775", "0.68678015", "0.6862514", "0.6861469", "0.6854859", "0.68543786", "0.68543786", "0.68543404", "0.68497515", "0.6848681", "0.68459576", "0.68459576", "0.68459576", "0.68459576", "0.68459576", "0.68459576", "0.68459576", "0.68459576", "0.68459576", "0.68459576", "0.68427163", "0.6840109", "0.6833368", "0.6830141", "0.68260324", "0.68257016", "0.68242896", "0.68186295", "0.68176407", "0.68147516", "0.6811949", "0.680385", "0.6803322", "0.68030864", "0.6800796", "0.6793628", "0.67919093", "0.67901474", "0.6789379", "0.6788814", "0.6784524", "0.67827064", "0.6780577", "0.677802", "0.6777509", "0.6776117", "0.67751646", "0.67713547", "0.67664635", "0.67606145", "0.67602533", "0.67576617", "0.67564696", "0.67557365", "0.67557365", "0.67547107", "0.6753506", "0.6752608", "0.6752116", "0.6752072", "0.67514783" ]
0.7633198
0
POST /rants POST /rants.xml
def create @rant = Rant.new(params[:rant]) respond_to do |format| if @rant.save format.html { redirect_to(@rant, :notice => 'Rant was successfully created.') } format.xml { render :xml => @rant, :status => :created, :location => @rant } else format.html { render :action => "new" } format.xml { render :xml => @rant.errors, :status => :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post(uri, xml)\r\n req = Net::HTTP::Post.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end", "def post(xmldoc)\n headers = {'Content-Type' => 'text/xml'}\n check_response( @httpcli.post(@endpoint, xmldoc, headers) )\n end", "def create(name=\"Default Name\", age=\"50\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <name>#{name}</name>\r\n <age>#{age}</age>\r\n </person>\"\r\n \r\n request = Net::HTTP::Post.new(@url)\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n response.body \r\n end", "def post\n Rentlinx.client.post(self)\n end", "def post_query( xml )\n url = URI.parse( self.url )\n response = self.http.post_form( url, { \"query\" => xml } )\n return response.body\n end", "def post\n resource.post(request, response)\n end", "def post_xml_64(xml=:example_response)\n post \"/auth/saml/callback\", {'SAMLResponse' => load_xml_64(xml)}\nend", "def send_request( xml )\n write( xml )\n read\n end", "def add_tenant_circle(args = {}) \n post(\"/tenantcircles.json/\", args)\nend", "def test_post_invoices_xml \n Redmine::ApiTest::Base.should_allow_api_authentication(:post,\n '/invoices.xml',\n {:invoice => {:project_id => 1, :number => 'INV/TEST-1'}},\n {:success_code => :created})\n \n assert_difference('Invoice.count') do\n post '/invoices.xml', {:invoice => {:project_id => 1, :number => 'INV/TEST-1', :contact_id => 1, :status_id => 1, :invoice_date => Date.today}}, credentials('admin')\n end\n\n invoice = Invoice.first(:order => 'id DESC')\n assert_equal 'INV/TEST-1', invoice.number\n \n assert_response :created\n assert_equal 'application/xml', @response.content_type\n assert_tag 'invoice', :child => {:tag => 'id', :content => invoice.id.to_s}\n end", "def post_save xml, options={:mapping=>:_default}\n xml.root.add_attributes(\"xmlns\"=>\"http://schema.intuit.com/platform/fdatafeed/rewardsaccount/v1\")\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 post_xml(url, ls_data)\n uri = URI.parse(url)\n request = Net::HTTP::Post.new(uri.request_uri, HEADER_XML)\n request.body = ls_data\n request.basic_auth(@nsx_user, @nsx_password)\n response = Net::HTTP.start(uri.host, uri.port, :use_ssl => true,\n :verify_mode => OpenSSL::SSL::VERIFY_NONE) do |https|\n https.request(request)\n end\n return response.body if check_response(response, 201)\n end", "def create(name=\"Default name\")\n xml_req =\n \"<?xml version='1.0' encoding='UTF-8'?>\n <customer>\n <name>#{name}</name>\n </customer>\"\n\n request = Net::HTTP::Post.new(@url)\n request.add_field \"Content-Type\", \"application/xml\"\n request.body = xml_req\n\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n response.body\n end", "def post(body)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true if uri.scheme == 'https'\n\n request = Net::HTTP::Post.new(uri)\n request['Content-Type'] = 'text/xml'\n request['Accept-Language'] = locale if locale\n request.body = body\n\n response = http.request(request)\n\n Response.new(response, uri)\n end", "def post_save xml, options={:mapping=>:_default}\n # using REXML's element namespace method doesn't seem to set the namespace correctly...?\n xml.root.add_attributes(\"xmlns\"=>\"http://schema.intuit.com/platform/fdatafeed/institutionlogin/v1\")\n xml.root.add_namespace \"xsi\", \"http://www.w3.org/2001/XMLSchema-instance\"\n xml.root.add_namespace \"xsd\", \"http://www.w3.org/2001/XMLSchema\"\n # for challengeResponses/response\n xml.each_element(\"//response\") do |x|\n x.add_namespace \"v11\", \"http://schema.intuit.com/platform/fdatafeed/challenge/v1\"\n x.name = \"v11:response\"\n end\n # for challengeResponses root\n xml.each_element(\"//challengeResponses\") do |x|\n x.add_namespace \"v1\", \"http://schema.intuit.com/platform/fdatafeed/institutionlogin/v1\"\n x.name = \"challengeResponses\"\n end\n end", "def send_xml_to_server(server, xml)\n http = Net::HTTP.new(server.host, 8443)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n headers = {\n 'HTTP_AUTH_LOGIN' => server.username,\n 'HTTP_AUTH_PASSWD' => server.password,\n 'Content-Type' => 'text/xml',\n }\n\n path = \"/enterprise/control/agent.php\"\n res, data = http.post2(path, xml, headers)\n return res.body\n end", "def create\n doc = Nokogiri::XML(request.body.read)\n cvNode = doc.xpath('elwak/checklisten_vorlage')\n cv = ChecklistenVorlage.new({\n objekt_id: cvNode.xpath('objekt_id').text.to_s, \n bezeichner: cvNode.xpath('bezeichner').text.to_s, \n version: cvNode.xpath('version').text.to_s.to_i, \n inaktiv: cvNode.xpath('inaktiv').text.to_s.to_bool \n })\n cv.save\n\n cvNode.xpath('checklisten_eintrags/checklisten_eintrag').each do |ceNode|\n ce = ChecklistenEintrag.new({\n checklisten_vorlage_id: cv.id,\n bezeichner: ceNode.xpath('bezeichner').text.to_s,\n was: ceNode.xpath('was').text.to_s,\n wann: ceNode.xpath('wann').text.to_s,\n typ: ceNode.xpath('typ').text.to_s.to_i,\n position: ceNode.xpath('position').text.to_s.to_i\n })\n ce.save\n end\n\n respond_to do |format|\n format.xml {render :xml => '<?xml version=\"1.0\" encoding=\"UTF-8\"?><success />'}\n end\n end", "def post_config(url_prefix, xml)\n post_data(url_prefix, xml, 'application/xml;charset=UTF-8')\n end", "def send_post(data_xml,url)\r\n result = @client.post(self.target_uri(url), :body => data_xml , :head => {'Content-Type' => 'application/xml'} ) \r\n raise \"Invalid status #{result.http_status} from server #{@host}:#{@port}\" if(result.http_status != '200') \r\n #reply = Reply.from_xml(result.http_body)\r\n if block_given?\r\n yield(result.http_body)\r\n else\r\n result.http_body\r\n end\r\n end", "def post(path, **args); end", "def post_save xml, options={:mapping=>:_default}\n # using REXML's element namespace method doesn't seem to set the namespace correctly...?\n xml.root.add_attributes(\"xmlns\"=>\"http://schema.intuit.com/platform/fdatafeed/institutionlogin/v1\")\n xml.root.add_namespace \"xsi\", \"http://www.w3.org/2001/XMLSchema-instance\"\n xml.root.add_namespace \"xsd\", \"http://www.w3.org/2001/XMLSchema\"\n # for challengeResponses/response\n xml.each_element(\"//response\") do |x| \n x.add_namespace \"v11\", \"http://schema.intuit.com/platform/fdatafeed/challenge/v1\"\n x.name = \"v11:response\"\n end\n # for challengeResponses root\n xml.each_element(\"//challengeResponses\") do |x| \n x.add_namespace \"v1\", \"http://schema.intuit.com/platform/fdatafeed/institutionlogin/v1\"\n x.name = \"challengeResponses\"\n end\n end", "def post\n response = HTTParty.post(servlet_url,\n :body => to_xml,\n :headers => { 'Content-Type' => 'application/xml' }\n ).response\n\n return Dhl::Shipment::Response.new(response.body)\n rescue Exception => e\n request_xml = if @to_xml.to_s.size>0\n @to_xml\n else\n '<not generated at time of error>'\n end\n\n response_body = if (response && response.body && response.body.to_s.size > 0)\n response.body\n else\n '<not received at time of error>'\n end\n\n log_level = if e.respond_to?(:log_level)\n e.log_level\n else\n :critical\n end\n\n log_request_and_response_xml(log_level, e, request_xml, response_body )\n raise e\n end", "def post(*args)\n request :post, *args\n end", "def post(path, params={})\n signature_params = params.values.any?{|value| value.respond_to?(:to_io)} ? {} : params\n request(:post, path, params.to_xml, signature_params)\n end", "def post_save xml, options={:mapping=>:_default}\n xml.root.add_attributes(\"xmlns\"=>\"http://schema.intuit.com/platform/fdatafeed/loan/v1\")\n end", "def request_body(xml); xml; end", "def POST; end", "def post(*args)\n request(:post, *args)\n end", "def do_submission(path, xml = nil)\n if xml.nil?\n form = create(:form, question_types: %w(integer integer))\n form.publish!\n xml = build_odk_submission(form)\n end\n\n # write xml to file\n require 'fileutils'\n FileUtils.mkpath('test/fixtures')\n fixture_file = Rails.root.join('test/fixtures/', ODK_XML_FILE)\n File.open(fixture_file.to_s, 'w') { |f| f.write(xml) }\n\n # Upload and do request.\n uploaded = fixture_file_upload(fixture_file, 'text/xml')\n post(path, {:xml_submission_file => uploaded, :format => 'xml'}, 'HTTP_AUTHORIZATION' => encode_credentials(@user.login, 'password'))\n assigns(:response)\n end", "def rsvp_post(options = {})\n\n #add access token if it exists\n url = \"\"\n if options[:access_token]\n #url = \"https://api.meetup.com/2/rsvp?access_token=#{options[:access_token]}\"\n url = \"https://api.meetup.com/2/rsvp.json\"\n\n else\n url = \"https://api.meetup.com/2/rsvp\"\n end\n\n puts \"url posting is #{url}\"\n\n response = post_response(url,options)\n\n if response == \"OK\"\n puts \"rsvp ok\"\n else\n puts response.to_yaml\n end\n end", "def post\n RestClient.post(url, @body, @header) do |rso, req, res|\n setup(rso, req, res)\n end\n end", "def method_missing(method, *args, &block)\n data = { method: method, parameters: args }\n request.post(path: nodes_path, data: data, auth_token: auth_token)\n end", "def tenants_post(opts = {})\n data, _status_code, _headers = tenants_post_with_http_info(opts)\n return data\n end", "def commit(xml)\n url = (test? ? test_url : live_url)\n\n response = parse(ssl_post(url, post_data(xml), 'Content-Type' => 'application/x-www-form-urlencoded;charset=UTF-8'))\n\n Response.new(\n success_from(response),\n message_from(response),\n response,\n authorization: authorization_from(response),\n test: test?,\n error_code: error_code_from(response)\n )\n end", "def post_request(path, params={}, options={})\n request(:post, path, params, options)\n end", "def create\n megam_rest.post_node(to_hash)\n end", "def create\n @revendedor = Revendedor.new(params[:revendedor])\n\n respond_to do |format|\n if @revendedor.save\n flash[:notice] = 'Revendedor was successfully created.'\n format.html { redirect_to(@revendedor) }\n format.xml { render :xml => @revendedor, :status => :created, :location => @revendedor }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @revendedor.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @rede = Rede.new(params[:rede])\n\n respond_to do |format|\n if @rede.save\n format.html { redirect_to(@rede, :notice => 'Rede was successfully created.') }\n format.xml { render :xml => @rede, :status => :created, :location => @rede }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @rede.errors, :status => :unprocessable_entity }\n end\n end\n end", "def post(*args)\n prepare_request(:post, args)\n @@client.add(:post, @path, *args)\n end", "def create\n doc = Nokogiri::XML(request.body.read)\n bNode = doc.xpath('elwak/benutzer')\n\n @benutzer = Benutzer.new(benutzer_params(bNode))\n if @benutzer.save\n if bNode.xpath('objekt_zuordnungs').length > 0\n objekt_ids = bNode.xpath('objekt_zuordnungs/objekt_id').map{|oz| oz.text.to_s.to_i}\n @benutzer.setze_objekt_zuordnungen(objekt_ids)\n end\n success(@benutzer.id)\n else\n error(@benutzer.errors)\n end\n end", "def create\n @realtor = Realtor.new(params[:realtor])\n\n respond_to do |format|\n if @realtor.save\n flash[:notice] = 'Realtor was successfully created.'\n format.html { redirect_to(admin_realtors_url) }\n format.xml { render :xml => @realtor, :status => :created, :location => @realtor }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @realtor.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n flash[:notice] = 'The reagent was successfully created.' if reagent.save\n respond_with(reagent, :location => root_path)\n end", "def send_xml(out_xml)\n uri = URI.parse(@url)\n http = Net::HTTP.new(uri.host, uri.port)\n request = Net::HTTP::Post.new(uri.request_uri)\n\n @logger.error \"#$%$ #{@user}\"\n request.basic_auth @user, @password\n request.body = out_xml\n\n log(\"Sending request: #{request.inspect}\")\n response = http.request(request)\n\n log(\"Response: #{response}\")\n return response.body\n end", "def http_post(request, response)\n path = request.path\n\n # Only handling xml\n content_type = request.header('Content-Type')\n return nil unless content_type.index('application/xml') || content_type.index('text/xml')\n\n # Making sure the node exists\n begin\n node = @server.tree.node_for_path(path)\n rescue Dav::Exception::NotFound\n return nil\n end\n\n request_body = request.body_as_string\n\n # If this request handler could not deal with this POST request, it\n # will return 'null' and other plugins get a chance to handle the\n # request.\n #\n # However, we already requested the full body. This is a problem,\n # because a body can only be read once. This is why we preemptively\n # re-populated the request body with the existing data.\n request.body = request_body\n\n document_type_box = Box.new('')\n message = @server.xml.parse(request_body, request.url, document_type_box)\n document_type = document_type_box.value\n\n case document_type\n # Dealing with the 'share' document, which modified invitees on a\n # calendar.\n when \"{#{Plugin::NS_CALENDARSERVER}}share\"\n # We can only deal with IShareableCalendar objects\n return true unless node.is_a?(IShareableCalendar)\n\n @server.transaction_type = 'post-calendar-share'\n\n # Getting ACL info\n acl = @server.plugin('acl')\n\n # If there's no ACL support, we allow everything\n acl.check_privileges(path, '{DAV:}write') if acl\n\n node.update_shares(message.set, message.remove)\n\n response.status = 200\n # Adding this because sending a response body may cause issues,\n # and I wanted some type of indicator the response was handled.\n response.update_header('X-Sabre-Status', 'everything-went-well')\n\n # Breaking the event chain\n return false\n # The invite-reply document is sent when the user replies to an\n # invitation of a calendar share.\n when \"{#{Plugin::NS_CALENDARSERVER}}invite-reply\"\n\n # This only works on the calendar-home-root node.\n return true unless node.is_a?(CalendarHome)\n\n @server.transaction_type = 'post-invite-reply'\n\n # Getting ACL info\n acl = @server.plugin('acl')\n\n # If there's no ACL support, we allow everything\n acl.check_privileges(path, '{DAV:}write') if acl\n\n url = node.share_reply(\n message.href,\n message.status,\n message.calendar_uri,\n message.in_reply_to,\n message.summary\n )\n\n response.status = 200\n # Adding this because sending a response body may cause issues,\n # and I wanted some type of indicator the response was handled.\n response.update_header('X-Sabre-Status', 'everything-went-well')\n\n if url\n writer = @server.xml.writer\n writer.open_memory\n writer.start_document\n writer.start_element(\"{#{Plugin::NS_CALENDARSERVER}}shared-as\")\n writer.write(Dav::Xml::Property::Href.new(url))\n writer.end_element\n response.update_header('Content-Type', 'application/xml')\n response.body = writer.output_memory\n end\n\n # Breaking the event chain\n return false\n when \"{#{Plugin::NS_CALENDARSERVER}}publish-calendar\"\n # We can only deal with IShareableCalendar objects\n return true unless node.is_a?(IShareableCalendar)\n\n @server.transaction_type = 'post-publish-calendar'\n\n # Getting ACL info\n acl = @server.plugin('acl')\n\n # If there's no ACL support, we allow everything\n acl.check_privileges(path, '{DAV:}write') if acl\n\n node.publish_status = true\n\n # iCloud sends back the 202, so we will too.\n response.status = 202\n\n # Adding this because sending a response body may cause issues,\n # and I wanted some type of indicator the response was handled.\n response.update_header('X-Sabre-Status', 'everything-went-well')\n\n # Breaking the event chain\n return false\n when \"{#{Plugin::NS_CALENDARSERVER}}unpublish-calendar\"\n # We can only deal with IShareableCalendar objects\n return true unless node.is_a?(IShareableCalendar)\n\n @server.transaction_type = 'post-unpublish-calendar'\n\n # Getting ACL info\n acl = @server.plugin('acl')\n\n # If there's no ACL support, we allow everything\n acl.check_privileges(path, '{DAV:}write') if acl\n\n node.publish_status = false\n\n response.status = 200\n\n # Adding this because sending a response body may cause issues,\n # and I wanted some type of indicator the response was handled.\n response.update_header('X-Sabre-Status', 'everything-went-well')\n\n # Breaking the event chain\n return false\n end\n end", "def post_request(params, useSSL=false)\n # get a server handle\n port = (useSSL == true) ? 443 : 80\n http_server = Net::HTTP.new(API_HOST, port)\n http_server.use_ssl = useSSL\n \n # build a request\n http_request = Net::HTTP::Post.new(API_PATH_REST)\n http_request.form_data = params\n \n # get the response XML\n return http_server.start{|http| http.request(http_request)}.body\n end", "def post(body)\n request = Net::HTTP::Post.new(bind_uri)\n request.body = body\n request.content_length = request.body.size\n request[\"Content-Type\"] = \"text/xml; charset=utf-8\"\n\n Jabber.debug(\"Sending POST request - #{body.strip}\")\n\n response = Net::HTTP.new(domain, port).start { |http| http.request(request) }\n\n Jabber.debug(\"Receiving POST response - #{response.code}: #{response.body.inspect}\")\n\n unless response.is_a?(Net::HTTPSuccess)\n raise Net::HTTPBadResponse, \"Net::HTTPSuccess expected, but #{response.class} was received\"\n end\n\n response\n end", "def post_config(url_prefix, xml)\n url_prefix = URI.escape(\"#{@jenkins_path}#{url_prefix}\")\n http = Net::HTTP.start(@server_ip, @server_port)\n request = Net::HTTP::Post.new(\"#{url_prefix}\")\n puts \"[INFO] PUT #{url_prefix}\" if @debug\n request.basic_auth @username, @password\n request.body = xml\n request.content_type = 'application/xml'\n response = http.request(request)\n response.code\n end", "def post(path, options={})\n request :post, path, options\n end", "def post(method, params = {})\n url = make_url method, params\n query = url.query\n url.query = nil\n\n req = Net::HTTP::Post.new url.path\n req.body = query\n req.content_type = 'application/x-www-form-urlencoded'\n\n res = Net::HTTP.start url.host, url.port do |http|\n http.request req\n end\n\n xml = Nokogiri::XML(res.body, nil, nil, 0)\n\n check_error xml\n\n parse_response xml\n rescue SystemCallError, SocketError, Timeout::Error, IOError,\n Nokogiri::XML::SyntaxError => e\n raise CommunicationError.new(e)\n rescue Net::HTTPError => e\n xml = Nokogiri::XML(e.res.body) { |cfg| cfg.strict }\n check_error xml\n raise CommunicationError.new(e)\n end", "def post_save xml, options={:mapping=>:_default}\n xml.root.add_attributes(\"xmlns\"=>\"http://schema.intuit.com/platform/fdatafeed/investmentaccount/v1\")\n end", "def post(path, params={})\n RestClient.post request_base+path, params\n end", "def sendToTrufina(xml)\n puts \"Sending XML to #{domain}#{endpoint}:\\n\\n#{xml}\\n\\n\" if Trufina::Config.debug?\n \n # Connection Info\n api = Net::HTTP.new( domain, 443 )\n api.use_ssl = true\n api.verify_mode = OpenSSL::SSL::VERIFY_NONE # Prevent annoying warnings\n \n # Request info\n method_call = Net::HTTP::Post.new( endpoint, {'Content-Type' => 'text/xml'} )\n method_call.body = xml\n\n if Config.staging?\n method_call.basic_auth(Config.staging_access[:username], Config.staging_access[:password])\n end\n \n # OK, execute the actual call\n response = api.request(method_call)\n raise Exceptions::NetworkError.new(response.msg) unless response.is_a?(Net::HTTPSuccess)\n parseFromTrufina(response.body)\n end", "def post path_and_params, post_body\n start if not @pid\n @lock.synchronize do\n @last_use = Time.new.to_f\n\n # Make request to xtractr\n Net::HTTP.start('localhost', @port) do |http|\n http.request_post \"/#{path_and_params}\", post_body do |response|\n headers = {}\n response.each_header {|name,val| headers[name] = val}\n return response.code.to_i, headers, response.body\n end\n end\n end\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 post(*args)\n Request.post(*args)\n end", "def post_save xml, options={:mapping=>:_default}\n xml.root.add_attributes(\"xmlns\"=>\"http://schema.intuit.com/platform/fdatafeed/creditaccount/v1\")\n end", "def post endpoint, data\n do_request :post, endpoint, data\n end", "def create\n @rute = Rute.new(params[:rute])\n\n respond_to do |format|\n if @rute.save\n format.html { redirect_to(@rute, :notice => 'Rute was successfully created.') }\n format.xml { render :xml => @rute, :status => :created, :location => @rute }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @rute.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create(params)\n\nxml =<<XML\n<entry xmlns=\"http://purl.org/atom/ns#\">\n <title>#{params[:title]}</title>\n <link rel=\"related\" type=\"text/html\" href=\"#{params[:url]}\" />\n <summary type=\"text/plain\">#{params[:comment]}</summary>\n</entry>\nXML\n\n post('/post', xml)\n end", "def post(path, params={})\n request(:post, path, params)\n end", "def post(path, params={})\n request(:post, path, params)\n end", "def post(path, params={})\n request(:post, path, params)\n end", "def post_check(excon, body)\n excon.request(\n method: :post,\n path: '/check',\n headers: { 'Content-Type' => 'application/json' },\n body: body\n )\nend", "def post options\n rest_request({ method: :post }.merge(options))\n end", "def post options\n rest_request({ method: :post }.merge(options))\n end", "def post(path, params = {})\n Chirpy.request params.merge({:path => path, :method => 'post'}.merge(authentication))\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 postUser( email, user_id, first_name, last_name, active, trust, creation_date, user_type, social_network, social_network_id, reseller_admin_masheryid, group_id, admin_upgrader)\n params = Hash.new\n params['email'] = email\n params['user_id'] = user_id\n params['first_name'] = first_name\n params['last_name'] = last_name\n params['active'] = active\n params['trust'] = trust\n params['creation_date'] = creation_date\n params['user_type'] = user_type\n params['social_network'] = social_network\n params['social_network_id'] = social_network_id\n params['reseller_admin_masheryid'] = reseller_admin_masheryid\n params['group_id'] = group_id\n params['admin_upgrader'] = admin_upgrader\n return doCurl(\"post\",\"/user\",params)\n end", "def nessus_request(uri, post_data) \r\n\t\tbody=nessus_http_request(uri, post_data)\r\n\t\t# puts response.body\r\n\t\tdocxml = REXML::Document.new(body)\r\n\t\tbegin \r\n\t\tstatus = docxml.root.elements['status'].text\r\n\t\trescue\r\n\t\t\tputs \"[e] error in XML parsing\"\r\n\t\tend\r\n\t\tif status == \"OK\"\r\n\t\t\treturn docxml \r\n\t\telse \r\n\t\t\treturn ''\r\n\t\tend\r\n\tend", "def create\n @restaturant = Restaturant.new(restaturant_params)\n\n respond_to do |format|\n if @restaturant.save\n format.html { redirect_to @restaturant, notice: \"Restaturant was successfully created.\" }\n format.json { render :show, status: :created, location: @restaturant }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @restaturant.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @rant = Rant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rant }\n end\n end", "def post_headers\n {\"Content-Type\" => 'text/xml; charset=utf-8'}\n end", "def create\n @node_config = NodeConfig.new(params[:node_config])\n\n respond_to do |format|\n if @node_config.save\n format.xml { render :xml => @node_config, :status => :created, :location => @node_config }\n format.any { render :json => @node_config, :status => :created, :location => @node_config }\n else\n format.xml { render :xml => @node_config.errors, :status => :unprocessable_entity }\n format.any { render :json => @node_config.errors, :status => :unprocessable_entity }\n end\n end\n end", "def post(uri, body)\n RestClient.post(uri, body, :content_type => 'text/xml;charset=\"utf-8\"', :accept => 'text/xml') do |_response, _request, result|\n auth_string = result.header['www-authenticate']\n auth_data = Hash[*auth_string.scan(/(?<k>[a-z]+)=\"(?<v>[^\"]*)\"/).flatten]\n\n request_authorization = gen_auth_digest('POST', uri, body, auth_data)\n\n RestClient.post(uri, body, :'Authorization' => request_authorization, :content_type => 'text/xml;charset=\"utf-8\"', :accept => 'text/xml') do |response, _request, _result|\n return response\n end\n end\n end", "def create_crm_account_from_lead\n doc = Hpricot::XML(request.raw_post)\n doc = doc.to_s.gsub(\"&amp;\",\"&\") \n doc = Hpricot::XML(doc) \n id = parse_xml(doc/:params/'id')\n account_doc = Crm::CrmLeadCrud.generate_xml_for_account(doc) \n @accounts=Crm::CrmLeadCrud.create_account_from_lead(account_doc,id)\n account = @accounts.first if [email protected]?\n if account.errors.empty?\n render:text=>'success'\n else\n respond_to_errors(account.errors)\n end\n end", "def post(request_opts = {})\n store_result(http(request_opts).post(resolved_path, @attrs))\n end", "def generate_xml_request\n tax_receipt = generate_tax_receipt\n @certificate.certifica tax_receipt\n @key.sella tax_receipt\n tax_receipt.to_xml\n end", "def create\n @rendezvouz = Rendezvouz.new(params[:rendezvouz])\n\n respond_to do |format|\n if @rendezvouz.save\n flash[:notice] = 'Rendezvouz was successfully created.'\n format.html { redirect_to(@rendezvouz) }\n format.xml { render :xml => @rendezvouz, :status => :created, :location => @rendezvouz }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @rendezvouz.errors, :status => :unprocessable_entity }\n end\n end\n end", "def post(path, data={})\n request(:post, path, data)\n end", "def post(path, opts = {})\n request(:post, path, opts).body\n end", "def test_should_create_post_via_API_XML\r\n get \"/logout\"\r\n post \"/forum_posts.xml\", :api_key=>'testapikey',\r\n :forum_post => {:title=>'API Test Post',\r\n :body=>'Test Post desc',\r\n :user_id=>1}\r\n assert_response :created\r\n end", "def resturant_params\n params.require(:resturant).permit(:name, :tenbis, :address, :max_delivery_time, :cuisine_id)\n end", "def posttestrail(runId, caseId, statusId, versionId, elapsedseconds)\r\n\r\n uri = \"http://testrailgw.jupiter.bbc.co.uk/?action=add_result_for_case&run_id=#{runId}&case_id=#{caseId}&status_id=#{statusId}&version=#{versionId}&elapsed_seconds=#{elapsedseconds}&sharedSecret=thI5iSourSHAREDsecret\"\r\n #uri = \"http://testrailgw.jupiter.bbc.co.uk/?action=add_result_for_case&run_id=110324&case_id=665022&status_id=1&version=Test&elapsed_seconds=12&sharedSecret=thI5iSourSHAREDsecret\"\r\n\r\n uri = uri.gsub(\" \", \"%20\")\r\n xml_data = open(uri).read\r\n if(xml_data.include? '\"test_id\":')\r\n recorded = xml_data.split('\"test_id\":')[1]\r\n testID = recorded.split(',\"status_id\"')[0]\r\n puts \"TestID:\"+testID\r\n else\r\n puts xml_data\r\n fail \"Cannot Post result to Testrail, check Webservice\"\r\n end\r\n\r\n timeStamp = Time.now.strftime (\"posted at %H:%M %d/%m/%Y\")\r\n files = \"//zgbwcfs3005.jupiter.bbc.co.uk/QA/Jenkins/Jupiter/ICETEAresultupdatelog.txt\"\r\n f = File.open(files,'a')\r\n f.write \"#{testID} #{timeStamp}\"\r\n f.close\r\nend", "def create\n res = self.class.post('/', body: attrs)\n res.created?\n end", "def add_user_for_tenant(args = {}) \n post(\"/tenants.json/#{args[:tenantId]}/users\", args)\nend", "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end", "def post payload, path = \"\" \n make_request(path, \"post\", payload)\n end", "def post(path, params = {})\n\t\trequest(path, :post, params)\n\tend", "def post(path, arguments = {})\n perform_request { connection.post(path, arguments).body }\n end", "def tenants_post_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: IdentityApi.tenants_post ...\"\n end\n # resource path\n local_var_path = \"/tenants\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-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(opts[:'body'])\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 :return_type => 'Tenant')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: IdentityApi#tenants_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def post (dir, data) #DIR is path to REST, Data is HASH of post data\r\n\tbegin\r\n\t\taddress=$server + dir\r\n\t\turi = URI.parse(address)\r\n\t\tdebugging \"Post URI: #{uri}, data: #{data}\"\r\n\t\trequest=Net::HTTP.post_form(uri,data)\r\n\t\tdebugging \"Response #{request}\"\r\n\t\treturn request\r\n\trescue Exception =>msg\r\n\t\tresponse={'body'=>msg,'code'=>401, 'exception' =>true}\r\n\tend\r\nend", "def post_save xml, options={:mapping=>:_default}\n xml.root.add_attributes(\"xmlns\"=>\"http://schema.intuit.com/platform/fdatafeed/bankingaccount/v1\")\n end", "def post(path, params = {})\n request(:post, path, params)\n end", "def post(path, params = {})\n request(:post, path, params)\n end", "def post(path, params = {})\n request(:post, path, params)\n end", "def post(path, params = {})\n request(:post, path, params)\n end", "def post(path, params = {})\n request(:post, path, params)\n end", "def post!\n request! :post\n end", "def make_xml_request( opts={} )\n\t\topts = TEST_XML_REQUEST_OPTS.merge( opts )\n\t\theaders = normalize_headers( opts, TEST_XML_HEADERS )\n\t\theaders.delete( 'URI' ) # XML requests don't have one\n\n\t\tMongrel2.log.debug \"XML request, headers = %p, opts = %p\" % [ headers, opts ]\n\n\t\theaderstring = TNetstring.dump( Yajl::Encoder.encode(headers) )\n\t\tbodystring = TNetstring.dump( opts[:body] || \"#{TEST_XML_PATH} />\" )\n\n\t\t# UUID ID PATH SIZE:HEADERS,SIZE:BODY,\n\t\tdata = \"%s %d %s %s%s\" % [\n\t\t\topts[:uuid],\n\t\t\topts[:id],\n\t\t\topts[:path],\n\t\t\theaderstring,\n\t\t\tbodystring,\n\t\t]\n\t\treturn data.encode( 'binary' )\n\tend" ]
[ "0.61703706", "0.61036104", "0.594174", "0.5814326", "0.58089244", "0.56920713", "0.5669344", "0.5648547", "0.56257904", "0.5597021", "0.5570518", "0.5561257", "0.55009115", "0.5475654", "0.54615736", "0.54613745", "0.5455044", "0.54516435", "0.5438742", "0.54210216", "0.54191643", "0.5412877", "0.54082084", "0.5401377", "0.53936917", "0.5390532", "0.5390385", "0.53882307", "0.53853375", "0.5363251", "0.53553116", "0.53534347", "0.53525287", "0.53502625", "0.5344807", "0.5337838", "0.53351414", "0.53318954", "0.5328348", "0.5327215", "0.5317786", "0.5316334", "0.5310106", "0.5303258", "0.529602", "0.5282053", "0.52728695", "0.5236696", "0.52287596", "0.5216583", "0.5205439", "0.5195803", "0.51912206", "0.5178558", "0.5168495", "0.5168223", "0.5164193", "0.5163552", "0.516307", "0.5162426", "0.5149843", "0.5149843", "0.5149843", "0.51482594", "0.51476455", "0.51476455", "0.5147515", "0.5145392", "0.51437384", "0.5141241", "0.5136648", "0.51346976", "0.5132618", "0.5120536", "0.51200736", "0.511469", "0.5112133", "0.51091444", "0.51088953", "0.5107683", "0.51056725", "0.51000893", "0.50836915", "0.50824445", "0.50742584", "0.5072754", "0.5071259", "0.5045015", "0.5041976", "0.5033403", "0.50304836", "0.50280017", "0.502792", "0.50232685", "0.50232685", "0.50232685", "0.50232685", "0.50232685", "0.5021099", "0.5018473" ]
0.5999423
2
PUT /rants/1 PUT /rants/1.xml
def update @rant = Rant.find(params[:id]) respond_to do |format| if @rant.update_attributes(params[:rant]) format.html { redirect_to(@rant, :notice => 'Rant was successfully updated.') } format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => @rant.errors, :status => :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end", "def rest_update(uri, method: Net::HTTP::Put)\n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n doc = strip_class_attributes(yield doc)\n \n request2 = method.new uri\n request2.content_type = 'application/xml'\n auth_admin(request2)\n\n request2.body=doc.to_s\n \n response2 = http.request request2\n response.value\n\n end\n \nend", "def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end", "def update(id, name=\"Updated Name\", age=\"55\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <id type='integer'>#{id}</id>\r\n <name>#{name}</name>\r\n <age>#{age}</age> \r\n </person>\"\r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end", "def test_put_invoices_1_xml\n @parameters = {:invoice => {:number => 'NewNumber'}}\n \n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/invoices/1.xml',\n {:invoice => {:number => 'NewNumber'}},\n {:success_code => :ok})\n \n assert_no_difference('Invoice.count') do\n put '/invoices/1.xml', @parameters, credentials('admin')\n end\n \n invoice = Invoice.find(1)\n assert_equal \"NewNumber\", invoice.number\n \n end", "def update(id, name= \"Updated Name\")\n xml_req =\n \"<?xml version='1.0' encoding='UTF-8'?>\n <customer>\n <id type='integer'>#{id}</id>\n <name>#{name}</name>\n </customer>\"\n\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\n request.add_field \"Content-Type\", \"application/xml\"\n request.body = xml_req\n\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n # no response body will be returned\n case response\n when Net::HTTPSuccess\n return \"#{response.code} OK\"\n else\n return \"#{response.code} ERROR\"\n end\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def test_put_expenses_1_xml\n @parameters = {:expense => {:description => 'NewDescription'}}\n if ActiveRecord::VERSION::MAJOR < 4\n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/expenses/1.xml',\n {:expense => {:description => 'NewDescription'}},\n {:success_code => :ok})\n end\n\n assert_no_difference('Expense.count') do\n put '/expenses/1.xml', @parameters, credentials('admin')\n end\n\n expense = Expense.find(1)\n assert_equal \"NewDescription\", expense.description\n end", "def test_should_update_link_via_API_XML\r\n get \"/logout\"\r\n put \"/links/1.xml\", :link => {:user_id => 1,\r\n :title => 'API Link 1',\r\n :url => 'http://www.api.com'}\r\n assert_response 401\r\n end", "def update\n doc = Nokogiri::XML(request.body.read)\n cvNode = doc.xpath('elwak/checklisten_vorlage')\n\n update_params = {inaktiv: cvNode.xpath('inaktiv').text.to_s.to_bool}\n respond_to do |format|\n if @checklisten_vorlage.update(update_params)\n format.xml {render :xml => '<?xml version=\"1.0\" encoding=\"UTF-8\"?><success />'}\n else\n format.xml {render :xml => '<?xml version=\"1.0\" encoding=\"UTF-8\"?><error />'}\n end\n end\n end", "def update\n @node = Node.scopied.find(params[:id])\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n format.html { redirect_to(@node, :notice => 'Node was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n keystone.update_tenant({:id=>params[:id],:name=>params[:name],:description=>params[:description],:enabled=>params[:enabled]})\n respond_to do |format|\n format.html { redirect_to tenants_path, :notice => 'Tenant was successfully updated.' }\n format.json { head :ok }\n end\n end", "def put!\n request! :put\n end", "def test_should_update_project_via_API_XML\r\n get \"/logout\"\r\n put \"/projects/1.xml\", :project => {:user_id => 1,\r\n :url => 'http://www.apiproject.com',\r\n :name => 'API Project',\r\n :description => 'API Project Desc' }\r\n assert_response 401\r\n end", "def update_xml\n self.xml= dumpRouteAsXml\n self.save\n end", "def test_should_update_invite_via_API_XML\r\n get \"/logout\"\r\n put \"/invites/1.xml\", :invite => {:message => 'API Invite 1',\r\n :accepted => false,\r\n :email => '[email protected]',\r\n :user_id => 1 }\r\n assert_response 401\r\n end", "def update\n @xml_sample = XmlSample.find(params[:id])\n \n respond_to do |format|\n format.html do\n @xml_sample = XmlSample.update_attributes(params[:xml_sample])\n if @xml_sample.save\n return redirect_to @xml_sample, notice: 'Xml sample was successfully updated.'\n else\n return render action: \"new\"\n end\n end\n format.xml do\n rexml = REXML::Document.new(params[\"xml\"])\n attr = Hash.from_xml(rexml.to_s)\n if @xml_sample.update_attributes(attr[\"xmlsample\"])\n xml = {msg: \"complete\", status: \"OK\"}.to_xml\n else\n xml = {msg: \"failed\", status: \"NG\"}.to_xml\n end\n return render xml: xml\n end\n end\n end", "def update\n @node = Node.find(params[:id])\n @title = \"Taxonomy node - organism relationships\"\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n format.html { redirect_to(@node, :notice => 'Node was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\r\n @razdel1 = Razdel1.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @razdel1.update_attributes(params[:razdel1])\r\n flash[:notice] = 'razdel1 was successfully updated.'\r\n format.html { redirect_to(@razdel1) }\r\n format.xml { head :ok } \r\n else\r\n format.html { render :action => \"edit\" }\r\n format.xml { render :xml => @razdel1.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n @rayon = Rayon.find(params[:id])\n\n respond_to do |format|\n if @rayon.update_attributes(params[:rayon])\n format.html { redirect_to @rayon, notice: 'Rayon was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @rayon.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n doc = Nokogiri::XML(request.body.read)\n bNode = doc.xpath('elwak/benutzer')\n\n @benutzer = Benutzer.find(params[:id])\n \n #Sicherstellen, dass Benutzer synchronisiert wird auch wenn nur Objekt-Zuordnungen anders sind!\n @benutzer.updated_at = DateTime.now \n\n if bNode.xpath('objekt_zuordnungs').length > 0\n @benutzer.setze_objekt_zuordnungen(bNode.xpath('objekt_zuordnungs/objekt_id').map{|oz| oz.text.to_s.to_i})\n end\n if @benutzer.update(benutzer_params(bNode))\n success(nil)\n else\n error(@benutzer.errors)\n end\n end", "def update\n @node = Node.find(params[:id])\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n format.html { redirect_to(@node, :notice => 'Node was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @node = Node.find(params[:id])\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n format.html { redirect_to(@node, :notice => 'Node was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @rtype = Rtype.find(params[:id])\n\n respond_to do |format|\n if @rtype.update_attributes(params[:rtype])\n flash[:notice] = 'Rtype was successfully updated.'\n format.html { redirect_to(@rtype) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @rtype.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update options={}\n client.put(\"/#{id}\", options)\n end", "def update!\n @authorize = nil\n update_plan! &&\n resp = put(\"/users/#{username}.xml\", {\n :user_key => apikey,\n \"user[first_name]\" => first_name,\n \"user[last_name]\" => last_name\n })\n end", "def update\n @t1 = T1.find(params[:id])\n\n respond_to do |format|\n if @t1.update_attributes(params[:t1])\n flash[:notice] = 'T1 was successfully updated.'\n format.html { redirect_to(@t1) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @t1.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update_rest\n @instrument_version = InstrumentVersion.find(params[:id])\n\n respond_to do |format|\n if @instrument_version.update_attributes(params[:instrument_version])\n flash[:notice] = 'InstrumentVersion was successfully updated.'\n format.html { redirect_to(@instrument_version) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @instrument_version.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @uri_type = UriType.find(params[:id])\n\n respond_to do |format|\n if @uri_type.update_attributes(params[:uri_type])\n flash[:notice] = 'UriType was successfully updated.'\n format.html { redirect_to(@uri_type) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @uri_type.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 @bottle = Bottle.find(params[:id])\n\n respond_to do |format|\n if @bottle.update_attributes(params[:bottle])\n format.html { redirect_to(@bottle, :notice => 'Bottle was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @bottle.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @rute = Rute.find(params[:id])\n\n respond_to do |format|\n if @rute.update_attributes(params[:rute])\n format.html { redirect_to(@rute, :notice => 'Rute was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @rute.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @setor = Setor.find(params[:id])\n\n respond_to do |format|\n if @setor.update_attributes(params[:setor])\n format.html { redirect_to(setors_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @setor.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update_user_for_tenant(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/{tenantId}/users/{userId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def update\n @node = Node.find(params[:id])\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n flash[:notice] = 'Node was successfully updated.'\n format.html { redirect_to(@node) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def rm_update path, data, msg\n\n re = rm_request path, data, 'PUT'\n puts re.body\n chk (re.code!='200'), msg + \"\\n#{re.code} #{re.msg}\\n\\n\"\n return true\n\nend", "def update_rest\n @entry_instrument = EntryInstrument.find(params[:id])\n\n respond_to do |format|\n if @entry_instrument.update_attributes(params[:entry_instrument])\n flash[:notice] = 'EntryInstrument was successfully updated.'\n format.html { redirect_to(@entry_instrument) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @entry_instrument.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 put(*args)\n request :put, *args\n end", "def update\n @roaster = Roaster.find(params[:id])\n\n respond_to do |format|\n if @roaster.update_attributes(params[:roaster])\n flash[:notice] = 'Roaster was successfully updated.'\n format.html { redirect_to(@roaster) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @roaster.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @relatorios = Relatorio.find(params[:id])\n\n respond_to do |format|\n if @relatorios.update_attributes(params[:relatorio])\n flash[:notice] = 'RELATORIO SALVO COM SUCESSO.'\n format.html { redirect_to(@relatorios) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @relatorios.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update_rest\n @entry_item = EntryItem.find(params[:id])\n\n respond_to do |format|\n if @entry_item.update_attributes(params[:entry_item])\n flash[:notice] = 'EntryItem was successfully updated.'\n #format.html { redirect_to(@entry_item) }\n format.xml { head :ok }\n else\n #format.html { render :action => \"edit\" }\n format.xml { render :xml => @entry_item.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @estudiante = Estudiante.find(params[:id])\n\n respond_to do |format|\n if @estudiante.update_attributes(params[:estudiante])\n format.html { redirect_to(@estudiante, :notice => 'Estudiante was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estudiante.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @request = Request.find(params[:id])\n\n respond_to do |format|\n if @request.update_attributes(params[:request])\n format.html { redirect_to(@request, :notice => 'Prestamo actualizado.') }\n else\n format.xml { render :xml => @request.errors, :status => :unprocessable_entity }\n end\n end\n end", "def _update(type, current_name, metadata={})\n type = type.to_s.camelize\n request :update do |soap|\n soap.body = {\n :metadata => {\n :current_name => current_name,\n :metadata => prepare(metadata),\n :attributes! => { :metadata => { 'xsi:type' => \"ins0:#{type}\" } }\n }\n }\n end\n end", "def update\n @config_xml = ConfigXml.find(params[:id])\n @config_xml.save!\n\n respond_to do |format|\n if @config_xml.update_attributes(params[:config_xml])\n flash[:notice] = 'ConfigXml was successfully updated.'\n format.html { redirect_to(@config_xml) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @config_xml.errors, :status => :unprocessable_entity }\n end\n end\n rescue ActiveRecord::RecordNotFound => e\n prevent_access(e)\n end", "def update\n @node_config = NodeConfig.find(params[:id])\n\n respond_to do |format|\n if @node_config.update_attributes(params[:node_config])\n format.html { redirect_to(@node_config, :notice => 'NodeConfig was successfully updated.') }\n format.json { render :json => @node_config, :status => :ok }\n format.xml { render :xml => @node_config, :status => :ok }\n else\n format.xml { render :xml => @node_config.errors, :status => :unprocessable_entity }\n format.any { render :json => @node_config.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @rig = Rig.find(params[:id])\n\n respond_to do |format|\n if @rig.update_attributes(params[:rig])\n flash[:notice] = 'Rig was successfully updated.'\n format.html { redirect_to(@rig) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @rig.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update_rest\n @item_usage = ItemUsage.find(params[:id])\n\n respond_to do |format|\n if @item_usage.update_attributes(params[:item_usage])\n flash[:notice] = 'ItemUsage was successfully updated.'\n format.html { redirect_to(@item_usage) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item_usage.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update(args)\n builder.update_rest(type, ref, args, username, password)\n self.elements(true)\n end", "def update_tenant_maintenance_window(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/maintenance/{tenantId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def update\n @step = TaskrequestsStep.find(params[:taskrequests_step_id])\n @absence_request = @step.absence_requests.find(params[:id])\n\n respond_to do |format|\n if @absence_request.update_attributes(params[:absence_request])\n format.html { redirect_to(@absence_request, :notice => 'Absence request was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @absence_request.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @rip = Rip.find(params[:id])\n respond_to do |format|\n if @rip.update_attributes(params[:rip])\n format.html { redirect_to rip_url(@rip) }\n format.xml { head :ok }\n else\n format.html { render :action => 'edit' }\n format.xml { render :xml => @rip.errors.to_xml }\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 put(path, params={})\n RestClient.put request_base+path, params\n end", "def update\n respond_to do |format|\n format.xml { head :method_not_allowed }\n format.json { head :method_not_allowed }\n end\n end", "def update\n @estudiante = Estudiante.find(params[:id])\n\n respond_to do |format|\n if @estudiante.update_attributes(params[:estudiante])\n flash[:notice] = 'Actualizado.'\n format.html { redirect_to(@estudiante) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estudiante.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n resource_path = \"/projects/#{project_id}/people/#{id}\"\n Request.put(resource_path, self.to_xml('person'))\n end", "def update\n put :update\n end", "def update\n respond_to do |format|\n if @resturant.update(resturant_params)\n format.html { redirect_to @resturant, notice: 'Resturant was successfully updated.' }\n format.json { render :show, status: :ok, location: @resturant }\n else\n format.html { render :edit }\n format.json { render json: @resturant.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_node\n params[:id] = params[:id] + '/' if (params[:id] == 'rest')\n @node = Fedora.rest(params[:id])\n end", "def update\n @stanza = Stanza.find_by_no(params[:id])\n\n respond_to do |format|\n if @stanza.update_attributes(params[:stanza])\n format.html { redirect_to @stanza, notice: 'Stanza was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stanza.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 :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 @Roc = Roc.find(params[:id])\n\n respond_to do |format|\n if @Roc.update_attributes(params[:Roc])\n flash[:notice] = 'Roc was successfully updated.'\n format.html { redirect_to(@Roc) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @Roc.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @revendedor = Revendedor.find(params[:id])\n\n respond_to do |format|\n if @revendedor.update_attributes(params[:revendedor])\n flash[:notice] = 'Revendedor was successfully updated.'\n format.html { redirect_to(@revendedor) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @revendedor.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @realtor = Realtor.find(params[:id])\n\n respond_to do |format|\n if @realtor.update_attributes(params[:realtor])\n flash[:notice] = 'Realtor was successfully updated.'\n format.html { redirect_to(admin_realtors_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @realtor.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @tenant = Tenant.find(params[:id])\n\n respond_to do |format|\n if @tenant.update_attributes(params[:tenant])\n format.html { redirect_to(@tenant, :notice => 'tenant was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tenant.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @atom = Atom.find(params[:id])\n\n respond_to do |format|\n if @atom.update_attributes(params[:atom])\n flash[:notice] = 'Atom was successfully updated.'\n format.html { redirect_to(@atom) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @atom.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @rede = Rede.find(params[:id])\n\n respond_to do |format|\n if @rede.update_attributes(params[:rede])\n format.html { redirect_to(@rede, :notice => 'Rede was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @rede.errors, :status => :unprocessable_entity }\n end\n end\n end", "def test_putpoi_update_valid\n nd = create(:node)\n cs_id = nd.changeset.id\n user = nd.changeset.user\n amf_content \"putpoi\", \"/1\", [\"#{user.email}:test\", cs_id, nd.version, nd.id, nd.lon, nd.lat, nd.tags, nd.visible]\n post :amf_write\n assert_response :success\n amf_parse_response\n result = amf_result(\"/1\")\n\n assert_equal 5, result.size\n assert_equal 0, result[0]\n assert_equal \"\", result[1]\n assert_equal nd.id, result[2]\n assert_equal nd.id, result[3]\n assert_equal nd.version + 1, result[4]\n\n # Now try to update again, with a different lat/lon, using the updated version number\n lat = nd.lat + 0.1\n lon = nd.lon - 0.1\n amf_content \"putpoi\", \"/2\", [\"#{user.email}:test\", cs_id, nd.version + 1, nd.id, lon, lat, nd.tags, nd.visible]\n post :amf_write\n assert_response :success\n amf_parse_response\n result = amf_result(\"/2\")\n\n assert_equal 5, result.size\n assert_equal 0, result[0]\n assert_equal \"\", result[1]\n assert_equal nd.id, result[2]\n assert_equal nd.id, result[3]\n assert_equal nd.version + 2, result[4]\n end", "def xml(id)\n http.get(\"/nfse/#{id}/xml\") do |response|\n response.headers.fetch(\"Location\") { \"\" }\n end\n end", "def set_resturant\n @resturant = Resturant.find(params[:id])\n end", "def set_update\n @recepient = Recepient.find(params[:id]) \n end", "def update_aos_version(args = {}) \n id = args['id']\n temp_path = \"/aosversions.json/{aosVersionId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"aosversionId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def update_rest\n @entry_answer = EntryAnswer.find(params[:id])\n\n respond_to do |format|\n if @entry_answer.update_attributes(params[:entry_answer])\n flash[:notice] = 'EntryAnswer was successfully updated.'\n format.html { redirect_to(@entry_answer) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @entry_answer.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @restaurant = Restaurant.find(params[:id])\n\n respond_to do |format|\n if @restaurant.update_attributes(params[:restaurant])\n format.html { redirect_to(@restaurant, :notice => 'Restaurant was successfully updated.') }\n format.xml { head :ok }\n format.json { render :json => { :status => :ok }.to_json }\n else\n format.html { render :action => 'edit' }\n format.xml { render :xml => @restaurant.errors, :status => :unprocessable_entity }\n format.json { fail }\n end\n end\n end", "def override\n document_id = params[:document_id]\n document = params[:document]\n document_type = params[:document_type]\n ticket = Document.ticket(Alfresco::Document::ALFRESCO_USER, Alfresco::Document::ALFRESCO_PASSWORD)\n\n builder = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml|\n xml.entry(:xmlns => \"http://www.w3.org/2005/Atom\",\n \"xmlns:cmisra\" => \"http://docs.oasis-open.org/ns/cmis/restatom/200908/\",\n \"xmlns:cmis\" => \"http://docs.oasis-open.org/ns/cmis/core/200908/\") {\n xml.title document.original_filename if document\n xml.summary document_type\n if document\n xml.content(:type => document.content_type) {\n xml.text Base64.encode64(document.read)\n }\n end\n }\n end\n\n url = Document::PATH + \"cmis/i/#{document_id}?alf_ticket=\" + ticket\n\n begin\n RestClient.put url, builder.to_xml, {:content_type => 'application/atom+xml;type=entry'}\n rescue => e\n Rails.logger.info \"#\"*50\n Rails.logger.info \"Error updating file\"\n Rails.logger.info e.message\n Rails.logger.info \"#\"*50\n end\n\n redirect_to :controller => 'related_service_requests', :action => 'show', :anchor => 'documents', :service_request_id => params[:friendly_id], :id => params[:ssr_id]\n end", "def update\n @node_rack = @object\n\n respond_to do |format|\n if @node_rack.update_attributes(params[:node_rack])\n flash[:notice] = 'NodeRack was successfully updated.'\n format.html { redirect_to node_rack_url(@node_rack) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node_rack.errors.to_xml, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @rent = Rent.find(params[:id])\n\n respond_to do |format|\n if @rent.update_attributes(params[:rent])\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 api_xml(path,method=:get,options={})\n xml_message(amee,\"/data\"+path,method,options)\n end", "def update\n @method1 = Method1.find(params[:id])\n\n respond_to do |format|\n if @method1.update_attributes(params[:method1])\n format.html { redirect_to(@method1, :notice => 'Method1 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @method1.errors, :status => :unprocessable_entity }\n end\n end\n end", "def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end", "def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end", "def update\n @tipo_restaurante = TipoRestaurante.find(params[:id])\n\n respond_to do |format|\n if @tipo_restaurante.update_attributes(params[:tipo_restaurante])\n format.html { redirect_to(@tipo_restaurante, :notice => 'Tipo restaurante was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_restaurante.errors, :status => :unprocessable_entity }\n end\n end\n end", "def solveticket(assigneeid, ticketidxml)\n\n raise ArgumentError.new(\"no assignee is present\") if assigneeid.empty?\n raise ArgumentError.new(\"ticketid is present text provided\") if ticketidxml.empty?\n\n xml = createsolvedticketxml(assigneeid)\n\n begin\n resource = RestClient::Resource.new @hostname, @username, @password\n url = 'tickets/'+ ticketidxml\n httpresponse = resource[url].put xml.to_s, :content_type => 'application/xml', :accept => '*/*'\n processresponse(httpresponse) # call success handler\n rescue => e\n processerror(e) # call error handler\n end\n\n end", "def update\n @taxirequest = Taxirequest.find(params[:id])\n\n respond_to do |format|\n if @taxirequest.update_attributes(params[:taxirequest])\n format.html { redirect_to @taxirequest, notice: 'Taxirequest was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @taxirequest.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @lore = Lore.find(params[:id])\n\n respond_to do |format|\n if @lore.update_attributes(params[:lore])\n format.html { redirect_to(@lore, :notice => 'Lore was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @lore.errors, :status => :unprocessable_entity }\n end\n end\n end", "def updateX\n @server = Server.find(params[:id])\n\n respond_to do |format|\n if @server.update_attributes(params[:server])\n format.html { redirect_to(@server, :notice => 'Server was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @server.errors, :status => :unprocessable_entity }\n end\n end\n end", "def put(path, params = {})\n request(:put, path, params)\n end", "def put(path, params = {})\n request(:put, path, params)\n end", "def put(path, params = {})\n request(:put, path, params)\n end", "def update\n @omatsuri = Omatsuri.find(params[:id])\n\n respond_to do |format|\n if @omatsuri.update_attributes(params[:omatsuri])\n flash[:notice] = 'Omatsuri was successfully updated.'\n format.html { redirect_to(@omatsuri) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @omatsuri.errors, :status => :unprocessable_entity }\n end\n end\n end", "def put payload, path = \"\"\n make_request(path, \"put\", payload)\n end", "def update\n flash[:notice] = 'The reagent was successfully modified.' if reagent.update_attributes(params[:reagent])\n respond_with(reagent, :location => root_path)\n end", "def update_object_xml(object_type, id, xml)\n @client.update_business_object_by_public_id({\n :busObNameOrId => object_type,\n :busObPublicId => id,\n :updateXml => xml\n })\n return last_error\n end", "def update\n @estatu = Estatu.find(params[:id])\n\n respond_to do |format|\n if @estatu.update_attributes(params[:estatu])\n format.html { redirect_to(@estatu, :notice => 'Registro actualizado correctamente.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estatu.errors, :status => :unprocessable_entity }\n end\n end\n end", "def put(path, options={})\n request :put, path, options\n end", "def edit_xml(path, &block)\n write path, xml(path).tap(&block).to_s\n end", "def test_put\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 contents = last_response.body\n contents_id = contents['_id']\n\n data = File.read 'sample-traces/1.json'\n put(\"/traces/#{contents_id}\", data, 'CONTENT_TYPE': 'application/json')\n contents = last_response.body\n\n assert_equal contents_id, contents['_id']\n end", "def update\n @agent = Agent.find(params[:id])\n\n respond_to do |format|\n if @agent.update_attributes(params[:agent])\n format.html { redirect_to(@agent, :notice => 'Agent was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @agent.errors, :status => :unprocessable_entity }\n end\n end\n end" ]
[ "0.66125566", "0.6565633", "0.6480401", "0.6308165", "0.6123096", "0.6023699", "0.5961873", "0.5935211", "0.57414746", "0.5708852", "0.570121", "0.56939745", "0.5654527", "0.56332725", "0.5601463", "0.56011236", "0.55987847", "0.5591594", "0.55872583", "0.5575569", "0.5558669", "0.5543052", "0.5542098", "0.55283093", "0.5523617", "0.55199134", "0.55098975", "0.5502355", "0.5496164", "0.54918045", "0.54832715", "0.5473632", "0.54675937", "0.5463712", "0.5461285", "0.54594606", "0.545907", "0.5457157", "0.54463696", "0.54293543", "0.5389947", "0.5387322", "0.5372194", "0.537206", "0.5366594", "0.53513825", "0.53507125", "0.53465146", "0.534214", "0.5340322", "0.53394765", "0.5335342", "0.53192306", "0.5318481", "0.5313106", "0.53122926", "0.53049415", "0.5300444", "0.5297718", "0.5297235", "0.5295008", "0.5294073", "0.5293345", "0.52910113", "0.52902645", "0.52873695", "0.528704", "0.528616", "0.52851135", "0.5278373", "0.5271897", "0.5270601", "0.5266386", "0.52518284", "0.5251249", "0.52508503", "0.5247569", "0.52465415", "0.524592", "0.5242215", "0.5240076", "0.5237901", "0.5237901", "0.52355236", "0.5230787", "0.52285933", "0.52280533", "0.5227654", "0.5226401", "0.5226401", "0.5226401", "0.522264", "0.52199966", "0.5217445", "0.52121544", "0.5209596", "0.5207842", "0.5206155", "0.5205718", "0.52044886" ]
0.61573076
4
DELETE /rants/1 DELETE /rants/1.xml
def destroy @rant = Rant.find(params[:id]) @rant.destroy respond_to do |format| format.html { redirect_to(rants_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end", "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end", "def delete!\n Recliner.delete(uri)\n end", "def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end", "def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end", "def delete\n client.delete(\"/#{id}\")\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\r\n @razdel1 = Razdel1.find(params[:id])\r\n @razdel1.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(razdel1s_url) }\r\n format.xml { head :ok }\r\n end\r\n end", "def destroy\n @direccion = Direccion.find(params[:id])\n @direccion.destroy\n\n respond_to do |format|\n format.html { redirect_to(direccions_url) }\n format.xml { head :ok }\n end\n end", "def delete(options={})\n connection.delete(\"/\", @name)\n end", "def destroy\n @config_xml = ConfigXml.find(params[:id])\n @config_xml.destroy\n\n respond_to do |format|\n format.html { redirect_to(config_xmls_url) }\n format.xml { head :ok }\n end\n rescue ActiveRecord::RecordNotFound => e\n prevent_access(e)\n end", "def destroy\n @dossier = Dossier.find(params[:id])\n @dossier.destroy\n\n respond_to do |format|\n format.html { redirect_to(\"/\") }\n format.xml { head :ok }\n end\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def destroy\n @rute = Rute.find(params[:id])\n @rute.destroy\n\n respond_to do |format|\n format.html { redirect_to(rutes_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @browsenodeid = Browsenodeid.find(params[:id])\n @browsenodeid.destroy\n\n respond_to do |format|\n format.html { redirect_to(browsenodeids_url) }\n format.xml { head :ok }\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.xml { head :ok }\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.xml { head :ok }\n end\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def delete(id)\n request = Net::HTTP::Delete.new(\"#{@url}/#{id}.xml\")\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n # no response body will be returned\n case response\n when Net::HTTPSuccess\n return \"#{response.code} OK\"\n else\n return \"#{response.code} ERROR\"\n end\n end", "def delete_data(index_name)\n uri = @client.make_uri(\"/#{index_name}/update/\")\n req = HTTP::Post.new(uri)\n req.content_type = 'text/xml'\n req.body = '<delete><query>*:*</query></delete>'\n response = @client.send_http(req, true, ['200'])\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def destroy\n @relatorios = Relatorio.find(params[:id])\n @relatorios.destroy\n\n respond_to do |format|\n format.html { redirect_to(homes_path) }\n format.xml { head :ok }\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 delete\n request(:delete)\n end", "def destroy\n @relatorio = Relatorio.find(params[:id])\n @relatorio.destroy\n\n respond_to do |format|\n format.html { redirect_to(home_path) }\n format.xml { head :ok }\n end\n end", "def delete_trust(xml) \n if current_user \n trust_root = xml.root.get_elements('TrustRoot').first.text \n unless trust_root.empty? \n @trust = current_user.trusts.find(:first, :conditions => ['trust_root = ?', trust_root]) \n if @trust \n @trust.destroy \n return render(:text => \"<Response>success</Response>\") \n end \n end \n end \n render :text => '<Response>trust root does not exist</Response>' \n end", "def delete(*uris); end", "def delete\n\t\tdb.execute{ \"delete edge #{ref_name} #{rrid}\" }\n\tend", "def destroy\n @recurso = Recurso.find(params[:id])\n @recurso.destroy\n\n respond_to do |format|\n format.html { redirect_to(recursos_url) }\n format.xml { head :ok }\n end\n end", "def delete_by_id id, opts = {}\n update opts.merge(:data => xml.delete_by_id(id))\n end", "def destroy\n @dossier = Dossier.find(params[:id])\n @dossier.destroy\n\n respond_to do |format|\n format.html { redirect_to(dossiers_url) }\n format.xml { head :ok }\n end\n end", "def deleteResource(doc, msg_from)\n \n \n begin\n\n puts \"Deleting\"\n\n path = \"\"\n params = {}\n headers = {}\n \n context, path = findContext(doc, path) \n \n # Deleting member from group\n if context == :user_group_member\n params = {}\n else\n raise Exception.new(\"No context given!\")\n end\n \n httpAndNotify(path, params, msg_from, :delete)\n \n rescue Exception => e\n puts \"Problem in parsing data (CREATE) from xml or sending http request to the VR server: \" + e\n puts \" -- line: #{e.backtrace[0].to_s}\"\n end\n \n end", "def test_set3_06b_delete_res_object()\n user = \"test_user\"\n priv = \"test_privilege\"\n res_ob_type = \"test\"\n res_ob_adr = \"/db/temporary/testsource\"\n \n @test_acl.create_principal(user)\n @test_acl.create_resource_object(res_ob_type, res_ob_adr, user)\n id = @test_acl.create_ace(user, \"allow\", priv, res_ob_type, res_ob_adr)\n \n @test_acl.delete_res_object(res_ob_type, res_ob_adr)\n query = \"doc(\\\"#{@col_path}acl.xml\\\")//node()[@id=\\\"#{id}\\\"]\"\n handle = @db.execute_query(query)\n hits = @db.get_hits(handle)\n assert_equal(0, hits)\n end", "def destroy\n @rendezvouz = Rendezvouz.find(params[:id])\n @rendezvouz.destroy\n\n respond_to do |format|\n format.html { redirect_to(rendezvouzs_url) }\n format.xml { head :ok }\n end\n end", "def rm(*path)\n super; on_success{ nil }\n end", "def destroy\n @relatestagiario = Relatestagiario.find(params[:id])\n @relatestagiario.destroy\n\n respond_to do |format|\n format.html { redirect_to(relatestagiarios_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @hydrant = Hydrant.find(params[:id])\n @hydrant.destroy\n\n respond_to do |format|\n format.html { redirect_to(hydrants_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @recommand = Recommand.find(params[:id])\n @recommand.destroy\n\n respond_to do |format|\n format.html { redirect_to(recommands_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @revenu = @foyer.revenus.find(params[:id])\n @revenu.destroy\n\n respond_to do |format|\n format.html { redirect_to foyer_revenus_url(@foyer) }\n format.xml { head :ok }\n end\n end", "def destroy\n @tipo_restaurante = TipoRestaurante.find(params[:id])\n @tipo_restaurante.destroy\n\n respond_to do |format|\n format.html { redirect_to(tipo_restaurantes_url) }\n format.xml { head :ok }\n end\n end", "def test_set3_04c_delete_principal()\n user = \"test_user\"\n @test_acl.create_principal(user)\n id = @test_acl.create_ace(user, \"allow\", \"SELECT\", \"test\", \"/db/temporary/testsource\")\n \n @test_acl.delete_principal(user)\n query = \"doc(\\\"#{@col_path}acl.xml\\\")//node()[@id=\\\"#{id}\\\"]\"\n handle = @db.execute_query(query)\n hits = @db.get_hits(handle)\n assert_equal(0, hits)\n end", "def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to(nodes_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to(nodes_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to(nodes_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to(nodes_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to(nodes_url) }\n format.xml { head :ok }\n end\n end", "def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end", "def destroy\n @rig = Rig.find(params[:id])\n @rig.destroy\n\n respond_to do |format|\n format.html { redirect_to(rigs_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @person = Person.find(params[:id])\n pedigree = @person.pedigree\n @person.destroy\n\n respond_to do |format|\n format.html { redirect_to(pedigree_url(pedigree)) }\n format.xml { head :ok }\n end\n end", "def delete\n start { |connection| connection.request http :Delete }\n end", "def destroy\n @node_config = NodeConfig.destroy(params[:id])\n xml=@node_config.to_xml\n json=@node_config.to_json\n @node_config.destroy\n\n respond_to do |format|\n format.html { redirect_to(node_configs_url) }\n format.json { render :json => json}\n format.xml { render :xml => xml}\n end\n end", "def delete(path)\n request(:delete, path)\n end", "def destroy\n client = Connection::MarkLogic.new.client\n client.send_corona_request(\"/v1/documents?uri=/amandments/amandment_#{@amandment.id}.xml\", :delete)\n @amandment.destroy\n respond_to do |format|\n format.html { redirect_to home_meeting_path, notice: 'Amandman was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @t1 = T1.find(params[:id])\n @t1.destroy\n\n respond_to do |format|\n format.html { redirect_to(t1s_url) }\n format.xml { head :ok }\n end\n end", "def delete\n Iterable.request(conf, base_path).delete\n end", "def delete\n \n end", "def destroy \n Link.connection.execute(\"delete from links where id in (#{params[:id].join(',')})\") unless params[:id].blank?\n respond_to do |format|\n format.html { redirect_to(links_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @path = Path.find(params[:id])\n @path.destroy\n\n respond_to do |format|\n format.html { redirect_to(layer_url) }\n format.xml { head :ok }\n end\n end", "def delete!\n\t\t\tClient.delete @root\n\t\tend", "def destroy\n @receita = Receita.find(params[:id])\n @receita.destroy\n\n respond_to do |format|\n format.html { redirect_to(receitas_url) }\n format.xml { head :ok }\n end\n end", "def delete_all(xpath); end", "def destroy\n @rubro.destroy\n\n respond_to do |format|\n format.html { redirect_to(rubros_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @bottle = Bottle.find(params[:id])\n @bottle.destroy\n\n respond_to do |format|\n format.html { redirect_to(bottles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @Roc = Roc.find(params[:id])\n @Roc.destroy\n\n respond_to do |format|\n format.html { redirect_to(Rocs_url) }\n format.xml { head :ok }\n end\n end", "def delete\n execute_request('DELETE') do |uri, headers|\n HTTP.http_client.delete(uri, header: headers)\n end\n end", "def delete\n url = prefix + \"delete\" + id_param\n return response(url)\n end", "def destroy\n @remocao = Remocao.find(params[:id])\n @remocao.destroy\n\n respond_to do |format|\n format.html { redirect_to(remocaos_url) }\n format.xml { head :ok }\n end\n end", "def destroy; delete end", "def destroy\n @refferalmaster = Refferalmaster.find(params[:id])\n @refferalmaster.destroy\n\n respond_to do |format|\n format.html { redirect_to(refferalmasters_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @estudiante = Estudiante.find(params[:id])\n @estudiante.destroy\n\n respond_to do |format|\n format.html { redirect_to(estudiantes_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @estudiante = Estudiante.find(params[:id])\n @estudiante.destroy\n\n respond_to do |format|\n format.html { redirect_to(estudiantes_url) }\n format.xml { head :ok }\n end\n end", "def delete(name)\n\n end", "def destroy\n @norma = Norma.find(params[:id])\n @norma.destroy\n\n respond_to do |format|\n format.html { redirect_to(normas_url) }\n format.xml { head :ok }\n end\n end", "def delete\n @user = User.find(params[:id])\n @user.rvsps.delete_all()\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "def delete; rest_delete(link('self')); end", "def delete; rest_delete(link('self')); end", "def delete(path)\n make_call(mk_conn(path), :delete)\n end", "def delete(id)\r\n connection.delete(\"/#{@doctype}[@ino:id=#{id}]\")\r\n end", "def destroy\n @omatsuri = Omatsuri.find(params[:id])\n @omatsuri.destroy\n\n respond_to do |format|\n format.html { redirect_to(omatsuris_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @rdv = Rdv.find(params[:id])\n @rdv.destroy\n\n respond_to do |format|\n format.html { redirect_to(rdvs_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @reclamo = Reclamo.find(params[:id])\n @reclamo.destroy\n\n respond_to do |format|\n format.html { redirect_to(reclamos_url) }\n format.xml { head :ok }\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 @raid = Raid.find(params[:id])\n @raid.destroy\n\n respond_to do |format|\n format.html { redirect_to(raids_url) }\n format.xml { head :ok }\n end\n end", "def delete(name)\n @ctx.delete(@path + name)\n end", "def delete\n \n end", "def delete\n\n end", "def delete(path)\n\t\trequest(path, :delete)\n\tend", "def destroy\n @feefile = Feefile.find(params[:id])\n directory= \"uploads\"\n path =File.join(directory,@feefile.feefilename)\n File.delete(path)\n @feefile.destroy\n \n\n respond_to do |format|\n format.html { redirect_to(feefiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @retain_node = RetainNode.find(params[:id])\n @retain_node.destroy\n\n respond_to do |format|\n format.html { redirect_to(retain_nodes_url) }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end", "def destroy\n @node = Node.scopied.find(params[:id])\n @node.kill\n\n respond_to do |format|\n format.html { redirect_to(nodes_url) }\n format.xml { head :ok }\n end\n end", "def delete\n end", "def destroy\n @test_plant = TestPlant.find(params[:id])\n @test_plant.destroy\n\n respond_to do |format|\n format.html { redirect_to(test_plants_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @lore = Lore.find(params[:id])\n @lore.destroy\n\n respond_to do |format|\n format.html { redirect_to(lores_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @ingredience = Ingredience.find(params[:id])\n @ingredience.destroy\n\n respond_to do |format|\n format.html { redirect_to(ingrediences_url) }\n format.xml { head :ok }\n end\n end", "def deletes_to(path,opts={},&block) #:nodoc: \n crud_to(:delete,path,opts[:params] || {},opts,&block)\n end", "def destroy\n @brother = Brother.find(params[:id])\n @brother.destroy\n\n respond_to do |format|\n format.html { redirect_to(brothers_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @absence_request = AbsenceRequest.find(params[:id])\n @absence_request.destroy\n\n respond_to do |format|\n format.html { redirect_to(absence_requests_url) }\n format.xml { head :ok }\n end\n end", "def delete(*rest) end", "def delete(id:)\n id_check(:id, id)\n\n cf_delete(path: \"/organizations/#{org_id}/railguns/#{id}\")\n end" ]
[ "0.6995677", "0.6889536", "0.6782724", "0.67415076", "0.6666296", "0.6520055", "0.6416102", "0.6396114", "0.63591385", "0.62944627", "0.62926376", "0.6288517", "0.62749314", "0.6267756", "0.62559575", "0.6255345", "0.6255345", "0.62546223", "0.6250471", "0.62441224", "0.62432545", "0.62432474", "0.62361574", "0.6221789", "0.62100166", "0.6201226", "0.6189286", "0.61796725", "0.6177986", "0.6171439", "0.6168834", "0.6168497", "0.61548585", "0.61511695", "0.6143193", "0.6141537", "0.61271566", "0.6111655", "0.6104445", "0.61012536", "0.6096071", "0.60959756", "0.60959756", "0.60959756", "0.60959756", "0.60959756", "0.6094621", "0.6093861", "0.60937446", "0.6090039", "0.6088455", "0.6084199", "0.6082016", "0.6079218", "0.6075367", "0.60735005", "0.6070683", "0.60704", "0.60580707", "0.60537803", "0.6050938", "0.60462475", "0.6041686", "0.6041602", "0.60384434", "0.6037746", "0.60332525", "0.6033157", "0.6031015", "0.6030839", "0.6030735", "0.6028692", "0.6028154", "0.6027983", "0.60273856", "0.60273856", "0.6023049", "0.6019538", "0.60188234", "0.6017183", "0.6016756", "0.6016174", "0.6016174", "0.60158706", "0.60147965", "0.6012402", "0.60099113", "0.60021687", "0.6000289", "0.59995735", "0.59990597", "0.5999009", "0.5994654", "0.59945714", "0.5993057", "0.59892106", "0.598914", "0.5989065", "0.5988084", "0.5987371" ]
0.6775186
3
Returns true if and only if: 1. There are two and only two arguments 2. That argument, when converted to an integer, is nonnegative Returns false otherwise If any errors occur (e.g. args is nil), just return false we are going to exit anyways, so no need for more detailed categorization of the error
def check_args(args) begin results = [Integer(args[0]), Integer(args[1])] rescue ArgumentError, TypeError puts 'Invalid input.' end args.count == 2 && results[1] >= 1 rescue StandardError false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_args(args)\n args.count == 2 && args[0].to_i > 0 && args[1].to_i > 0\n rescue StandardError\n false\n end", "def check_args(arguments)\r\n if arguments.length != 3\r\n puts 'There must be exactly three arguments: *seed*, *num_prospectors*, *num_turns*'\r\n return false\r\n elsif arguments[1].to_i.negative? || arguments[2].to_i.negative?\r\n puts 'Usage:'\r\n puts 'ruby ruby_rush.rb *seed* *num_prospectors* *num_turns*'\r\n puts '*seed* should be an integer'\r\n puts '*num_prospectors* should be a non-negative integer'\r\n puts '*num_turns* should be a non-negative integer'\r\n return false\r\n end\r\n true\r\nend", "def arguments_passed?\n !!(ARGV[0] && ARGV[1] && ARGV[2])\n end", "def test_two_ints\n args = Arguments.new\n assert_equal false, args.check_args([1, 2])\n end", "def test_one_ints\n args = Arguments.new\n assert_equal false, args.check_args([1])\n end", "def arguments_valid?\n return false if @arguments.length != 2\n @number = @arguments[0].to_i\n @value = @arguments[1].to_i\n true if (@number > 0 && @value > (@number-1) && @value < (@number*6+1)) \n end", "def test_check_num_args_invalid2\n args = CheckNumArgs.new\n assert_equal false, args.check_args([1])\n end", "def test_check_num_args_invalid_negative\n args = CheckNumArgs.new\n assert_equal false, args.check_args([0,-1,-1])\n end", "def arguments_valid?\n # TO DO - implement your real logic here\n true if @arguments.length == 2\n end", "def right_type?\n ARGV[0].is_a?(String) && ARGV[1].is_number? && ARGV[2].is_number?\n end", "def arguments_valid?\n # TO DO - implement your real logic here\n true if (1..2).include? @arguments.length \n end", "def test_check_args_false\n c = Checker.new\n assert_equal false, c.check_args([1, 1, 1, 1])\n assert_equal false, c.check_args([1,1])\n assert_equal false, c.check_args(['something', 111])\n assert_equal false, c.check_args([1, -1, 1])\n assert_equal false, c.check_args([1, 1, -1])\n end", "def test_positive\r\n args = Args.new\r\n assert_equal false, args.check_args(6)\r\n end", "def test_check_num_args_invalid3\n args = CheckNumArgs.new\n assert_equal false, args.check_args([1, 2])\n end", "def test_positive\n args = Arguments.new\n assert_equal false, args.check_args(5)\n end", "def check_args(args)\r\n args.count == 1\r\n File.exist?(ARGV[0].to_s)\r\nrescue StandardError\r\n false\r\nend", "def valid_arguments?\n arguments_passed? && right_type?\n end", "def test_check_num_args_invalid_zero\n args = CheckNumArgs.new\n assert_equal false, args.check_args([0,0,0])\n end", "def test_check_args_invalid_negative\n args = CheckArgs.new\n assert_equal false, args.check_args([6, -2, -3])\n end", "def wrong_num_parameters?\n (ARGV.size != 1)\n end", "def incorrect_arg_size?(args)\n return false if has_splat_args?\n required_arg_size = @args.take_while {|e| e[1].nil? }.size\n args.size < required_arg_size || args.size > required_arg_size\n end", "def check_arg()\n if ARGV.length > 1\n print \"ERROR: Too many command line args.\\n\"\n print \"USAGE: #{$PROGRAM_NAME} [--FixThemAll]\\n\"\n exit ERR_EXIT_ARGS2MANY\n end\n if ARGV.length == 1 && ARGV[0] != '--FixThemAll'\n print \"ERROR: Invalid argument on command line: '#{ARGV[0]}'\\n\"\n print \"USAGE: #{$PROGRAM_NAME} [--FixThemAll]\\n\"\n exit ERR_EXIT_ARGINVALID\n end\nend", "def test_arg_check_turns_negative\n def exit(x); 1; end\n ret = arg_check_turns '-1'\n assert_equal ret, -4\n end", "def test_check_num_args_valid2\n args = CheckNumArgs.new\n args.check_args([1,1,1])\n assert_kind_of Integer, 1\n end", "def test_check_args_invalid_zero\n args = CheckArgs.new\n assert_equal false, args.check_args([2, 0, 0])\n end", "def arguments_valid?\n # TO DO - implement some real logic here\n true if @arguments.length == 1 \n end", "def arguments_valid?\n # TO DO - implement your real logic here\n true if @arguments.length == 1 \n end", "def invalid_arguments?(arguments, count)\n\t\targuments.length != count\n\tend", "def arguments_valid?\n # TODO - implement your real logic here\n true # if @arguments.length == 1\n end", "def arguments_valid?\n\t\t # TO DO - implement your real logic here\n\t\t true if @arguments.length == 1\n\t\tend", "def test_arg_check_prospectors_negative\n def exit(x); 1; end\n ret = arg_check_prospectors '-1'\n assert_equal ret, -3\n end", "def test_check_args_invalid2\n args = CheckArgs.new\n assert_equal false, args.check_args([1, 2])\n end", "def arguments_valid?\n true if @arguments.size > 1\n end", "def arguments_valid?\n if @arguments.length == 1\n @options.port = @arguments[0].to_i\n return true\n end\n @arguments.length == 0\n end", "def test_nonzero_arguments\n args_checker = ArgsChecker.new\n arr = [1]\n assert_equal false, args_checker.check_mode(arr)\n end", "def arguments_valid?\n num = 0\n num += 1 if @options.stats\n num += 1 if @options.attach\n num += 1 if @options.detach\n return false if num > 1\n return true\n end", "def args?(args, min=1, max=nil)\n\t\t\tif not max then max = min end\n\t\t\tif (args.length < min or args.length > max or args[0] == \"-h\")\n\t\t\t\treturn false\n\t\t\tend\n\n\t\t\treturn true\n\t\tend", "def arguments_valid?\n valid_args = true\n valid_args = false if @options.min > @options.max\n valid_args = false if @options.user && [email protected]\n valid_args = false if @options.password && [email protected]\n valid_args\n end", "def test_check_args_valid\n args = CheckArgs.new\n assert_equal true, args.check_args([-5, 2, 3])\n end", "def test_check_num_args_valid\n args = CheckNumArgs.new\n assert_equal true, args.check_args([1,1,1])\n end", "def errorCheck()\n\t# Debug output\n\tif $DEBUG then STDERR.puts \"in errorCheck()\" end\n\n\t# no args -> quit\n\tif ARGV.length == 0\n\t\tputs \"incorrect argument(s). usage: 'ruby name2number.rb <name1> <name2> <name3>..\"\n\t\texit\n\tend\n\n\t# special characters / numbers -> quit\n\tARGV.each do |arg|\n\t\tif arg !~ /^[a-zA-Z]+$/ then\n\t\t\tputs \"non-alphabetical character(s) detected. usage: 'ruby name2number.rb <name1> <name2> <name3>..\"\n\t\t\texit\n\t\tend \n\tend\nend", "def test_zero\n args = Arguments.new\n assert_equal false, args.check_args(0)\n end", "def arguments_valid?\n true if @arguments.length == argv_length \n end", "def test_three_ints\n args = Arguments.new\n assert_equal true, args.check_args([1, 2, 3])\n end", "def valid_args?(args={})\n valid = false\n arguments.each do |name, argument|\n if argument[:required]\n return false if args[name] == nil\n end\n valid = argument.valid_input?(args[name])\n end\n return valid\n end", "def check_arg_structure(args)\n valid = true\n valid &&= args.class == Array\n \n args.each do |a|\n valid &&= a.class == Array \n valid &&= a.size == 2\n a.each do |s|\n valid &&= s.class == String\n end\n end\n\n raise \"Imported function arguments in invalid form\" unless valid\n end", "def check_arg_structure(args)\n valid = true\n valid &&= args.class == Array\n \n args.each do |a|\n valid &&= a.class == Array \n valid &&= a.size == 2\n a.each do |s|\n valid &&= s.class == String\n end\n end\n\n raise \"Imported function arguments in invalid form\" unless valid\n end", "def test_zero\r\n args = Args.new\r\n assert_equal false, args.check_args(0)\r\n end", "def validate_args (args)\n\t# todo\nend", "def test_negative\r\n args = Args.new\r\n assert_equal false, args.check_args(\"hello\")\r\n end", "def arguments_valid?\n true if @arguments.size >= 1 \n end", "def test_neg_prospectors\n\t\trefute check_args([1, -1])\n\tend", "def validate_arguments\n if([email protected] || !@@sections.include?(@options.parse))\n @log.error \"select one of the following to parse: #{@@sections.join(\"|\")}\"\n exit!\n end\n \n if([email protected] && [email protected])\n @log.error \"Select either to download the file remotely or supply the given file\"\n exit!\n end\n \n if([email protected])\n @log.error \"supply an output directory with -o\"\n exit!\n end\n \n return true\n end", "def test_two_valid_arguments\n\t\tc = Check.new\n\t\trefute c.check_arguments([1,1])\n\tend", "def valid_arguments?\n begin\n if(@options.file)\n raise LoadError,\"The file you specified doesn't exist: #{@options.file}\" if File.exist?(@options.file) == false\n else\n @log.error \"Select a file using -f or --file FILE\"\n end\n \n if(@options.output)\n # not going to worry about this one.\n else\n @log.error \"No output was specified select using -o or --output\"\n end\n rescue LoadError => bam\n @log.error bam\n exit\n end\n \n return true\n end", "def valid_arguments?\n begin\n if(@options.file)\n raise LoadError,\"The file you specified doesn't exist: #{@options.file}\" if File.exist?(@options.file) == false\n else\n @log.error \"Select a file using -f or --file FILE\"\n end\n \n if(@options.output)\n # not going to worry about this one.\n else\n @log.error \"No output was specified select using -o or --output\"\n end\n rescue LoadError => bam\n @log.error bam\n exit\n end\n \n return true\n end", "def valid_arguments?\n begin\n if(@options.file)\n raise LoadError,\"The file you specified doesn't exist: #{@options.file}\" if File.exist?(@options.file) == false\n else\n @log.error \"Select a file using -f or --file FILE\"\n end\n \n if(@options.output)\n # not going to worry about this one.\n else\n @log.error \"No output was specified select using -o or --output\"\n end\n rescue LoadError => bam\n @log.error bam\n exit\n end\n \n return true\n end", "def method (*args)\n\t\tif args.length > 2\n\t\t\tputs \"More than two\"\n\t\tend\n\tend", "def test_two_proper_args\n assert check_args([1, 1])\n end", "def test_args_check_less\n\t\targs_checker = ArgsChecker::new\n\t\tarr = []\n\t\tassert_raises(\"I need one number bud, try again\") { args_checker.check_args arr }\n\tend", "def numerical_arg_size?\n !has_splat_args? && arg_size\n end", "def valid_arguments?\n begin\n if(@options.file)\n raise LoadError,\"The file you specified doesn't exist: #{@options.file}\" if File.exist?(@options.file) == false\n else\n @log.error \"Select a file using -f or --file FILE\"\n exit!\n end\n \n if(@options.output)\n # not going to worry about this one.\n else\n @log.error \"No output was specified select using -o or --output\"\n exit!\n end\n rescue LoadError => bam\n @log.error bam\n exit!\n end\n \n return true\n end", "def test_arg_check_length_fail\n def exit(x); 1; end;\n ret = arg_check_length 2\n assert_equal ret, -1\n end", "def arguments_valid?\n # Should be no remaining arguments\n true if @arguments.length == 0\n end", "def valid?(setup)\n setup.args.length >= required_args && (max_args == -1 || setup.args.length <= max_args)\n end", "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 arguments_valid?\n ret = false\n ret = true unless (@options.action == nil)\n end", "def arg_check(args, types = nil, server = nil)\n return args unless types\n\n args.each_with_index.map do |arg, i|\n next arg if types[i].nil? || types[i] == String\n\n if types[i] == Integer\n begin\n Integer(arg, 10)\n rescue ArgumentError\n nil\n end\n elsif types[i] == Float\n begin\n Float(arg)\n rescue ArgumentError\n nil\n end\n elsif types[i] == Time\n begin\n Time.parse arg\n rescue ArgumentError\n nil\n end\n elsif types[i] == TrueClass || types[i] == FalseClass\n if arg.casecmp('true').zero? || arg.downcase.start_with?('y')\n true\n elsif arg.casecmp('false').zero? || arg.downcase.start_with?('n')\n false\n end\n elsif types[i] == Symbol\n arg.to_sym\n elsif types[i] == Encoding\n begin\n Encoding.find arg\n rescue ArgumentError\n nil\n end\n elsif types[i] == Regexp\n begin\n Regexp.new arg\n rescue ArgumentError\n nil\n end\n elsif types[i] == Rational\n begin\n Rational(arg)\n rescue ArgumentError\n nil\n end\n elsif types[i] == Range\n begin\n if arg.include? '...'\n Range.new(*arg.split('...').map(&:to_i), true)\n elsif arg.include? '..'\n Range.new(*arg.split('..').map(&:to_i))\n end\n rescue ArgumentError\n nil\n end\n elsif types[i] == NilClass\n nil\n elsif [Discordrb::User, Discordrb::Role, Discordrb::Emoji].include? types[i]\n result = parse_mention arg, server\n result if result.instance_of? types[i]\n elsif types[i] == Discordrb::Invite\n resolve_invite_code arg\n elsif types[i].respond_to?(:from_argument)\n begin\n types[i].from_argument arg\n rescue StandardError\n nil\n end\n else\n raise ArgumentError, \"#{types[i]} doesn't implement from_argument\"\n end\n end\n end", "def argument_size? \n if @cmd[:arguments].size != @instruction.args_number\n Error::message( 5, \n @line, \n @cmd[:name], \n @cmd[:arguments].size, \n @instruction.args_number )\n end\n end", "def test_arg_check_turns_valid\n ret = arg_check_turns '1'\n assert_equal ret, 0\n end", "def check_arguments\n convert_boolean_strings\n check_output\n check_log_level\n check_input_entry\n check_input_types\n end", "def arguments_valid?\n true \n # to do\n end", "def check_no_extra_args!\n if @argv.length > 0\n Braid::Command.handle_error(\n Braid::BraidError.new('Extra argument(s) passed to command.'))\n end\n end", "def arguments_valid?\n # right now, there is no set of invalid arguments.\n # (can I really just say true here? I don't have to return something?)\n true unless (@options.set_status == true and @options.status == nil)\n end", "def arguments_valid?\n true if ['install','list','uninstall'].include?(@arguments[0])\n end", "def validate_args_count(expected, got)\n if (expected.is_a?(Numeric) and expected != got) or\n (expected.is_a?(Range) and !(expected === got))\n raise ArgumentError, \"wrong number of arguments for '#{name}' (#{got} for #{expected})\"\n end\n end", "def test_negative_argument\n\t\tc = Check.new\n\t\trefute c.check_arguments([1,1,-2])\n\tend", "def arguments_valid?\n true if @arguments.length == 4\n end", "def arguments_valid?\n # check the parameters have values\n return false unless @options.has_key?(:hcdFile)\n return false unless @options.has_key?(:etdFile) \n return false if @options[:mzArray].empty?\n return false unless (@options[:mzTolerance] > 0.0 || @options[:ppmTolerance] > 0.0 )\n # check the file exists\n return false unless File.file?(@options[:hcdFile])\n return false unless File.file?(@options[:etdFile])\n true\n end", "def test_args_check_greater\n\t\targs_checker = ArgsChecker::new\n\t\tarr = [2, 4]\n\t\tassert_raises(\"I need one number bud, try again\") { args_checker.check_args arr }\n\tend", "def arg_check_length(arg_l)\n if arg_l < 3\n puts 'Usage:\\n'\n puts 'ruby ruby_rush.rb <seed> <num_prospectors> <num_turns>\\n'\n puts '<seed> should be an integer\\n'\n puts '<num_prospectors> should be a non-negative integer\\n'\n puts '<num_turns> should be a non-negative integer\\n\\n'\n exit(1)\n return -1\n end\n 0\nend", "def arguments_valid?\n \n # true if @arguments.length == 1 && (File.directory?(@options.output) || File.exists?(File.dirname(@options.output))) && File.directory?(@options.input)\n case @options.mode\n when \"queue\"\n true if File.directory?(@options.output)\n when \"crawl\"\n true if File.directory?(@options.output) && File.directory?(@options.input?)\n else\n true if @arguments.length == 1\n end\n end", "def validate_arguments(args={})\n return if args.count == 1 && args.key?(:all)\n\n only_options = args[:only] || Set.new\n except_options = args[:except] || Set.new\n skip_options = args[:skip] || Set.new\n\n unless (only_options & except_options).empty? &&\n (only_options & skip_options).empty?\n\n raise IncorrectArgumentException.new(\n nil,\n <<-TXT\n The same arguments shouldn't be used\n with different keys excluding except and skip\n TXT\n )\n end\n\n if args[:skip] == 'all' && args.count > 1\n raise IncorrectArgumentException.new(\n nil,\n <<-TXT\n Option 'skip' with argument 'all' shouldn't be used\n with another options\n TXT\n )\n end\n end", "def arguments_valid?\n true \n end", "def check_arguments\n if (@ec2_user_id.nil? || @aws_access_key_id.nil? || @aws_secret_access_key.nil? || @host_role.nil? || ! ( @do_snapshot || @do_restore )) then\n raise ArgumentError, \"Missing command line parameter\"\n end\n end", "def recognizes?(args)\n false\n end", "def check_arguments(exp_num, args, cond=nil)\n cond = Proc.new{|n| !n.nil?} if cond.nil?\n return exp_num == args.select{|n| cond.call(n)}.size\n end", "def any_args?\n @any_args\n end", "def any_args?\n @any_args\n end", "def first_validate_arg(arg)\n if(arg.length != length)\n puts \"The length of the string is not correct. Your input length is #{arg.length} but the length needs to be #{length}\"\n self.valid = false\n return false\n else\n arg.split(\"\").each do |i|\n if(i != '0' && i !='1')\n puts \"The input argument contain(s) characters other than 0 and 1. Please correct!\"\n self.valid = false\n return false\n end\n end\n end\n return true\n end", "def test_check_num_args_string2\n args = CheckNumArgs.new\n assert_equal false, args.check_args(['HELLO', 'THERE'])\n end", "def params_check(*args) \n if args.length == 1\n if args[0].class == Array\n if params[args[0][0]][args[0][1]] && !params[args[0][0]][args[0][1]].empty?\n true\n end\n else \n if params[args[0]] && !params[args[0]].empty?\n true\n end\n end\n elsif args.length == 2\n if args[0].class == Array\n if params[args[0][0]][args[0][1]] && params[args[0][0]][args[0][1]] == args[1]\n true\n end\n else\n if params[args[0]] && params[args[0]] == args[1]\n true\n end\n end \n end\n end", "def isNumber _args\n \"isNumber _args;\" \n end", "def arguments_valid?\n true\n end", "def validate_arguments()\n usage unless ARGV.count > 0\nend", "def includes_arguments?\n !default_data.empty? || !flags.empty? ||\n !required_args.empty? || !optional_args.empty? ||\n !remaining_arg.nil? || flags_before_args_enforced?\n end", "def params_check(*args)\n if args.length == 1\n if args[0].class == Array\n if params[args[0][0]][args[0][1]] && !params[args[0][0]][args[0][1]].nil?\n true\n end\n else \n if params[args[0]] && !params[args[0]].nil?\n true\n end\n end\n elsif args.length == 2\n if args[0].class == Array\n if params[args[0][0]][args[0][1]] && params[args[0][0]][args[0][1]] == args[1]\n true\n end\n else\n if params[args[0]] && params[args[0]] == args[1]\n true\n end\n end \n end\n end", "def test_missing_argument_invalid_argument\n\t\tc = Check.new\n\t\trefute c.check_arguments([1,1,'s'])\n\tend", "def test_check_num_args_string3\n args = CheckNumArgs.new\n assert_equal false, args.check_args(['HELLO', 'THERE', 'KENOBI'])\n end", "def test_arg_check_prospectors_valid\n ret = arg_check_prospectors '1'\n assert_equal ret, 0\n end" ]
[ "0.8418269", "0.7506146", "0.7396315", "0.73773485", "0.71942866", "0.7113682", "0.7085484", "0.69793206", "0.6940506", "0.69321555", "0.6847524", "0.68365204", "0.68036664", "0.6797044", "0.6788786", "0.67845666", "0.67836887", "0.6717154", "0.67052054", "0.6696459", "0.66901696", "0.6651697", "0.6625504", "0.6624887", "0.6614157", "0.65805066", "0.65744126", "0.6561314", "0.65586174", "0.6553223", "0.65355194", "0.651765", "0.6471931", "0.6432896", "0.643055", "0.6422601", "0.6416489", "0.6405741", "0.64044666", "0.63922113", "0.6374928", "0.63598603", "0.6347686", "0.6345595", "0.63324994", "0.6318351", "0.6318351", "0.6318234", "0.63105184", "0.6291397", "0.62812984", "0.62675875", "0.6258008", "0.62559247", "0.62357897", "0.62357897", "0.62357897", "0.62297064", "0.62194127", "0.6201596", "0.6171305", "0.6160422", "0.61603093", "0.6159059", "0.61427027", "0.612984", "0.611985", "0.6117176", "0.6113448", "0.61097926", "0.6102313", "0.6088979", "0.60749143", "0.60588646", "0.6048936", "0.6038685", "0.6033597", "0.6017968", "0.6013938", "0.60120994", "0.6010472", "0.60066855", "0.599223", "0.5976747", "0.59751344", "0.5972581", "0.59630257", "0.5953941", "0.5953941", "0.5953421", "0.5940785", "0.59388274", "0.5934409", "0.59336805", "0.5933331", "0.5925959", "0.59253985", "0.59182096", "0.5876437", "0.5869452" ]
0.8140739
1
:nodoc: Load the makefile dependencies in +fn+.
def load(fn) # :nodoc: lines = File.read fn lines.gsub!(/\\ /, SPACE_MARK) lines.gsub!(/#[^\n]*\n/m, "") lines.gsub!(/\\\n/, " ") lines.each_line do |line| process_line(line) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_dependencies( file_list, force_require=true )\r\n loader = DependencyLoader.new( file_list, force_require )\r\n loader.load_dependencies\r\nend", "def add_elm_dependencies(filepath, context)\n # Turn e.g. ~/NoRedInk/app/assets/javascripts/Quiz/QuestionStoreAPI.js.elm\n # into just ~/NoRedInk/app/assets/javascripts/\n dirname = context.pathname.to_s.gsub Regexp.new(context.logical_path + \".+$\"), \"\"\n\n File.read(filepath).each_line do |line|\n # e.g. `import Quiz.QuestionStore exposing (..)`\n match = line.match(/^import\\s+([^\\s]+)/)\n\n unless match.nil?\n # e.g. Quiz.QuestionStore\n module_name = match.captures[0]\n\n # e.g. Quiz/QuestionStore\n dependency_logical_name = module_name.gsub(\".\", \"/\")\n\n # e.g. ~/NoRedInk/app/assets/javascripts/Quiz/QuestionStore.elm\n dependency_filepath = dirname + dependency_logical_name + \".elm\"\n\n # If we don't find the dependency in our filesystem, assume it's because\n # it comes in through a third-party package rather than our sources.\n if File.file? dependency_filepath\n context.depend_on dependency_logical_name\n\n add_elm_dependencies dependency_filepath, context\n end\n end\n end\n end", "def add_elm_dependencies(filename, load_path, context)\n File.read(filename).each_line.flat_map do |line|\n # e.g. `import Quiz.QuestionStore exposing (..)`\n match = line.match(/^import\\s+([^\\s]+)/)\n\n next [] if match.nil?\n\n # e.g. Quiz.QuestionStore\n module_name = match.captures[0]\n\n # e.g. Quiz/QuestionStore\n dependency_logical_name = module_name.gsub(\".\", \"/\")\n\n # e.g. ~/NoRedInk/app/assets/javascripts/Quiz/QuestionStore.elm\n dependency_filepath = load_path + \"/\" + dependency_logical_name + \".elm\"\n\n # If we don't find the dependency in our filesystem, assume it's because\n # it comes in through a third-party package rather than our sources.\n if File.file? dependency_filepath\n context.depend_on(dependency_logical_name)\n end\n end\n end", "def load_dependencies\n dependencies.each { |dependency| dependency }\n end", "def define \n desc @description\n task @name => Array(deps) do\n unless Dir.exist?(@outdir)\n Dir.mkdir(@outdir)\n end\n make_file_list\n @file_list.each do |target|\n js = target.execute\n target_file = File.join(@outdir,File.basename(target.file))\n File.open(target_file, 'w') { |f| f.write(js) }\n end\n end\n\n self\n end", "def map_dependencies\n dependencies = {}\n Dir.glob(\"jquery-ui/ui/**/*.js\").each do |path|\n basename = File.basename path\n file = File.read path\n\n matchdata = file.match(/define\\(\\s*\\[\\s*([\\\"\\.\\/\\,\\w\\s\\-\\:]+)\\]/m)\n\n next if matchdata.nil?\n\n deps = matchdata[1]\n\n # remove lines with comments\n deps = deps.gsub(/\\/\\/.+\\s/, \"\")\n\n # remove all non-path symbols\n deps = deps.gsub(/[\\r\\n\\t\\\"\\[\\]\\s]/, \"\")\n\n deps_paths = deps.split(',')\n\n deps_paths.map!(&method(:remove_js_extension))\n\n # None of jquery.ui files should depend on jquery.js,\n # so we remove 'jquery' from the list of dependencies for all files\n deps_paths.reject! {|d| d == \"jquery\" }\n\n deps_paths.map! {|d| source_file_for_dependency_entry path, d }\n\n dependencies[basename] = deps_paths\n end\n dependencies\nend", "def enable_dependency_loading=(_arg0); end", "def enable_dependency_loading=(_arg0); end", "def load_dependencies\n require 'f5-icontrol'\n end", "def load_dependencies(options = {})\n load_config(options)\n Merb::BootLoader::BuildFramework.run\n Merb::BootLoader::Dependencies.run\n Merb::BootLoader::BeforeAppRuns.run\n end", "def initialize(libFileName, build, config)\n @libFileName = Makr.cleanPathName(libFileName)\n @libName = File.basename(@libFileName)\n super(StaticLibTask.makeName(@libFileName), config)\n @build = build\n\n # first we need a dependency on the target\n @libTargetDep = @build.getOrMakeNewTask(@libFileName) {FileTask.new(@libFileName, false)}\n addDependencyUnique(@libTargetDep)\n @targets = [@libFileName]\n\n # now add another dependency task on the config\n @configDep = @build.getOrMakeNewTask(ConfigTask.makeName(@name)) {ConfigTask.new(ConfigTask.makeName(@name))}\n addDependencyUnique(@configDep)\n\n Makr.log.debug(\"made StaticLibTask with @name=\\\"\" + @name + \"\\\"\")\n end", "def inject_dependencies(event = :before_load)\n return if @dependencies_injected\n @dependencies_injected = true\n \n unless load_paths.empty?\n add_to_load_path(event)\n add_to_dependency_load_paths(event)\n end\n end", "def load_dependencies(options = {})\n load_config(options)\n Merb::BootLoader::BuildFramework.run\n Merb::BootLoader::Dependencies.run\n Merb::BootLoader::BeforeAppLoads.run\n end", "def load_imports\n while fn = @pending_imports.shift\n next if @imported.member?(fn)\n if fn_task = lookup(fn)\n fn_task.invoke\n end\n load!(fn)\n @imported << fn\n end\n end", "def initialize(libFileName, build, config = nil)\n @libFileName = Makr.cleanPathName(libFileName)\n @libName = File.basename(@libFileName)\n super(DynamicLibTask.makeName(@libFileName), config)\n @build = build\n\n # we need a dep on the lib target\n @libTargetDep = @build.getOrMakeNewTask(@libFileName) {FileTask.new(@libFileName, false)}\n addDependencyUnique(@libTargetDep)\n @targets = [@libFileName]\n\n # now add another dependency task on the config\n @configDep = @build.getOrMakeNewTask(ConfigTask.makeName(@name)) {ConfigTask.new(ConfigTask.makeName(@name))}\n addDependencyUnique(@configDep)\n\n Makr.log.debug(\"made DynamicLibTask with @name=\\\"\" + @name + \"\\\"\")\n end", "def enable_dependency_loading; end", "def enable_dependency_loading; end", "def load\n\t\tsource = self.depfile.read\n\t\tself.instance_eval( source, self.depfile.to_s, 1 )\n\tend", "def call(filename = \"dependencies.yml\")\n dependencies = Set.new\n $/=\"\\n\\n\"\n File.open(filename, \"r\").each do |object|\n begin\n dependencies << Dependency.deserialize(object)\n rescue\n raise $!, \"Could not load object from #{filename}\", $!.backtrace\n end\n end\n dependencies\n end", "def require_dependencies\n deps_file = (RUBYCOCOA_ROOT + 'config/dependencies.rb').to_s\n Rucola::Dependencies.load(deps_file).require!\n end", "def load_tasks(tasks)\n load File.join(File.dirname(__FILE__), 'tasks', \"#{tasks}.rb\")\nend", "def buildDependencies()\n clearDependencies()\n\n # first we add the constructed dependencies as we simply cleared *all* deps before\n addDependencyUnique(@compileFileDep) if not @fileIsGenerated\n addDependencyUnique(@compileTargetDep)\n addDependencyUnique(@configTaskDep)\n addDependencyUnique(@generatorTaskDep) if @fileIsGenerated\n\n return if not @dependencyLines # only go on if we have compiler generated deps\n\n dependencyFiles = Array.new\n @dependencyLines.each do |depLine|\n depLine.strip! # remove white space and newlines\n # remove backslash on each line, if present (GCC output is guaranteed to produce only a single backslash at line end)\n if depLine.include?('\\\\') then\n depLine.chop!\n end\n if depLine.include?(':') # the \"xyz.o\"-target specified by the compiler in the \"Makefile\"-rule needs to be skipped\n splitArr = depLine.split(\": \")\n dependencyFiles.concat(splitArr[1].split(\" \")) if splitArr[1]\n else\n dependencyFiles.concat(depLine.split(\" \"))\n end\n end\n dependencyFiles.each do |depFile|\n depFile.strip!\n next if depFile.empty?\n depFile = Makr.cleanPathName(depFile)\n next if (depFile == @fileName) # go on if dependency on source file encountered\n if @build.hasTask?(depFile) then\n task = @build.getTask(depFile)\n if not @dependencies.include?(task)\n addDependencyUnique(task)\n end\n elsif (task = @build.getTaskForTarget(depFile)) then\n if not @dependencies.include?(task)\n addDependencyUnique(task)\n end\n else\n task = FileTask.new(depFile)\n @build.addTask(depFile, task)\n addDependencyUnique(task)\n end\n task.update()\n end\n\n end", "def depends_on(mod)\n @log.info \"Loading module '#{mod}' as a dependency\"\n loaded = require \"#{File.dirname(__FILE__)}/modules/#{mod.to_s}.rb\"\n @log.info \"Module '#{mod}' already loaded, not re-loading\" if !loaded\nend", "def load(fn)\n return if ! File.exists?(fn)\n lines = File.read fn\n lines.gsub!(/\\\\ /, SPACE_MARK)\n lines.gsub!(/#[^\\n]*\\n/m, \"\")\n lines.gsub!(/\\\\\\n/, ' ')\n lines.each_line do |line|\n process_line(line)\n end\n end", "def initialize file\r\n @file = file\r\n @new_depends = {}\r\n @source_files = []\r\n @flat_depends = {}\r\n\r\n if File.exist? @file\r\n load_depends @file\r\n end\r\n\r\n # If the clean target is defined add the dependancy file\r\n # to it.\r\n if defined? CLEAN && CLEAN.is_a(Rake::FileList)\r\n CLEAN.add @file\r\n end\r\n\r\n # Save the dependancies at exit if they have changed\r\n # since last invocation.\r\n at_exit do\r\n if has_changes?\r\n write_depends\r\n end\r\n end\r\n end", "def define_tasks\r\n define_clobber_task\r\n define_build_task\r\n end", "def plugin_require(filename)\n Kernel.require(File.join(@dir,filename))\n end", "def initialize(params)\n\t\tsuper\n\t\tbasename = requireParam(params, :name)\n\t\tmodpaths = requireParam(params, :modules)\n\t\t\n\t\tmodpaths.each {|path| addPrereq BuildEnv::src2build(System::mod2obj(path))}\n\t\taddTarget BuildEnv::src2build(System::mod2slib(basename))\n\t\t\t\n\t\t#symlink from the src tree to the build tree (even if our target is up-to-date, in case the symlink currently points to a file built with \n\t\t# different options, ie elsewhere in the build tree)\n\t\tSymlinkBuilder.new(:target => target(), :name => BuildEnv::build2src(target()))\n\t\t\n\t\t#flags for tasks that edit their own prereq lists before reinvoking themselves\n\t\t@cleanallRecurse = true #true before cleanall() is called from outside; false when it's called by itself\n\tend", "def direct_dependencies; end", "def dependencies; end", "def dependencies; end", "def dependencies; end", "def load_dependencies\r\n @local_gems.each do |gem_info|\r\n gem_file_name = gem_info.gem_file\r\n gem_name = installed_as_name_for( short_form_of_gem_name( gem_file_name ) )\r\n @required_gem_names.delete gem_file_name\r\n end\r\n @required_gem_paths.each do |gem_path|\r\n gem_short_name = short_form_of_gem_name gem_path\r\n if @required_gem_names.include? gem_short_name\r\n puts \"installing #{gem_path}\"\r\n installer = @force_require ? PreloadingInstaller.new( gem_path, @local_gems ) : Installer.new( gem_path )\r\n installer.install\r\n end\r\n end\r\n end", "def grow_dependencies nunjucks_file\n nunjucks = File.read nunjucks_file\n liquid_dependencies = nunjucks.scan(INCLUDE_TAG).flatten.map &method(:nunjucks_to_liquid)\n [TRANSPILER_MODULES_DIR, nunjucks_file].concat liquid_dependencies\n end", "def autoload_paths=(_arg0); end", "def load!\n contents = File.read(filepath).strip\n hash = parse(contents)\n\n hash[:dependencies].each do |name, options|\n # Dynamically calculate paths relative to the Berksfile if a path is given\n options[:path] &&= File.expand_path(options[:path], File.dirname(filepath))\n\n begin\n add(Berkshelf::Dependency.new(berksfile, name.to_s, options))\n rescue Berkshelf::CookbookNotFound\n # It's possible that a source is locked that contains a path location, and\n # that path location was renamed or no longer exists. When loading the\n # lockfile, Berkshelf will throw an error if it can't find a cookbook that\n # previously existed at a path location.\n end\n end\n end", "def load(filename)\n @filename = filename.to_s\n mode = :in_header\n IO.readlines(@filename).each do |line|\n case mode\n when :in_header\n if line =~ %r{^\\s*gem\\.}\n mode = :in_dev_body\n case line\n when %r{^\\s*gem\\.add_development_dependency}\n @dev_dependencies << line\n when %r{^\\s*gem\\.add_dependency}\n @gem_dependencies << line\n else\n @body << line\n end\n else\n @header << line\n end\n when :in_dev_body\n if line =~ %r{^\\s*end}\n mode = :in_footer\n @footer << line\n else\n case line\n when %r{^\\s*gem\\.add_development_dependency}\n @dev_dependencies << line\n when %r{^\\s*gem\\.add_dependency}\n @gem_dependencies << line\n else\n @body << line\n end\n end\n when :in_footer\n @footer << line\n end\n end\n end", "def build(rakeTask)\n\t\tfilePrereqs = filePrereqs() #remove internal build-system stuff\n\t\tunless FileUtils.uptodate?(target(), filePrereqs) #the check rake does always fails because it includes a non-file prereq task\n\t\t\tstaticLibMaintainer().addOrUpdate(:lib => target(), :objs => filePrereqs)\n\t\t\tstaticLibMaintainer().index(target())\n\t\tend\n\tend", "def library_load_start(file_count)\n puts 'compiling cookbooks'\n end", "def dependencies(source, done=[])\n d_path = source.ext(\"d\") # get the dependency file\n Rake::Task[d_path].invoke # ensure the dependency file exists\n d_file = IO.read(d_path) # read the dependencies from dependency file\n d_file = d_file.split(': ')[1].gsub(\"\\n\",'').gsub('\\\\ ','').gsub(/\\s+/,' ').split(' ') # get a list of dependencies\n d_list = [] # list of dependencies\n # only save dependencies which are in our source directories\n d_file.each do |d|\n SRC_DIRS.each do |dir|\n if File.dirname(d)==dir then\n d_list << d\n end\n end\n end\n # get the dependencies of these dependencies, if we don't know them already\n done << source.ext(\"o\")\n done.uniq!\n d_list.each do |d|\n d = d.ext(\"o\")\n next if done.include? d\n done += dependencies(d, done)\n end\n done.uniq!\n return done\nend", "def add_dep file, deps\r\n @flat_depends[file] = deps\r\n end", "def dependency(lib = nil)\n lib ? require(lib) : yield\n rescue LoadError, NameError => e\n self.load_error = e\n end", "def initialize(params)\n\t\tsuper\n\t\tmainmod = Pathname.new(requireParam(params, :mainmod))\n\t\tbasename = Pathname.new(params[:name] || mainmod.basename())\n\t\t\n\t\tprereqFile = BuildEnv::src2build(System::mod2obj(mainmod))\n\t\taddPrereq prereqFile\n\t\taddTarget BuildEnv::src2build(basename)\n\t\t\n\t\t#symlink from the src tree to the build tree (even if our target is up-to-date, in case the symlink currently points to a file built with \n\t\t# different options, ie elsewhere in the build tree)\n\t\tSymlinkBuilder.new(:target => target(), :name => BuildEnv::build2src(target()))\n\t\t\n\t\t#flags for tasks that edit their own prereq lists before reinvoking themselves\n\t\t@cleanallRecurse = true #true before cleanall() is called from outside; false when it's called by itself\n\tend", "def define_maven_package_task\n [ MVN_STATE_FILE, MVN_STATE_FILE_INSTALL ].each do |sf|\n file sf => maven_dependencies do\n run_maven\n end\n end\n\n task :install => MVN_STATE_FILE_INSTALL\n end", "def load_required\n Dir[\"#{folder}/**/*.rb\"].each{|m|load m}\n end", "def load_libs; end", "def before(*args)\n require_libs\n require_ing_file\n end", "def require( library_name )\n\tbegin\n\t\tMockFS.mock = false\n\t\tsuper\n\t\tMockFS.mock = true\n\trescue LoadError => err\n\t\tMockFS.mock = true\n\t\tfile = library_name\n\t\tfile += '.rb' unless library_name =~ /\\.rb$/\n\t\tif File.exist? file\n\t\t\tcontents = File.open( file ) do |f| f.gets( nil ); end\n\t\t\teval contents\n\t\telse\n\t\t\traise\n\t\tend\n\tend\nend", "def load_task_libraries\n\t\ttaskdir = Pathname( __FILE__.delete_suffix('.rb') )\n\t\ttasklibs = Rake::FileList[ taskdir + '*.rb' ].pathmap( '%-2d/%n' )\n\n\t\tself.trace( \"Loading task libs: %p\" % [ tasklibs ] )\n\t\ttasklibs.each do |lib|\n\t\t\trequire( lib )\n\t\tend\n\n\t\tself.class.constants.\n\t\t\tmap {|c| self.class.const_get(c) }.\n\t\t\tselect {|c| c.respond_to?(:instance_methods) }.\n\t\t\tselect {|c| c.instance_methods(false).include?(:define_tasks) }.\n\t\t\teach do |mod|\n\t\t\t\tself.trace \"Loading tasks from %p\" % [ mod ]\n\t\t\t\textend( mod )\n\t\t\tend\n\n\t\tself.setup( self.name, **self.options )\n\tend", "def add_to_dependency_load_paths #:nodoc:\n Dependencies.load_paths.concat(load_paths)\n end", "def command_rel(elts)\n\n load(__FILE__)\n end", "def build_remote_dependencies\n modules_json_path = \"#{@mod.cache_dir}/.terraform/modules/modules.json\"\n return unless File.exist?(modules_json_path)\n\n initialized_modules = JSON.load(IO.read(modules_json_path))\n # For example of structure see spec/fixtures/initialized/modules.json\n initialized_modules[\"Modules\"].each do |meta|\n build_remote_mod(meta)\n end\n end", "def load!(filename=nil, buildfile_names=nil)\n\n # If a directory is passed, look for any buildfile and load them...\n if File.directory?(filename)\n\n # search directory for buildfiles and load them.\n buildfile_names ||= (SC.env[:buildfile_names] || BUILDFILE_NAMES)\n buildfile_names.each do |path|\n path = File.join(filename, path)\n next unless File.exist?(path) && !File.directory?(path)\n load!(path)\n end\n\n elsif File.exist?(filename)\n old_path = @current_path\n @current_path = filename\n loaded_paths << filename # save loaded paths\n SC.logger.debug \"Loading buildfile at #{filename}\"\n define!(File.read(filename), filename) if filename && File.exist?(filename)\n @current_path = old_path\n end\n return self\n end", "def lookup!\n $LOAD_PATH.each do |base|\n Dir[File.join(base, *file_lookup_paths)].each do |path|\n path = path.delete_prefix(\"#{base}/\")\n require path\n rescue Exception\n # No problem\n end\n end\n end", "def load_files(*sources); end", "def calcdeps(ns, namespace, filenames, prev = [])\n unless source = ns[namespace]\n msg = \"#{prev.last[:filename]}: \" rescue ''\n msg += \"Namespace #{namespace.dump} not found.\"\n raise msg\n end\n if prev.include? source\n return\n else\n prev.push source\n end\n return if filenames.include?(source[:filename])\n source[:require].each do |required|\n calcdeps ns, required, filenames, prev\n end\n filenames.push source[:filename]\n end", "def define_tasks\r\n define_repeat_task\r\n define_clobber_task\r\n define_build_task\r\n end", "def depends_on(*args)\n @depends_on ||= DSL::DependsOn.new\n return @depends_on if args.empty?\n\n begin\n @depends_on.load(*args)\n rescue RuntimeError => e\n raise CaskInvalidError.new(cask, e)\n end\n @depends_on\n end", "def dependencies=(_arg0); end", "def load_dependencies\n result = zh_client.dependencies(repo_name)\n\n result[\"dependencies\"].each do |hash|\n blocking = add_or_find(hash[\"blocking\"])\n blocked = add_or_find(hash[\"blocked\"])\n\n add_edge(blocked, blocking)\n end\n end", "def pre_soft_load(mod); end", "def add_to_dependency_load_paths(event) #:nodoc:\n if index = Dependencies.load_paths.index(lib_path)\n Dependencies.load_paths.insert(index, *load_paths)\n elsif event == :after_initialize\n plugins_before_paths = plugins_before.map(&:root)\n plugin_before_load_paths = Dependencies.load_paths.find_all {|path| plugins_before_paths.detect {|plugin_path| path.include?(plugin_path)}}\n index = (Dependencies.load_paths.index(plugin_before_load_paths.last) || -1) + 1\n \n Dependencies.load_paths.insert(index, *load_paths)\n else\n Dependencies.load_paths.concat(load_paths)\n end\n end", "def autoloader; end", "def require(name)\n Kernel.require name\nend", "def autoloaders; end", "def add_import(fn)\n @pending_imports << fn\n end", "def add_import(fn)\n @pending_imports << fn\n end", "def load_libs\n loadQueue = []\n Pathname.glob './lib/*.rb' do |script|\n require script.to_s\n scriptfolder = Pathname.new(script.to_s.gsub('.rb', ''))\n next if not scriptfolder.directory?\n\n loadQueue += scriptfolder.children(true).find_all {|file| file.to_s[-3..-1] == '.rb'}\n end\n \n # load the children\n loadQueue.each {|file| require file.to_s }\n end", "def define\n fail \"Name required (or :noversion)\" if @name.nil?\n @name = nil if :noname == @name\n\n desc \"Build all the packages\"\n task :compile => :pack do\n [images_dir, css_dir].each { |dir| mkdir_p(\"#{package_dir_path}/#{dir}\") }\n FileUtils.cp(image_files, package_images_path)\n FileUtils.cp(css_files, package_css_path)\n FileUtils.cp(package_files, package_dir_path)\n end\n \n desc \"Force a rebuild of the package files\"\n task :recompile => [:clobber_compile, :compile]\n \n desc \"Remove compile products\" \n task :clobber_compile do\n FileUtils.rm_r(package_dir_path) rescue nil\n end\n \n desc \"Merge js files into one\"\n task :merge do\n FileUtils.mkdir(package_dir_path) rescue nil\n `#{sed_command}`\n end\n \n desc \"Compress js files to min\"\n task :pack => :merge do\n `#{packer_command}`\n end\n\n task :clobber => [:clobber_compile]\n\n self\n end", "def process_project_dependencies\n recipes.each do |rec_obj|\n rec_obj.process_project_dependencies\n end\n end", "def load!\n return false if loaded?\n @_called_from = first_caller\n Padrino.set_encoding\n Padrino.set_load_paths(*load_paths) # We set the padrino load paths\n Padrino::Logger.setup! # Initialize our logger\n Padrino.require_dependencies(\"#{root}/config/database.rb\", :nodeps => true) # Be sure to don't remove constants from dbs.\n Padrino::Reloader.lock! # Now we can remove constant from here to down\n Padrino.before_load.each(&:call) # Run before hooks\n Padrino.dependency_paths.each { |path| Padrino.require_dependencies(path) }\n Padrino.after_load.each(&:call) # Run after hooks\n Padrino::Reloader.run!\n Thread.current[:padrino_loaded] = true\n end", "def initialize_thorfiles(_relevant_to = nil, _skip_lookup = false)\n project = Skippy::Project.new(Dir.pwd)\n return unless project.exist?\n\n project.command_files { |filename|\n unless Thor::Base.subclass_files.key?(File.expand_path(filename))\n begin\n Thor::Util.load_thorfile(filename, nil, options[:debug])\n rescue ScriptError, StandardError => error\n command_path = Pathname.new(filename).relative_path_from(project.path)\n say \"Error loading: #{command_path} (#{error})\", :red\n if options[:debug]\n say error.inspect, :red\n say error.backtrace.join(\"\\n\"), :red\n end\n end\n end\n }\n end", "def require_load_paths\n load_paths.each { |path| Padrino.require_dependencies(File.join(self.root, path)) }\n end", "def pre_compile(main_file, settings)\n\tFile.read(main_file)\nend", "def define\n fail \"Version required (or :noversion)\" if @version.nil?\n @version = nil if :noversion == @version\n\n desc \"Build all the packages\"\n task :package\n\n desc \"Force a rebuild of the package files\"\n task repackage: [:clobber_package, :package]\n\n desc \"Remove package products\"\n task :clobber_package do\n rm_r package_dir rescue nil\n end\n\n task clobber: [:clobber_package]\n\n [\n [need_tar, tgz_file, \"z\"],\n [need_tar_gz, tar_gz_file, \"z\"],\n [need_tar_bz2, tar_bz2_file, \"j\"],\n [need_tar_xz, tar_xz_file, \"J\"]\n ].each do |need, file, flag|\n if need\n task package: [\"#{package_dir}/#{file}\"]\n file \"#{package_dir}/#{file}\" =>\n [package_dir_path] + package_files do\n chdir(working_dir) { sh @tar_command, \"#{flag}cvf\", file, target_dir }\n mv \"#{package_dir_path}/#{target_dir}\", package_dir if without_parent_dir\n end\n end\n end\n\n if need_zip\n task package: [\"#{package_dir}/#{zip_file}\"]\n file \"#{package_dir}/#{zip_file}\" =>\n [package_dir_path] + package_files do\n chdir(working_dir) { sh @zip_command, \"-r\", zip_file, target_dir }\n mv \"#{package_dir_path}/#{zip_file}\", package_dir if without_parent_dir\n end\n end\n\n directory package_dir_path => @package_files do\n @package_files.each do |fn|\n f = File.join(package_dir_path, fn)\n fdir = File.dirname(f)\n mkdir_p(fdir) unless File.exist?(fdir)\n if File.directory?(fn)\n mkdir_p(f)\n else\n rm_f f\n safe_ln(fn, f)\n end\n end\n end\n self\n end", "def load_lab_app_lib_files\n libFiles = File.dirname(__FILE__) + \"/../lib/*.rb\"\n Dir[libFiles].each do |file|\n fullpath = File.expand_path(file)\n puts \"Loading your file #{fullpath}\"\n require fullpath\n end\n end", "def pre_hard_load(mod); end", "def inject_dependencies\n add_to_load_path\n add_to_dependency_load_paths\n add_to_dependency_load_once_paths\n add_to_mixable_app_types\n end", "def r(filename)\n require \"./#{filename}\"\nend", "def makefile_hook(makefile)\n # STUB\n end", "def require_libs(*libs); end", "def installDeps(copy)\n deps = Buildr.artifacts(project('infra').compile.dependencies).map(&:to_s)\n deps << project('infra').package.to_s\n\t\t EXTRA_JARS.each do |jar|\n\t\t\t\t\tdeps << jar\n\t\t\t\tend\n deps = skipDeps(deps)\n\n classpathFile = File.new(GT4LIB + '/gndms-dependencies.xml', 'w')\n classpathFile.syswrite('<?xml version=\"1.0\"?>' + \"\\n\" + '<project><target id=\"setGNDMSDeps\"><path id=\"service.build.extended.classpath\">' + \"\\n\")\n depsFile = File.new(GT4LIB + '/gndms-dependencies', 'w')\n deps.select { |jar| jar[0, GT4LIB.length] != GT4LIB }.each { |file| \n basename = File.basename( file )\n newname = GT4LIB+'/'+basename\n if (copy)\n puts 'cp: \\'' + file + '\\' to: \\'' + newname + '\\''\n cp(file, newname)\n puts 'yay'\n chmod 0644, newname\n else\n puts 'ln_sf: \\'' + file + '\\' to: \\'' + newname + '\\''\n chmod 0644, file\n ln_sf(file, newname)\n end\n depsFile.syswrite(basename + \"\\n\") \n classpathFile.syswrite('<pathelement location=\"' + basename + '\" />' + \"\\n\")\n }\n depsFile.close\n classpathFile.syswrite('</path></target></project>' + \"\\n\\n\")\n classpathFile.close\n end", "def enable_domgen(repository_key, load_task_name, generate_task_name)\n define_table_order_resolver do |module_key|\n require 'domgen'\n data_module = Domgen.repository_by_name(repository_key).data_module_by_name(module_key.to_s)\n data_module.entities.select { |entity| !entity.abstract? }.collect do |entity|\n entity.sql.qualified_table_name\n end\n end\n\n self.modules = Proc.new do\n require 'domgen'\n Domgen.repository_by_name(repository_key).data_modules.collect{|data_module| data_module.name}\n end\n\n task \"#{task_prefix}:load_config\" => load_task_name\n task \"#{task_prefix}:pre_build\" => generate_task_name\n end", "def add_targets_from(path)\n\t\t\t\traise \"targets path #{path} didn't exist\" unless path.exist?\n\t\t\t\tui.log \"loading targets from #{path}\"\n\n\t\t\t\t$LOAD_PATH << path\n\t\t\t\tPathname.glob(path+'**/*.rb').each do |file|\n\t\t\t\t\trequire file\n\t\t\t\tend\n\t\t\tend", "def require_gems; end", "def eager_load_paths=(_arg0); end", "def reload \n load 'core/decision_tree.rb'\n load 'core/knn.rb'\n load 'core/perceptron.rb'\n load 'tools.rb'\n load 'examples/gender.rb'\n load 'examples/knn_test.rb'\nend", "def require_local(pathname, options={})\n library = $LOAD_STACK.last\n\n if library\n success = library.require(pathname, options)\n #load_path = $LOAD_PATH\n #$LOAD_PATH.replace(library.load_path)\n #begin\n # success = require_without_realms(pathname)\n #rescue\n # from, subpath = File.root_split(pathname)\n # success = require_without_realms(subpath)\n #ensure\n # $LOAD_PATH.replace(load_path)\n #end\n else\n stash_path = $LOAD_PATH\n #$LOAD_STACK << self\n $LOAD_PATH.replace(LOAD_PATH)\n begin\n success = require_without_realms(pathname)\n ensure\n $LOAD_PATH.replace(stash_path)\n #$LOAD_STACK.pop\n end \n end\n\n success\n end", "def load()\n\n checkFileExists()\n loadConfigs()\n checkConfigs() \n end", "def good_require_call\n good_call = File.expand_path(@str, @file_directory).delete_prefix(\"#{root_dir}/lib/\")\n %(require \"#{good_call}\")\n end", "def eager_load_libraries(arg = nil)\n set_or_return(\n :eager_load_libraries,\n arg,\n kind_of: [ Array, String, TrueClass, FalseClass ]\n )\n end", "def load_tasks\n end", "def require(paths, opts={}, &block)\n if @reloader\n @reloader.require_dependencies(paths, opts, &block)\n else\n Unreloader.expand_directory_paths(paths).each{|f| super(f)}\n end\n end", "def require_lib_files(files)\n case files\n when String\n file_paths = expanded_file_path(files)\n file_paths = Dir.glob(file_paths) if files.include? '*'\n when Array\n file_paths = files.map { |f| expanded_file_path(f) }\n end\n\n Motion::Require.all(file_paths)\nend", "def _reload_libs\n RELOAD_LIBS.each do |lib|\n require_dependency lib\n end\n end", "def load_source_and_set_module; end", "def setup_rake_dependencies(task, multitask = nil)\n dependencies.reverse_each do |d|\n begin\n bb = ALL_BUILDING_BLOCKS[d]\n raise \"Error: tried to add the dependencies of \\\"#{d}\\\" to \\\"#{@name}\\\" but such a building block could not be found!\" unless bb\n\n if multitask and bb.pre_step\n multitask.prerequisites.unshift(bb.get_task_name)\n else\n task.prerequisites.unshift(bb.get_task_name)\n end\n rescue ExitHelperException\n raise\n rescue Exception => e\n Printer.printError e.message\n ExitHelper.exit(1)\n end\n end\n\n task\n end", "def include(*filenames)\n # TODO: check for pending\n filenames.each do |fn|\n if fn.respond_to? :to_ary\n include(*fn.to_ary)\n else\n @pending_add << Rake.from_pathname(fn)\n end\n end\n @pending = true\n self\n end", "def require(*files)\n files.each do |file|\n evaluate(\"Johnson.require('#{file}');\")\n end\n end", "def require(*files)\n files.each do |file|\n evaluate(\"Johnson.require('#{file}');\")\n end\n end" ]
[ "0.6360848", "0.5768108", "0.57253647", "0.5649865", "0.5521204", "0.5487045", "0.5483122", "0.5483122", "0.54162985", "0.5372437", "0.5253465", "0.525309", "0.5236198", "0.52052885", "0.5192162", "0.5184371", "0.5184371", "0.5139757", "0.5139065", "0.5128504", "0.50825745", "0.50719345", "0.5067635", "0.50569034", "0.50463194", "0.50316286", "0.5024699", "0.5015752", "0.5001995", "0.498586", "0.498586", "0.498586", "0.49784163", "0.49674657", "0.49292234", "0.4927695", "0.49178973", "0.49131128", "0.49087054", "0.490106", "0.48972553", "0.48969388", "0.489634", "0.4893977", "0.48925036", "0.4887693", "0.4881086", "0.4875906", "0.4867914", "0.4867054", "0.4857664", "0.4844159", "0.48415896", "0.48344004", "0.4829782", "0.48151657", "0.4809208", "0.48083848", "0.48052257", "0.48041332", "0.48032546", "0.4802335", "0.4801106", "0.47949028", "0.47945437", "0.47925976", "0.47925976", "0.47892833", "0.478717", "0.47863296", "0.4772845", "0.47698364", "0.47666818", "0.47548684", "0.47521707", "0.474137", "0.4739527", "0.47346908", "0.4734165", "0.47341463", "0.4730943", "0.47278246", "0.47218356", "0.47162914", "0.47150475", "0.47118768", "0.47057086", "0.4696279", "0.46959805", "0.46903256", "0.46829587", "0.46814433", "0.46808118", "0.46803498", "0.46795806", "0.46783072", "0.46782994", "0.4674232", "0.46730518", "0.46730518" ]
0.4859695
50
Process one logical line of makefile data.
def process_line(line) # :nodoc: file_tasks, args = line.split(":", 2) return if args.nil? dependents = args.split.map { |d| respace(d) } file_tasks.scan(/\S+/) do |file_task| file_task = respace(file_task) file file_task => dependents end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_line(line)\n file_tasks, args = line.split(':', 2)\n return if args.nil?\n dependents = args.split.map { |d| respace(d) }\n file_tasks.scan(/\\S+/) do |file_task|\n file_task = respace(file_task)\n file file_task => dependents\n end\n end", "def process_line line\n if line.include?(\"@\") && @add_tags_to_main\n @nd[:main_tags] << line \n elsif line.include?(\"Feature:\")\n @nd[:feature] = line.sub(\"Feature:\",\"\")\n @add_tags_to_main = false\n elsif line.include?(\"Scenario:\")\n @nd[:scenarios].push({:name => line.sub(\"Scenario:\",\"\"), :steps => []})\n @add_to_s = true\n elsif\n begin\n @nd[:scenarios].last[:steps].push(line) if @add_to_s\n @add_to_s = true \n rescue\n end\n end\n end", "def process_line(line)\n @line = line\n if line =~ /^=/ then\n process_heading_line(line)\n elsif (listtype = special_list_line_type(line)) then\n special_list_line(listtype, line)\n elsif line =~ /^\\s*:/ then\n special_list_continuation_line(line)\n else\n @interp.normal_line(line)\n end\n end", "def process_line line\n if looks_like_json?(line)\n process_line_of_json_in_new_pipe(line)\n else\n process_line_of_tsv_in_this_pipe(line)\n end\n end", "def process_line(line)\n if @state.include?(:data)\n process_data_line(line)\n elsif @state.include?(:auth_plain_incomplete)\n process_auth_plain_line(line)\n elsif @state.include?(:auth_login_incomplete)\n process_auth_login_line(line)\n else\n process_command_line(line)\n end\n [email protected]?(:quit) # return true unless QUIT is given\n end", "def pre_process(text_line)\n text_line\n end", "def process_line(line)\n if (@custom_processor && @custom_processor.class.method_defined?(:process_line))\n @custom_processor.process_line line\n else\n line.split ' '\n end\n end", "def compile_line(aRawLine)\n line_rep = aRawLine.map { |couple| compile_couple(couple) }\n \n # Apply the rule: when a line just consist of spaces \n # and a section element, then remove all the spaces from that line.\n line_to_squeeze = line_rep.all? do |item|\n if item.kind_of?(StaticText)\n item.source =~ /\\s+/\n else\n false\n end\n end\n line_rep_ending(line_rep) unless line_to_squeeze\n \n return line_rep\n end", "def source_line=(_); end", "def feed(line, labelhash)\n @skip = line.empty? || (line =~ /^\\;(-)\\1*$/)\n\n # this goes first\n is_done? line\n return if @done || @skip\n\n is_name? line\n is_flags? line\n is_tags? line\n is_stack? line\n is_vocab? line\n is_code? line,labelhash\n\n # this goes last\n is_desc? line\n end", "def line_do(line = nil)\n load_from line\n\n statement = @lexer.next_skip_line_number\n type = statement.type\n\n if STATEMENTS.key?(type)\n send(STATEMENTS[type])\n else\n case type\n when :eos, :NEXT, :RETURN, :END then return type\n\n when :REM, :DATA then return :eol # Ignore empty, comment, or DATA line\n\n when :LET, :ident then do_assignment statement\n\n when :RESTORE then @data = @orig_data.dup\n\n when :STOP # Emergency stop, as I recall\n puts 'STOPped'\n return :END\n\n else # Ignore the not understood for now\n do_ignore\n end\n end\n\n :eol # Signify that the line has been handled\n end", "def precmd(line)\n line\n end", "def parse_line(line)\n # If the previous line didn't and a logical line, we're not going to start one. If it did,\n # we're indeed going to start a new logical line\n @state[:ll_start] = @state[:ll_end]\n\n # We will start with the assumption that we're going to end the current logical line. We may layer\n # find out that we did not, in fact, do so.\n @state[:ll_end] = true\n\n # Reset the line continuator flag the the last line may have set to true\n @state[:line_continuator] = false\n\n # Find the first non-(space/tab) character\n index = 0\n while index < line.length && [\" \", \"\\t\"].include?(line[index])\n index += 1\n end\n @state[:indent_string] = line[0...index]\n\n # Iterate over the line's characters as long as there are any. We use different iteration\n # methods depending on whether we're inside a string or not\n index = 0\n while index < line.length\n if @state[:in_string].nil?\n index = parse_characters_normal(line, index)\n else\n index = parse_characters_in_string(line, index)\n end\n end\n\n # We have reached the end of the line. Decide whether or not the logical line ends here.\n @state[:ll_end] = @state[:in_string].nil? && @state[:open_braces] == 0 && !@state[:line_continuator]\n end", "def process_line(line, &block)\n return enum_for(:process_line, line) unless block\n\n if @row_index < header_lines\n consume_header_line(line, @columns)\n else\n transform_line(line, @row_index, &block)\n end\n\n @row_index += 1\n\n # We've now seen enough lines to have consumed a valid header; is this the case?\n fail_unless_header_complete(@columns) if @row_index == header_lines\n\n @notifier.try(:processed, @row_index)\n end", "def process_line(_line)\n raise NotImplementedError\n end", "def file_line=(_arg0); end", "def pre_process(text_line)\n processed_line = \"\"\n if text_line.slice(0..1)== \"LD\" && text_line.slice(14..20) == 'XXXXXXX'\n if @false_header_loaded\n processed_line = \"DT\" + text_line.slice(2..text_line.length())\n else\n processed_line = \"DH\" + text_line.slice(2..text_line.length())\n end\n elsif text_line.slice(0..1)== \"LD\"\n @false_header_loaded = true\n processed_line = text_line\n else\n processed_line = text_line\n end\n\n return processed_line\n\n end", "def process_line(line)\n line.split ' '\n end", "def parse(line)\n params = line.split(/\\s+/)\n return nil unless params[0] == 'instruction'\n\n spec_defs = params[2..-1]\n specs = parse_specs(spec_defs)\n\n specs\n end", "def compile_line(line)\n return if line.strip.empty?\n \n if !check_for_directive(line)\n @computer.memory.storage[@compile_counter].from_code(line)\n @compile_counter += 1\n end\n end", "def process(source)\n\t\t\t@source = source.respond_to?(:path) ? File.basename(source.path) : 'unknown'\n\t\t\t@line_no = 0\n\t\t\t@last_if = nil\n\t\t\t@outputting = true\n\t\t\tout_lines = []\n\t\t\tsource.each_line do |line|\n\t\t\t\t@line_no += 1\n\t\t\t\tif is_from_preprocessor?(line)\n\t\t\t\t\tparse(line)\n\t\t\t\telse\n\t\t\t\t\tif @outputting\n\t\t\t\t\t\tout_lines << line\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t\tif @last_if\n\t\t\t\traise PreprocessorError, \"#@source:#@last_if:error: unmatched #if\"\n\t\t\tend\n\t\t\tFakeIO.new(out_lines)\n\t\tend", "def irrelevant_line(source_line); end", "def process_line(lineno, tokens)\n if (tag_line = TAGS[@parse_state.state]) == nil\n raise \"In unknown state (#{@parse_state.state})\"\n elsif (tag_spec = tag_line[ tokens.index ]) == nil\n if tokens.tag[0,1] == \"_\" || @parse_state.state == :user_subtag\n print \"Unknown tag #{tokens}. \"\n tokens.user_tag \n pp \"Converted to #{tokens}\"\n process_line(lineno, tokens)\n else\n raise \"Tag ([#{tokens.tag},#{tokens.xref}]) not valid in this state (#{@parse_state.state})\"\n end\n elsif tag_spec[CHILD_RECORD] != nil #don't push nil states, as these represent terminals\n #Run the handler for this line.\n @transmission.action_handler lineno, tokens, *tag_spec\n #switch to new state\n @parse_state << tag_spec[CHILD_RECORD]\n else \n #Run the handler for this line.\n @transmission.action_handler lineno, tokens, *tag_spec\n end\n \n end", "def parse_line(line)\n target, operator, *commande = line.split(' ')\n self[target] = [] if self[target].nil?\n self[target] << [operator == '+=', Proc.new {|repository| eval(commande.join(' ')) }]\n end", "def handle(data)\n\t\t\t\tprocess_line(data)\n\t\t\tend", "def execute_line(line, source_line_number, cycles = 1)\n # These are in order of more likely occurrence for speed, i.e. assume that most\n # pattern lines are vectors...\n if line =~ /(?:^|.*:)\\s*(?:V|Vector)\\s+{(.*)}/\n Regexp.last_match(1).strip.split(';').each do |assignment|\n assignment = assignment.split(/\\s*=\\s*/)\n pin = dut.pins(OrigenSTIL.unquote(assignment[0]))\n data = assignment[1].gsub(/\\s+/, '')\n pin.vector_formatted_value = data\n end\n cycles.cycles\n\n # Pattern comments\n elsif line =~ /^\\s*Ann\\s*{\\*\\s*(.*)\\s*\\*}/\n cc Regexp.last_match(1)\n\n # Source comments\n elsif line =~ /\\s*\\/\\/.*/\n # Just ignore source comments\n\n # Change of timeset\n elsif line =~ /(?:^|.*:)\\s*(?:W|WaveformTable)\\s+(.*)\\s*;/\n if @exec_options[:set_timesets]\n timeset = OrigenSTIL.unquote(Regexp.last_match(1))\n if timeset != @current_timeset\n tester.set_timeset(timeset, timesets[timeset][:period_in_ns])\n @current_timeset = timeset\n end\n end\n\n else\n line = line.strip\n unless line.empty? || line == '}' # End of pattern\n Origen.log.warning \"Skipped Pattern line #{source_line_number}: #{line}\"\n end\n end\n end", "def postcmd(line)\n line\n end", "def process_raw(raw, line_number)\n raw\n end", "def prepare(line)\n @logger.debug \"Looking at #{line.paragraph_type}: #{line.to_s}\"\n if not should_accumulate_output?(line) then\n flush!\n maintain_list_indent_stack(line)\n @output_type = line.paragraph_type \n end\n push_mode(:inline_example) if line.inline_example? and current_mode != :inline_example\n pop_mode(:inline_example) if current_mode == :inline_example && !line.inline_example?\n push_mode(:table) if enter_table?\n pop_mode(:table) if exit_table?\n @buffered_lines.push(line)\n end", "def process_line(original_line, jobs, ld_cache)\n consolidate_classes(original_line, classify_decisions(category_parsing(parse_line_elements(original_line), jobs, ld_cache)))\nend", "def handle(line)\n parsed = parse(line)\n return unless parsed\n\n handle_parsed(parsed)\n end", "def check_the_line(relevant_line)\n puts '0' && exit if relevant_line == []\nend", "def process_testcase(line_buffer)\n line_buffer\n end", "def process_line(ln)\n ln.strip!\n if ln =~ /(.*)\\s+\\(\\d+\\)\\z/\n $1\n else\n ln\n end\n end", "def process_line(line)\n return true if line.empty?\n\n chunks = line.split(SPLIT_PATTERN, fmt.length)\n enough_fields?(line) # can raise exception\n\n point = { path: extract_path(chunks),\n value: extract_value(chunks) }\n\n tags = line_tags(chunks)\n\n point.tap do |p|\n p[:tags] = tags unless tags.empty?\n p[:ts] = extract_ts(chunks) if fmt.include?('t')\n p[:source] = extract_source(chunks) if fmt.include?('s')\n p[:interval] = options[:interval] || 'm' if fmt.include?('d')\n end\n end", "def source_line; end", "def process_line( line )\n if line =~ /\\*#{@action}\\*/\n changed\n log = @log_class.new( line ) \n notify_observers( log )\n end\n end", "def line=(_arg0); end", "def process_initial(time_stamp, line)\n process(time_stamp, line)\n end", "def parse\n @lines.each do |line|\n if m = line.match(R_ATTRIBUTE)\n @attrs << {:name => m[1].strip, :type => m[2].strip, :desc => m[4].strip}\n elsif m = line.match(R_ATTRIBUTE_NEXT_LINE)\n @attrs[-1][:desc] += \" #{m[1].strip}\"\n end\n end\n end", "def irrelevant_line?(source_line); end", "def processing_instruction(data)\n end", "def process_line(line)\n # skip current line unless in correct format:\n # all restaurant IDs are integers, all item names are lower case letters and underscores,\n # and the price is a decimal number, all separated by commas with any surrounding whitespace\n return unless line =~ /^\\d+\\s*,\\s*\\d+\\.\\d{2}\\s*,\\s*([a-z_]+\\s*,\\s*)*[a-z_]+$/\n entry_items = line.gsub(/\\s+/,'').split(',')\n\n restaurant_id = entry_items.shift\n entry_price = entry_items.shift\n\n encoded_entry = encode_entry(entry_items)\n return unless encoded_entry > 0 #if encoded_entry equals 0 then no items matched the desired so why bother\n\n update_min_entry_price(restaurant_id, entry_price, encoded_entry)\n end", "def parse_file_data\n current_category = nil\n todo_lines = []\n File.open(@config_file) {|fl| todo_lines = fl.readlines() }\n line_count = 0\n todo_lines.each do |todo_line|\n todo_line.strip!.chomp!\n next if todo_line.nil? or todo_line.empty?\n case todo_line\n when /^\\*{1}\\ (.+)?/\n current_category = $1\n line_count = 0\n @todo_container[current_category] ||= []\n when /^(\\*{2,})\\ TODO\\ (.+)?/\n priority = $1.size\n item = OpenStruct.new(:priority => priority, :flag => true, :text => $2,:index => line_count )\n line_count += 1\n @todo_container[current_category] << item\n when /^(\\*{2,})\\ DONE\\ (.+)?/\n priority = $1.size\n item = OpenStruct.new(:priority => priority, :flag => false, :text => $2,:index => line_count )\n line_count += 1\n @todo_container[current_category].push(item)\n end\n end\n end", "def source_line(lineno); end", "def parse_line(line)\n case line\n when /^SF:(.+)/\n @current_filename = $~[1].gsub(/^\\.\\//, '')\n source_files[@current_filename] = []\n when /^DA:(\\d+),(\\d+)/\n line_no = $~[1]\n covered = $~[2]\n source_files[@current_filename] << [line_no.to_i, covered.to_i]\n when /^(BRF|BRH):(\\d+)/\n # branches found/hit; no-op\n when /^BRDA:(\\d+),(\\d+),(\\d+),(-|\\d+)/\n line_no = $~[1]\n block_no = $~[2]\n branch_no = $~[3]\n covered = ($~[4] == '-' ? '0' : $~[4])\n source_files[@current_filename] << [line_no.to_i, block_no.to_i, branch_no.to_i, covered.to_i]\n when /^end_of_record$/, /^$/\n @current_filename = nil\n else\n raise LcovParseError, \"could not recognise '#{line}' as valid LCOV\"\n end\n end", "def process_skipped_lines(lines); end", "def first_pass\n found_end = false\n \n File.open(@tas_path, \"r\") do |file| \n while (line = file.gets)\n line.chomp!\n \n code = {}\n code[:line] = line\n code[:line_counter] = @line_counter\n \n tokens = line.strip.split(/\\s+/)\n first = tokens.first \n \n if (first.match(/^\\w+:$/))\n handle_label(tokens, code)\n elsif (first == 'END')\n found_end = true\n break\n elsif (first != 'REM')\n handle_opcode(tokens, code)\n end\n \n @instructions.push(code) \n @line_counter = @line_counter.next \n end\n end\n \n @warnings.push(\"END directive not found\") if (!found_end)\n \n if (@errors.empty?)\n second_pass\n else\n write_lis\n puts \"Errors encountered on first pass, .obj file not created. See .lis file for details\"\n end\n end", "def process_line(text, index)\n @index = index + 1\n\n case text[0]\n when DIV_CLASS; render_div(text)\n when DIV_ID\n return push_plain(text) if text[1] == ?{\n render_div(text)\n when ELEMENT; render_tag(text)\n when COMMENT; render_comment(text[1..-1].strip)\n when SANITIZE\n return push_plain(text[3..-1].strip, :escape_html => true) if text[1..2] == \"==\"\n return push_script(text[2..-1].strip, :escape_html => true) if text[1] == SCRIPT\n return push_flat_script(text[2..-1].strip, :escape_html => true) if text[1] == FLAT_SCRIPT\n return push_plain(text[1..-1].strip, :escape_html => true) if text[1] == ?\\s\n push_plain text\n when SCRIPT\n return push_plain(text[2..-1].strip) if text[1] == SCRIPT\n push_script(text[1..-1])\n when FLAT_SCRIPT; push_flat_script(text[1..-1])\n when SILENT_SCRIPT\n return start_haml_comment if text[1] == SILENT_COMMENT\n\n raise SyntaxError.new(<<END.rstrip, index) if text[1..-1].strip == \"end\"\nYou don't need to use \"- end\" in Haml. Use indentation instead:\n- if foo?\n %strong Foo!\n- else\n Not foo.\nEND\n\n push_silent(text[1..-1], true)\n newline_now\n\n # Handle stuff like - end.join(\"|\")\n @to_close_stack.last << false if text =~ /^-\\s*end\\b/ && !block_opened?\n\n case_stmt = text =~ /^-\\s*case\\b/\n keyword = mid_block_keyword?(text)\n block = block_opened? && !keyword\n\n # It's important to preserve tabulation modification for keywords\n # that involve choosing between posible blocks of code.\n if %w[else elsif when].include?(keyword)\n # @to_close_stack may not have a :script on top\n # when the preceding \"- if\" has nothing nested\n if @to_close_stack.last && @to_close_stack.last.first == :script\n @dont_indent_next_line, @dont_tab_up_next_text = @to_close_stack.last[1..2]\n else\n push_and_tabulate([:script, @dont_indent_next_line, @dont_tab_up_next_text])\n end\n\n # when is unusual in that either it will be indented twice,\n # or the case won't have created its own indentation\n if keyword == \"when\"\n push_and_tabulate([:script, @dont_indent_next_line, @dont_tab_up_next_text, false])\n end\n elsif block || case_stmt\n push_and_tabulate([:script, @dont_indent_next_line, @dont_tab_up_next_text])\n elsif block && case_stmt\n push_and_tabulate([:script, @dont_indent_next_line, @dont_tab_up_next_text])\n end\n when FILTER; start_filtered(text[1..-1].downcase)\n when DOCTYPE\n return render_doctype(text) if text[0...3] == '!!!'\n return push_plain(text[3..-1].strip, :escape_html => false) if text[1..2] == \"==\"\n return push_script(text[2..-1].strip, :escape_html => false) if text[1] == SCRIPT\n return push_flat_script(text[2..-1].strip, :escape_html => false) if text[1] == FLAT_SCRIPT\n return push_plain(text[1..-1].strip, :escape_html => false) if text[1] == ?\\s\n push_plain text\n when ESCAPE; push_plain text[1..-1]\n else push_plain text\n end\n end", "def subsm_reactor_build_order(line, sub_state)\n def extract_project_name(line)\n line[9..-1].chop\n end\n\n case sub_state\n when :before then\n if line[/Reactor build order:/]\n :start\n else\n :before\n end\n when :start then\n if line[/------------------------------------------------------------------------/]\n :end\n else\n $reactor_build_order << extract_project_name(line)\n :start\n end\n end\nend", "def process_line(line, index)\n\n # there should be a check for interpolation here, and just run a simple replace for each line\n\n if !indented?(line)\n $context = $root\n add_selector_or_property(line, index)\n # check here for @import, @font-face, and @keyframes\n else\n\n set_default_indent(line) if $default_indent.nil?\n\n if indent_level(line) == $context.indent + 1\n add_selector_or_property(line, index)\n elsif indent_level(line) < $context.indent + 1\n $context = find_context($context.parent, line)\n add_selector_or_property(line, index)\n else\n throw \"Flagrant code error! You indented line #{index} too far\"\n end\n\n end\n\nend", "def process_line ln, line\r\n # convert inline processor\r\n while /\\#\\#(?<p_>[A-Z][_A-Z0-9]*)(:\\s*(?<a_>.+))?\\#\\#/ =~ line\r\n rst = conv_inline(p_, a_, ln, line)\r\n raise \"do not use '##.*##' inside your inline processor converting result\" if rst =~ /\\#\\#[A-Z][_A-Z0-9]*(:\\s*.+)?\\#\\#/\r\n line.sub!(/\\#\\#[A-Z][_A-Z0-9]*(:\\s*.+)?\\#\\#/, rst)\r\n end\r\n \r\n # create a token, with processor name\r\n token = self.tokenize(ln, line)\r\n # based on the the token indent level, close token stack if any\r\n self.close_stack token.indent_level\r\n \r\n # add token and then close it unless it opens a block\r\n @token_stack << token\r\n self.close_stack token.indent_level unless token.block_open?\r\n\r\n self # for methods chain\r\n end", "def collect_next_line\n line = @io.gets\n return nil unless line\n\n if line =~ ONE_LINE_TEST_RESULT_REGEX\n process_test_result $1\n\n elsif line.include? TEST_RESULT_START_TOKEN\n @partial_test_result << line.sub(TEST_RESULT_START_TOKEN, '')\n\n elsif line.include? TEST_RESULT_END_TOKEN\n @partial_test_result << line.sub(TEST_RESULT_END_TOKEN, '')\n process_test_result @partial_test_result\n @partial_test_result = ''\n\n elsif !@partial_test_result.empty?\n # Middle of a test result\n @partial_test_result << line\n\n else\n @on_non_test_result_line_block.call(line) if @on_non_test_result_line_block\n\n end\n\n line\n end", "def original_line; end", "def clean(data)\n data.map{|line|\n Hash[line.map{ |col| \n col[1] = BOOL_MAP[col[1]] || col[1].to_s.strip.gsub(/^\\s+|\\s+$/, '').gsub(/\\n|\\r/,' ')\n col\n }]\n }\n end", "def process_line(line, index, block_opened)\n @index = index + 1\n @block_opened = block_opened\n\n case line[0]\n when DIV_CLASS, DIV_ID\n render_div(line)\n when ELEMENT\n render_tag(line)\n when COMMENT\n render_comment(line)\n when SCRIPT\n sub_line = line[1..-1]\n if sub_line[0] == SCRIPT\n push_script(sub_line[1..-1].strip.dump.gsub('\\\\#', '#'), false)\n else\n push_script(sub_line, false)\n end\n when FLAT_SCRIPT\n warn(FLAT_WARNING) unless defined?(Test::Unit)\n push_flat_script(line[1..-1])\n when SILENT_SCRIPT\n sub_line = line[1..-1]\n unless sub_line[0] == SILENT_COMMENT\n mbk = mid_block_keyword?(line)\n push_silent(sub_line, !mbk)\n if (@block_opened && !mbk) || line[1..-1].split(' ', 2)[0] == \"case\"\n push_and_tabulate([:script])\n end\n end\n when FILTER\n name = line[1..-1].downcase\n start_filtered(options[:filters][name] || name)\n when DOCTYPE\n if line[0...3] == '!!!'\n render_doctype(line)\n else\n push_plain line\n end\n when ESCAPE\n push_plain line[1..-1]\n else\n push_plain line\n end\n end", "def load_raw_line opts = OPTS_REGEX.keys\n self.raw_line.chomp!\n opts.each do |xfield|\n pattern = OPTS_REGEX[xfield]\n did_set = raw_setter xfield, pattern\n #puts did_set\n end\n end", "def process_line(line)\n command_match, arg_string, captures, args = tokenize(line)\n\n check_for_command_collision(command_match, arg_string) if Pry.config.collision_warning\n\n self.arg_string = arg_string\n self.captures = captures\n\n call_safely(*(captures + args))\n end", "def parse_input(line)\n pieces = line.split(' ')\n a = pieces[1]\n b = pieces[7]\n @step_map.add_node(a, b)\n end", "def process\n return if @processed\n\n in_count = 0\n mark = -1\n start_of_chunk = -1\n last_of_chunk = -1\n chunk_name = ''\n chunk_loc = -1\n chunk_level = @define_hash[:register_level][:val]\n chunk_unused = @define_hash[:register_unused][:val]\n chunk_width = @define_hash[:register_width][:val]\n stack = [true]\n def_name = def_arg = def_rest = def_val = def_ref = def_kind = nil\n # true accepting input\n # false rejecting input\n # nil rejecting input due to nested #ifdef/#ifndef\n while in_count < @input.length\n l = input[in_count].chomp\n l_in_count = in_count\n while (in_count < @input.length) && (match = /\\\\[ \\t]*/.match(l))\n l[match.begin(0), match.end(0)] = @input[in_count].chomp # question: should we add a space before the next line?\n in_count += 1\n end\n skip = false\n #print \"in=#{in_count} out=#{@lines.length} mark=#{mark} start=#{start_of_chunk} '#{l}'\\n\"\n\n if /^#+[ \\t]/.match(l)\n mark = @lines.length\n elsif /^=+[ \\t]/.match(l)\n mark = @lines.length\n elsif (m = /^#define[ \\t]+(\\w+)[ \\t]*(\\([\\w, ]*\\))?[ \\t]+(.*)$/.match(l))\n def_name = m[1]\n def_arg = m[2]\n def_rest = m[3]\n if stack[-1]\n value = {}\n value[:arg] = def_arg.gsub(/[\\(\\)]/, '') if def_arg\n if def_rest && def_rest != '' # value and possibly ref\n if (m2 = /^(.*)[ \\t]+\\/\\*[ \\t]*([-A-Z0-9][- A-Z0-9]*)([-A-Z0-9])[ \\t]*\\*\\/[ \\t]*$/.match(def_rest)) # value and ref both present\n def_val = m2[1]\n def_ref = m2[2]\n def_kind = m2[3]\n value[:val] = def_val\n value[:ref] = def_ref + def_kind\n value[:kind] = def_kind\n @device_hash[def_name] = value if value[:kind] == 'D'\n @register_hash[def_name] = value if (value[:kind] == 'R' || value[:kind] == 'A')\n if /^[DRA]$/.match(value[:kind])\n if start_of_chunk >= 0 && last_of_chunk >= 0\n @chunks << {:start => start_of_chunk,\n :end => last_of_chunk,\n :key => chunk_loc,\n :name => chunk_name,\n :unused => chunk_unused,\n :level => chunk_level,\n :width => chunk_width}\n print \"chunk=#{@chunks[-1]}\\n\"\n end\n start_of_chunk = mark + 1\n chunk_name = def_name\n chunk_loc = @lines.length\n chunk_unused = @define_hash[:register_unused][:val]\n chunk_level = @define_hash[:register_level][:val]\n chunk_width = @define_hash[:register_width][:val]\n end\n last_of_chunk = @lines.length\n else\n value[:val] = def_rest # no ref present\n end\n end\n @define_hash[def_name] = value\n mark = @lines.length\n end\n\n elsif (m = /^#undef[ \\t]+(\\w+)[ \\t]*$/.match(l))\n def_name = m[1]\n @define_hash.delete(def_name) if stack[-1]\n\n elsif (m = /^#ifdef[ \\t]+(\\w+)[ \\t]*$/.match(l))\n def_name = m[1]\n if stack[-1].nil?\n stack.push(nil)\n else\n stack.push(@define_hash.has_key?(def_name))\n end\n skip = true\n\n elsif (m = /^#ifndef[ \\t]+(\\w+)[ \\t]*$/.match(l))\n def_name = m[1]\n if stack[-1].nil?\n stack.push(nil)\n else\n stack.push(!@define_hash.has_key?(def_name))\n end\n skip = true\n\n elsif /^#else[ \\t]*$/.match(l)\n if stack[-1] != nil\n stack[-1] = !stack[-1]\n end\n skip = true\n\n elsif /^#endif[ \\t]*$/.match(l)\n stack.pop if stack.length > 1\n skip = true\n end\n\n if stack[-1] && !skip\n @src_map[@lines.length] = l_in_count\n @lines << l\n end\n in_count += 1\n end\n\n if start_of_chunk > 0\n @chunks << {:start => start_of_chunk,\n :end => last_of_chunk,\n :key => chunk_loc,\n :name => chunk_name,\n :unused => chunk_unused,\n :level => chunk_level,\n :width => chunk_width}\n end\n @processed = true\n\n end", "def parse_line_first_pass(line, buffer)\n if @in_toc\n if line == \"\\n\"\n @in_toc = false\n else\n @existing_headlines.push line[0..-1]\n end\n elsif line.start_with? TABLE_OF_CONTENTS\n @in_toc = true\n first_headline = line[TABLE_OF_CONTENTS.length..-1]\n @existing_headlines.push first_headline if not first_headline.empty?\n elsif match = line.match(HEADLINE)\n id, text = match[1], match[2]\n text.gsub!(REF, '')\n text.gsub!(NEW_NOTE, '')\n text.gsub!(/\\[?\"([^\"]+)\":[^ ]+\\]?/, '\\1')\n\n # If quotation marks or brackets still appear, we're in trouble.\n if text.match(/[\"\\[\\]]/)\n $stderr.puts(\"Malformed link or footnote in section headline: \" +\n \"#{text}\\n\")\n exit 1\n end\n @headlines.push \"\\\"#{text}\\\":##{id}\\n\"\n end\n end", "def before_process(text_line)\n nil\n end", "def parse_line(line)\n results = LineRegexp.match(line)\n if results \n @elements[:line] = results[-1]\n results[-1] # remaining line \n else\n @elements[:line] = line\n line \n end\n end", "def process_line( key, values, line_string)\n case key\n #---------------------------------------------------------\n # List of geometric vertices, with (x, y, z [,w]) coordinates, \n # w is optional and defaults to 1.0.\n when \"v\"\n values.collect! { |v| v.to_f }\n @vertex.push( values )\n #---------------------------------------------------------\n # List of vertex normals in (x,y,z) form; normals might not be unit vectors.\n # https://en.wikipedia.org/wiki/Normal_(geometry)\n when \"vn\"\n values.collect! { |v| v.to_f }\n @normal.push( values )\n #---------------------------------------------------------\n # List of texture coordinates, in (u, [v ,w]) coordinates, these \n # will vary between 0 and 1, v and w are optional and default to 0.\n when \"vt\"\n values.collect! { |v| v.to_f }\n values = values[0..1]\n #values.size.times do |index|\n # values[index] *= -1.0 # inverse Y cord in texture file?\n #end\n @texcoord.push( values ) # u and v\n puts(\"Texture pos: [#{values.join(', ')}] From: \\'#{line_string}\\'\") if DEBUGGING\n #---------------------------------------------------------\n # Named objects and polygon groups.\n when \"o\"\n @objects << values.first\n #---------------------------------------------------------\n # Polygon group names.\n when \"g\", \"group\"\n if values.length == 0\n # p \"anonymous group detected. treat as \\\"default\\\".\"\n @current_group = get_group( \"default\" )\n else\n # Only the first group is adopted even if there are multiple group names on the line.\n @current_group = get_group( values[0] )\n end\n @current_group.mtl_name = @current_material_name\n #---------------------------------------------------------\n # Smooth shading across polygons? * can also mark shader groups with int value *\n when \"s\"\n setting = values.first # convert into boolean\n @smooth_shading = setting.include?('on') or setting.include?('true')\n #---------------------------------------------------------\n # Polygonal face element, these can be packaged in a number of ways.\n # index is offset to start drawing at tile index 0, hense minus 1\n when \"f\"\n vertex_count = values.length\n case values[0]\n when /\\d+\\/\\d+\\/\\d+/ # v/vt/vn\n face = Face.new( vertex_count )\n print(\"Face: \") if DEBUGGING\n values.each_with_index do |value, i|\n v, vt, vn = value.split( '/' )\n face.vtx_index[i] = v.to_i - 1\n face.tex_index[i] = vt.to_i - 1\n face.nrm_index[i] = vn.to_i - 1\n print(\"[#{face.vtx_index[i]}, #{face.tex_index[i]}, #{face.nrm_index[i]}] \") if DEBUGGING\n end\n # --------------------------------------\n when /\\d+\\/\\/\\d+/ # v//vn\n face = Face.new( vertex_count )\n print(\"Face: \") if DEBUGGING\n values.each_with_index do |value, i|\n v, vn = value.split( '//' )\n face.vtx_index[i] = v.to_i - 1\n face.nrm_index[i] = vn.to_i - 1\n print(\"[#{face.vtx_index[i]}, #{face.nrm_index[i]}] \") if DEBUGGING\n end\n # --------------------------------------\n when /\\d+\\/\\d+/ # v/vt\n face = Face.new( vertex_count )\n print(\"Face: \") if DEBUGGING\n values.each_with_index do |value, i|\n v, vt = value.split( '/' )\n face.vtx_index[i] = v.to_i - 1\n face.tex_index[i] = vt.to_i - 1\n print(\"[#{face.vtx_index[i]}, #{face.tex_index[i]}] \") if DEBUGGING\n end\n # --------------------------------------\n when /\\d+/ # v\n face = Face.new( vertex_count )\n print(\"Face: \") if DEBUGGING\n values.each_with_index do |value, i|\n face.vtx_index[i] = value.to_i - 1\n print(\"[#{face.vtx_index[i]}] \") if DEBUGGING\n end\n # --------------------------------------\n else\n p \"unknown face format detected.\"\n end\n @current_group.faces.push( face )\n @current_group.face_index.push( @current_group.faces.length - 1 )\n puts(\"\") if DEBUGGING\n #---------------------------------------------------------\n when /^\\#+/, nil\n #puts \"comment or empty line.\"\n #---------------------------------------------------------\n # The .mtl file may contain one or more named material definitions. \n when \"mtllib\"\n # https://en.wikipedia.org/wiki/Materials_system\n # https://en.wikipedia.org/wiki/Wavefront_.obj_file#Material_template_library\n @material_lib = MaterialLibrary.new(values.first)\n #---------------------------------------------------------\n # The material name matches a named material definition in an external .mtl file.\n when \"usemtl\"\n @current_materials << values.first\n #---------------------------------------------------------\n else\n puts \" -Unsupported .obj token #{key} given. Ignored.\"\n end\n end", "def line=(_); end", "def line=(_); end", "def general_process_file(lines)\n data = []\n chap, sec, subsec, subsubsec = false, false, false, false\n lines.each do |raw_line|\n line = raw_line.strip\n if starts_with?(line, \"\\\\chapter\")\n node = {}\n node[:chapter] = get_data_in_brackets(line)\n node[:content] = []\n data << node\n chap = true\n elsif starts_with?(line, \"\\\\section\")\n sec, subsec, subsubsec = true, false, false\n node = {}\n node[:section] = get_data_in_brackets(line)\n node[:content] = [] \n ((chap) ? data.last[:content] : data) << node\n elsif starts_with?(line, \"\\\\subsection\")\n subsec, subsubsec = true, false\n node = {}\n node[:subsec] = get_data_in_brackets(line)\n node[:content] = []\n # puts line\n # puts data.last[:content].inspect\n ((chap) ? data.last[:content].last[:content] : data.last[:content]) << node\n elsif starts_with?(line, \"\\\\subsubsection\")\n subsubsec = true\n node = {}\n node[:subsubsec] = get_data_in_brackets(line)\n node[:content] = []\n ((chap) ? data.last[:content].last[:content].last[:content] : data.last[:content].last[:content]) << node\n else\n # we just have a line (store the raw line)\n if subsubsec\n ((chap) ? data.last[:content].last[:content].last[:content].last[:content] : data.last[:content].last[:content].last[:content]) << raw_line\n elsif subsec\n ((chap) ? data.last[:content].last[:content].last[:content] : data.last[:content].last[:content]) << raw_line\n elsif sec\n ((chap) ? data.last[:content].last[:content] : data.last[:content]) << raw_line\n elsif chap\n data.last[:content] << raw_line\n else\n raise \"got line and not in a known section type: #{line}\"\n end\n end\n end\n return data\nend", "def process_readable(source, attributes); end", "def single_line?; end", "def process_source(source)\n return source if source.is_a?(String) && source =~ /\\n/\n\n source, _ = engine.fetch_source(source, { :view_path => options[:view_path] })\n source\n end", "def parse_line_break; end", "def process_line(line)\n line = line.chomp\n if line.match(/^Add /)\n @credit_cards << CreditCard.create(parse_credit_card_line(line))\n elsif line.match(/^Charge /)\n charge = parse_charge_line(line)\n if cc = CreditCard.first(:person => charge[:person])\n cc.charge(charge[:amount])\n end\n elsif line.match(/^Credit /)\n credit = parse_credit_line(line)\n if cc = CreditCard.first(:person => credit[:person])\n cc.credit(credit[:amount])\n end\n end\n end", "def pre_process_action(action_path, payload_path = nil)\n lb = line_break\n env = @platform_info[\"environment_set\"]\n cmt = @platform_info[\"comment_char\"]\n language = @platform_info[\"language\"]\n shebang = \"\"\n content = File.open(action_path).read\n content = ERB.new(content).result(binding)\n items = content.scan(/^\\s*\\#\\!.*/)\n shebang = items[0] if items.size > 0\n if payload_path\n @transfer_properties[\"RPM_PAYLOAD\"] = payload_path\n end\n env_header = \"#{cmt} Environment vars to define#{lb}\"\n @standard_properties.each{|prop| @transfer_properties[prop] = @p.get(prop) }\n @transfer_properties.each do |key,val|\n env_header += \"#{env}#{key}=#{val}#{lb}\" if language == \"batch\"\n env_header += \"#{env}#{key}=\\\"#{val}\\\"#{lb}\" unless language == \"batch\"\n end\n file_content = \"#{shebang}#{lb}#{env_header}#{lb}#{content}\"\n fil = File.open(action_path,\"w+\")\n fil.puts file_content\n fil.flush\n fil.close\n file_content\n end", "def process_line(line)\n line_arr = line.split(\" \")\n line_arr.each do |word|\n if word.delete(\"-/:;,()\\\"\").empty?\n next\n end\n process_word(word.delete(\"/:;,()<>{}|[]\\\"\"))\n end\n end", "def parse_data(data)\n # Prevent abortive empty JSON.parse error\n data = '{}' if data.blank?\n\n return \"Error from #{@task}: #{data}\" if data.is_a?(String) && data.include?('No such')\n\n data = JSON.parse(data) if data.is_a?(String)\n\n @output[:relevant_output] = relevant_output( data, @git_files ) unless @git_files.blank?\n data = @output[:relevant_output] unless @settings[:commit].blank?\n data\n end", "def parse_bsd_line(line)\n finish_current_train\n train = TrainSchedule.new\n train.update_from_cif line\n @on_train_schedule_delete&.call self, train\n end", "def line_one\n return @line_one\n end", "def parse_line(row, db)\n case row[1]\n when 'b'\n return create_basic_food(row)\n when 'r'\n return create_recipe(row, db)\n else\n puts 'Invalid line in FoodDB.txt'\n end\n end", "def processed_header\n lineno = 0\n @processed_header ||= header.lines.map { |line|\n lineno += 1\n\n # Replace directive line with a clean break\n # Replace `#target` line with collect target application name\n\n unless directives.assoc(lineno).nil?\n \"\\n\"\n else\n \n line.scan(/^(\\#target) (\\S+.*?)$/) do |m1,m2|\n _app_name = m2.split(/[\\-|\\s]/).map{|x| x.gsub(/['|\"|;]/,\"\").downcase}\n _reg_name = Jsx::CS::REG_NAME[_app_name[0]]\n raise Jsx::Platform::UndeterminedApplicationError if _reg_name.nil?\n _vers = Jsx::CS::VERSIONS[_app_name[0]].invert\n _app_ver = (_app_name.size==1)? _vers[Jsx::CS::DEFAULTS[_app_name[0]]] : _app_name[1]\n line = line.gsub(m2,\"#{_reg_name}-#{_app_ver}\")\n end\n \n line\n end\n }.join.chomp\n end", "def process_record(text_line)\n text_line = pre_process(text_line)\n return pad_record(text_line)\n end", "def process\r\n in_loop = false\r\n in_example = false\r\n\r\n fh = File.open(@source_file, 'r:utf-8')\r\n fh.each do |line|\r\n line.chomp!\r\n line.gsub!(\"\\t\", \" \") # convert tab to 2 spaces\r\n \r\n # ensure first line as driver definition\r\n unless @driver\r\n if matches = /^#{regex_proc_head}DRIVER#{regex_proc_end}(?<dname_>\\w+)\\s*$/.match(line)\r\n @driver = Driver.create(matches[\"dname_\"]) \r\n self.dump(@driver.setup)\r\n next\r\n else\r\n raise \"You must specify a driver on the first line\"\r\n end\r\n end\r\n \r\n # interrupt for loops\r\n if matches = /#{regex_loop_line}/.match(line)\r\n in_loop = true\r\n @loop_start_ln = $.\r\n next\r\n end\r\n\r\n # expand and end current loop \r\n if in_example\r\n unless /#{regex_example_head}/.match(line)\r\n self.expand_loop\r\n in_example = false\r\n in_loop = false\r\n end\r\n end\r\n\r\n # end a loop template and start a loop example\r\n if in_loop\r\n in_example = true if /#{regex_example_head}/.match(line)\r\n end\r\n\r\n # dispatch the current line to different holders\r\n if in_example\r\n self.add_example_line line\r\n elsif in_loop\r\n @loop_template = @loop_template ? @loop_template + \"\\n\" + line : line\r\n else\r\n self.process_line line, $.\r\n end\r\n end\r\n fh.close\r\n\r\n # do not forget expand last loop if it reaches over EOF.\r\n self.expand_loop if @loop_start_ln > 0\r\n\r\n # close all remain stacks\r\n self.close_stack 0\r\n\r\n self.dump(@driver.exit)\r\n @output.close if @output_file\r\n self\r\n end", "def process_line_of_tsv_in_this_pipe line\n parts = line.strip.split(\"\\t\")\n case parts.size\n when 2\n timestamp = Time.now\n key, value = parts\n when 3\n key, value = parts[0..1]\n timestamp = Time.parse(parts.last)\n else\n error(\"Each line of input must be a tab separated row consisting of 2 columns (key, value) or 3 columns (timestamp, key, value)\")\n return\n end\n send_data(key, value, timestamp)\n end", "def processing_instruction(name, content); end", "def processing_instruction(name, content); end", "def on_processing_instruction(target, data)\n end", "def cook_line(raw_line)\n return nil if raw_line.nil?\n cooked_line = raw_line.lstrip.rstrip\n return nil if cooked_line.empty?\n cooked_line\n end", "def extract_raw_ruby_lines(haml_processed_ruby_code, first_line_index)\n haml_processed_ruby_code = haml_processed_ruby_code.strip\n first_line = @original_haml_lines[first_line_index]\n\n char_index = first_line.index(haml_processed_ruby_code)\n\n if char_index\n return [char_index, [haml_processed_ruby_code]]\n end\n\n cur_line_index = first_line_index\n cur_line = first_line.rstrip\n lines = []\n\n # The pipes must also be on the last line of the multi-line section\n while cur_line && process_multiline!(cur_line)\n lines << cur_line\n cur_line_index += 1\n cur_line = @original_haml_lines[cur_line_index].rstrip\n end\n\n if lines.empty?\n lines << cur_line\n else\n # The pipes must also be on the last line of the multi-line section. So cur_line is not the next line.\n # We want to go back to check for commas\n cur_line_index -= 1\n cur_line = lines.last\n end\n\n while HAML_PARSER_INSTANCE.send(:is_ruby_multiline?, cur_line)\n cur_line_index += 1\n cur_line = @original_haml_lines[cur_line_index].rstrip\n lines << cur_line\n end\n\n joined_lines = lines.join(\"\\n\")\n\n if haml_processed_ruby_code.include?(\"\\n\")\n haml_processed_ruby_code = haml_processed_ruby_code.gsub(\"\\n\", ' ')\n end\n\n haml_processed_ruby_code.split(/[, ]/)\n\n regexp = HamlLint::Utils.regexp_for_parts(haml_processed_ruby_code.split(/,\\s*|\\s+/), '(?:,\\\\s*|\\\\s+)')\n\n match = joined_lines.match(regexp)\n # This can happen when pipes are used as marker for multiline parts, and when tag attributes change lines\n # without ending by a comma. This is quite a can of worm and is probably not too frequent, so for now,\n # these cases are not supported.\n return if match.nil?\n\n raw_ruby = match[0]\n ruby_lines = raw_ruby.split(\"\\n\")\n first_line_offset = match.begin(0)\n\n [first_line_offset, ruby_lines]\n end", "def patches\n system \"cp src/Makefile.in src/Makefile.in.dos\"\n system \"tr -d '\\r' <src/Makefile.in.dos> src/Makefile.in\"\n DATA\n end", "def handle_text_line(line, record)\n line =~ record.match ? {:record_type => record.name, :line => line} : nil\n end", "def parse_line(lineno)\n @native_text[lineno] = @content_type_handler.parse_line( @list[lineno]) \n end", "def import_one_row_data(line)\n return if @file.nil? && @file.cell(line, 1).blank?\n company = import_company(line)\n unless company.new_record? || company.owner\n import_company_owner(company, line) \n end\n end", "def process_line(line)\n args = line.split\n cmd = args.shift\n \n catch(:command_not_found) { return process_command(cmd, args) }\n\n # no matching commands, try to process it as ruby code\n if @allow_ruby\n result = process_ruby_code(line)\n puts \" => #{result.inspect}\"\n return result\n end\n \n puts \"I don't know the word \\\"#{cmd}.\\\"\"\n end", "def process_attributes!\n if !@current_command_type.nil?\n @expression = Confinicky::Parsers::Expression.new(statement: @line.gsub(/\\A#{@current_command_type} /,\"\"))\n @name = @expression.name\n @value = @expression.value\n end\n end", "def process_command(command)\n model = generate_model_from_text_file(command[:filename])\n case command[:command]\n when 'list'\n list_todos(model)\n when 'add'\n add_one_todo(model, command[:modifier])\n when 'remove'\n remove_one_todo(model, command[:modifier])\n when 'complete'\n mark_todo_complete(model, command[:modifier])\n end\n save_model_to_text_file(command[:filename], model)\n end", "def process_input_file \n File.open(@file, 'r') do |f|\n f.each_line do |line|\n parse_line(line)\n end\n end\n end", "def first_line; end", "def first_line; end", "def first_line; end", "def first_line; end", "def first_line; end" ]
[ "0.5764406", "0.56965643", "0.563328", "0.5499889", "0.5335075", "0.5329485", "0.53235936", "0.5292877", "0.521437", "0.52138317", "0.51894873", "0.51529676", "0.50604826", "0.50520396", "0.5046127", "0.5037432", "0.50259346", "0.5001728", "0.49882397", "0.49559128", "0.49457222", "0.49228796", "0.49201864", "0.49156424", "0.4910719", "0.49018744", "0.48965114", "0.48560122", "0.48531112", "0.4824327", "0.48156434", "0.4811153", "0.4803476", "0.48015282", "0.47941488", "0.4783081", "0.47335878", "0.47148392", "0.47066838", "0.47014654", "0.4699878", "0.4697728", "0.46941757", "0.46935686", "0.46909887", "0.46879518", "0.46828654", "0.4678889", "0.46726918", "0.4667157", "0.46605313", "0.46577206", "0.4651425", "0.4638892", "0.46385926", "0.46243602", "0.4621903", "0.46053967", "0.4602136", "0.45895666", "0.4584116", "0.45840353", "0.45832825", "0.4581501", "0.45808885", "0.45808885", "0.45738545", "0.4573181", "0.45708266", "0.45566526", "0.45525604", "0.45507672", "0.45329365", "0.45328543", "0.4526986", "0.4525093", "0.4519632", "0.4510315", "0.4502558", "0.4501939", "0.44994205", "0.44955346", "0.44877487", "0.44877487", "0.44847625", "0.44831395", "0.44761238", "0.4475025", "0.44703948", "0.44688332", "0.44672912", "0.44668874", "0.44636288", "0.4462895", "0.4460947", "0.44569698", "0.44569698", "0.44569698", "0.44569698", "0.44569698" ]
0.5739876
1
Sets the location of the configuration YAML file and old deletes configurations.
def default_file=(file_path) @configuration = nil @defaults = nil @default_file = File.expand_path(file_path) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete( )\n File.delete(@configFileDNE)\n self.clear\n self\n end", "def delete_configuration\n super\n end", "def delete_configuration\n super\n end", "def reset\n @config_file = nil\n set_defaults\n load_from_file if config_file\n end", "def update_config\n if File.directory?(yolo_dir) and File.exist?(yaml_path)\n @yaml = YAML::load_file yaml_path\n update_yaml_setting(@yaml, \"deployment\", \"api_token\", \"example\")\n update_yaml_setting(@yaml, \"deployment\", \"team_token\", \"example\")\n end\n end", "def reload_config\n @config = nil\n end", "def revert_config\n config_temp = @config + '.tmp'\n return unless File.exist?(config_temp)\n\n File.delete(@config) if File.exist?(@config)\n File.rename(config_temp, @config)\n end", "def clean(mute=false)\n return if @options[:dirty]\n UI.say \"Cleaning up eb remote config and local files\" unless mute\n eb.delete_configuration_template(\n application_name: @updater.app_name,\n template_name: current_name\n ) unless @options[:noop]\n FileUtils.rm_f(@current_path)\n end", "def reset_configuration\n @configuration = nil\n end", "def save\n unless File.exist?(config_dir)\n FileUtils.mkdir_p(config_dir, :mode => 0700)\n end\n\n tmpfile = File.join(config_dir, \"tmpconfig_#{rand 999999}\")\n File.open(tmpfile, \"w\") do |f|\n YAML.dump(conf, f )\n end\n\n FileUtils.mv(tmpfile, config_file)\n end", "def destroy_database_configuration_file\n FileUtils.rm(database_configuration_file)\n end", "def reload_configuration!\n @configuration = nil\n end", "def reload_configuration!\n @configuration = nil\n end", "def unset_config(key)\n store :delete, \"configs/#{key}\"\n end", "def reset_config\n config.reset_to_defaults\n end", "def remove_config\n FileUtils.cd(self.project_root) { FileUtils.rm_rf \"config/environments/#{self.name}\" }\n end", "def delete(key)\n load_config unless @config\n @config.delete(key)\n save_config\n end", "def update_deprecated_config\n # return # Until further notice\n return if File.exist?(default_config_file)\n\n old_file = File.join(Util.user_home, '.doingrc')\n return unless File.exist?(old_file)\n\n Doing.logger.log_now(:warn, 'Deprecated:', \"main config file location has changed to #{config_file}\")\n res = Prompt.yn(\"Move #{old_file} to new location, preserving settings?\", default_response: true)\n\n return unless res\n\n if File.exist?(default_config_file)\n res = Prompt.yn(\"#{default_config_file} already exists, overwrite it?\", default_response: false)\n\n unless res\n @config_file = old_file\n return\n end\n end\n\n FileUtils.mv old_file, default_config_file, force: true\n Doing.logger.log_now(:warn, 'Config:', \"Config file moved to #{default_config_file}\")\n Doing.logger.log_now(:warn, 'Config:', %(If ~/.doingrc exists in the future,\n it will be considered a local config and its values will override the\n default configuration.))\n Process.exit 0\n end", "def delete(key)\n self.config.delete(key)\n end", "def load_config\n create_yolo_dir\n unless File.exist?(yaml_path)\n @formatter.config_created(yaml_path)\n FileUtils.cp_r(File.dirname(__FILE__) + \"/config.yml\", yaml_path)\n end\n end", "def delete_all_configurations\n super\n end", "def delete_all_configurations\n super\n end", "def reset\n self.configuration = Configuration.new\n end", "def reload_config!\n @config = nil\n load_config!\n self\n end", "def config_delete(name)\n Bundler.settings.set_local(name, nil)\n Bundler.settings.set_global(name, nil)\n end", "def reload_config\n @config = Configuration.new(@editor.path_to_current_file)\n end", "def set_config_paths\n @config_file_path = \"config/dissect/\"\n end", "def edit_yaml(yaml_location, &block)\n d = YAML.load_file(yaml_location)\n block.call(d)\n File.open(yaml_location, 'w') {|f| f.write d.to_yaml }\n end", "def clean\n Dir.foreach(@wd) do |file|\n next if file.start_with?('.') or (file == \"config\")\n filename = File.join(@wd, file)\n FileUtils.remove_file(filename) if File.file?(filename)\n end\n end", "def reset!\n self.configuration = Configuration.new\n end", "def deleteConfigFile(appName)\n @put.normal \"Removing Thin configuration for #{appName}\"\n configFile = \"/etc/thin/#{appName}.yml\"\n if File.exists?(configFile)\n removeCommand = @system.delete(configFile)\n if removeCommand.success?\n @put.confirm\n return 0\n else\n @put.error \"Could not delete Thin configuration\"\n return 1\n end\n else\n @put.error \"Config file non-existent\"\n return 1\n end\n end", "def reset\n @configuration = Configuration.new\n end", "def save_config\n config = $bot[:config].clone\n config.delete :client\n File.open \"./#{Twittbot::CONFIG_FILE_NAME}\", 'w' do |f|\n f.write config.to_yaml\n end\n end", "def reload_config\n @config = YAML.load_file('config/mse_router_info.yml')\n end", "def save_configuration\n File.open(config_file, \"w\") do |file|\n file.write(YAML.dump(@config))\n end\n end", "def delete(key)\n configuration.delete(key)\n end", "def config_file_path=(path)\n self.config_file_paths = [path]\n end", "def configure_databases_yml\n path = @path + '/config/databases.yml'\n unless File.readable?(path)\n raise \"Could not configure databases.yml. File is not writable!\"\n end\n fc = open(path).read\n path_backup = path + '.bak'\n unless File.exists?(path_backup)\n FileUtils::mv path, path_backup\n puts \"Copied databases.yml to #{path_backup}\" if @debug\n end\n fc.gsub!(/database:\\s*.+/, \"database: #{@db_name}\")\n fc.gsub!(/username:\\s*.+/, \"username: #{@db_user}\")\n fc.gsub!(/password:\\s*.+/, \"password: #{@db_password}\")\n open(path, 'w').print fc\n puts \"Configured databases.yml\" if @debug\n end", "def reset!\n @config = Configuration.new\n end", "def save()\n File.open(CONFIG_FILE, 'w'){ |f| f.write config.to_yaml } # Store\n end", "def delete(key)\n @configuration.delete(key)\n end", "def delete(key)\n @configuration.delete(key)\n end", "def delete(key)\n @configuration.delete(key)\n end", "def reset\n Configuration.new\n end", "def clear\n self.configuration = {}\n end", "def delete(key)\n @config.delete(key.to_s)\n end", "def save\n File.open(file_name, 'w') { |f| f.write config.to_yaml }\n end", "def reset\n @@config_instance = nil\n end", "def reset_config\n\t\t\t@config = {}\n\t\tend", "def cleanup_options\n # Ensure configuration file make reference to an absolute path.\n if options[:configuration_file]\n options[:configuration_file] = pathname(working_path, options[:configuration_file]).to_s\n end\n end", "def reset\n @config = {}\n write_config\n end", "def load_configuration\n @config = {\n :start_date => Date.today - 1,\n :data_dir => default_data_dir\n }\n\n if File.exist?(config_file)\n @config = YAML.load_file(config_file)\n end\n\n @config\n end", "def reset\n CONFIGURATION_DEFAULTS.each { |k, v| send(\"#{k}=\", v) }\n self\n end", "def rollback_to_seed_data\n File.open(@database_config_path, \"w\") do |file|\n file.puts @original_database_config\n end\nend", "def reset\n @config = Config.new\n end", "def clean_staging\n staging_config_file = '_config.staging.yml'\n File.delete staging_config_file if File.exists? staging_config_file\nend", "def sync_configuration!\n load_configuration_if_needed! and save\n save_configuration_if_needed!\n end", "def reset\n @config = empty_config\n end", "def save_configuration\n create_config_dir_if_needed\n\n if configuration_writable?\n File.write(configuration_path, configuration_data.deep_stringify_keys!.to_yaml)\n configuration_data = read_configuration\n else\n throw StandardError.new \"Configuration cannot be saved at '#{configuration_path}'\"\n end\n end", "def configure_manifest\n @configuration = YAML.load_file(manifest.to_s) if exist?\n end", "def reset\n @config = nil\n end", "def delete_all\n @configuration = nil\n end", "def delete_all\n @configuration = nil\n end", "def update_solr_config\n [:solr, :blacklight].each do |key|\n say_status(\"warning\", \"COPYING #{key}.YML\".upcase, :yellow)\n\n remove_file \"config/#{key}.yml\"\n copy_file \"config/solr.yml\", \"config/#{key}.yml\"\n end\n end", "def remove_config(name)\n\t\tend", "def apply_config(config_file_path)\n Backdat::Config.from_file(config_file_path)\n Backdat::Config.merge!(config)\n end", "def reset\n self.configuration = ({})\n config_contexts.values.each(&:reset)\n end", "def revert_database_config\n database_temp = @database + '.tmp'\n return unless File.exist?(database_temp)\n\n File.delete(@database) if File.exist?(@database)\n File.rename(database_temp, @database)\n end", "def generate\n FileUtils.cp DEFAULT_CONFIG, File.join(@path, 'config/rails_best_practices.yml')\n end", "def config_file_settings\n Chef::Config[:knife].save(false) # this is like \"dup\" to a (real) Hash, and does not include default values (just user set values)\n end", "def write_config\n File.open(@config_file, \"w\"){|f| YAML.dump(config, f)}\n end", "def delete_at index\n @config.delete_at index\n end", "def save_configuration\n if File.exist? determine_config_path\n bytes_required = File.size(determine_config_path)\n # Overwrite the current .config file with random bytes to eliminate\n # unencrypted credentials.\n # This won't account for COW filesystems or SSD wear-levelling but\n # is a best effort protection.\n random_bytes = SecureRandom.random_bytes(bytes_required)\n File.write(determine_config_path, random_bytes)\n else\n FileUtils.mkdir_p(Pathname.new(determine_config_path).dirname)\n end\n configuration.save\n end", "def save\n open @config_path, 'w' do |io|\n io.write({'files' => @files.collect(&:to_hash)}.to_yaml)\n end\n end", "def put_config config = { 'room' => [ { 'name' => 'default-room', 'device' => [ 'light' => { 'name' => 'default-device' } ] } ] }\n File.open( self.get_config_file, 'w' ) do | handle |\n handle.write YAML.dump( config )\n end\n self.get_config_file\n end", "def post_configure\n super\n @path = File.expand_path(path)\n end", "def clear_if_config_changed(config); end", "def change_base_url_to(url)\n puts \"Changing Base URL to #{url}..\"\n config = YAML.load_file('./config.yaml')\n config['base_url'] = url\n File.open('./config.yaml', 'w') do |file|\n file.write(config.to_yaml)\n end\nend", "def change_base_url_to(url)\n puts \"Changing Base URL to #{url}..\"\n config = YAML.load_file('./config.yaml')\n config['base_url'] = url\n File.open('./config.yaml', 'w') do |file|\n file.write(config.to_yaml)\n end\nend", "def change_base_url_to(url)\n puts \"Changing Base URL to #{url}..\"\n config = YAML.load_file('./config.yaml')\n config['base_url'] = url\n File.open('./config.yaml', 'w') do |file|\n file.write(config.to_yaml)\n end\nend", "def reload_configs\n Berkshelf.chef_config = chef_config\n\n # This fucking sucks...\n # load 'berkshelf/chef/config.rb'\n load \"berkshelf/config.rb\"\n\n Berkshelf.config = Berkshelf::Config.new\n nil\n end", "def clear_paths\n mutate_config(:paths) do |paths|\n paths.clear\n end\n end", "def configure_by_yaml(path=nil)\n unless path\n # Display file explorer\n path = Qt::FileDialog.getOpenFileName(self, \"Open configuration file\", \".\", \"YAML Files (*.yml *.yaml)\")\n end\n\n begin \n # Load configuration from YAML\n hash = YAML.load(open(path))\n \n # Sanity checks:\n error = nil\n \n if hash.keys.max > @container_hash.keys.max\n error = \"Higher position value in file than #containers available.\"\n elsif hash.size > @container_hash.size\n error = \"More config items in file than containers available.\"\n end\n \n if error\n msg_box = Qt::MessageBox.new\n msg_box.set_text(\"Problem with YAML import:\")\n msg_box.set_informative_text(error)\n msg_box.exec\n return\n end\n \n # Disconnect, update configuration and connect for each container\n hash.each do |pos, config|\n container = @container_hash[pos]\n container.disconnect\n container.configure_by_obj(config)\n container.connect if config\n end\n rescue Exception => e\n Vizkit.error \"A problem occured while trying to open '#{path}': \\n#{e.message}\"\n Vizkit.error e.backtrace.inspect \n end\n end", "def config_path=(path)\n config_file = YAML.load_file(path)\n config.merge!(config_file)\n setup_rabbitmq_opts\n rescue Errno::ENOENT => e\n self.host = \"localhost\"\n logger.error \"Could not find a baton configuration file at #{path}\"\n end", "def sync_configuration\n end", "def process_configuration\n self.configuration = YAML::load(File.read('.codecom.yml'))\n end", "def reconfig\n KEYS_AND_QUESTIONS.each do |key, question|\n ask_question_and_force_update_config(question, key)\n end\n config_update_success\n end", "def configuration_file\n @config_file_name ||= MyRhouse.confpath( \"#{config_file_name}.yml\" )\n end", "def save_yaml(path=nil)\n unless path\n # Display file explorer\n path = Qt::FileDialog.getSaveFileName(self, \"Save configuration file\", \"./myconfig.yml\", \"YAML Files (*.yml *.yaml)\")\n end\n\n begin\n config_hash = Hash.new\n @container_hash.each do |pos, container|\n config_hash[pos] = container.config\n end\n File.open(path, \"w\") {|f| f.write(config_hash.to_yaml) }\n rescue Exception => e\n Vizkit.error \"A problem occured while trying to write configuration to '#{path}': \\n#{e.message}\"\n end\n end", "def config_file=(config_file)\n @config_file = File.expand_path(config_file)\n end", "def clean!\n stop\n remove_instance_dir!\n FileUtils.remove_entry(config.download_path) if File.exists?(config.download_path)\n FileUtils.remove_entry(config.tmp_save_dir, true) if File.exists? config.tmp_save_dir\n md5.clean!\n FileUtils.remove_entry(config.version_file) if File.exists? config.version_file\n end", "def config_file_defaults\n Chef::Config[:knife].save(true) # this is like \"dup\" to a (real) Hash, and includes default values (and user set values)\n end", "def save( file = @hobix_yaml )\n unless file\n raise ArgumentError, \"Missing argument: path to save configuration (0 of 1)\"\n end\n File::open( file, 'w' ) do |f|\n YAML::dump( self, f )\n end\n self\n end", "def reset_configuration!\n @configuration = Auth::Configuration.new\n end", "def update_yaml_setting(yaml, key, setting, default)\n unless yaml[key][setting]\n yaml[key][setting] = default\n File.open(yaml_path, 'w') {|f|\n f.write(yaml.to_yaml)\n }\n @formatter.config_updated(yaml_path)\n end\n end", "def local_clear_yaml(pathname)\n basename = Pathname.new('.').expand_path\n Dir[basename.join(pathname).to_s].each do |post|\n yaml = File.read(post)[/\\A---(.|\\n)*?---/]\n File.open(post, 'w') do |file|\n file.puts yaml\n end\n end\nend", "def local_clear_yaml(pathname)\n basename = Pathname.new('.').expand_path\n Dir[basename.join(pathname).to_s].each do |post|\n yaml = File.read(post)[/\\A---(.|\\n)*?---/]\n File.open(post, 'w') do |file|\n file.puts yaml\n end\n end\nend", "def write\n require 'yaml'\n open config_file_name, 'w' do |io|\n io.write to_yaml\n end\n end", "def sync_config\n return unless config.config_files\n upload_files(config.config_files, release_path.join('config'))\n end", "def action_remove\n notifying_block do\n delete_config\n end\n end", "def config_files(override); end" ]
[ "0.6546112", "0.64143276", "0.64143276", "0.63878983", "0.6162204", "0.6139792", "0.60812825", "0.605352", "0.6051329", "0.6051111", "0.60418296", "0.60291165", "0.60291165", "0.60206574", "0.6003221", "0.59757495", "0.59426975", "0.58803165", "0.5862864", "0.5852922", "0.5841195", "0.5841195", "0.5820743", "0.58147675", "0.5760915", "0.57526124", "0.5750219", "0.5712842", "0.56527823", "0.5650202", "0.5622862", "0.56151766", "0.5600348", "0.5595969", "0.55932164", "0.5592199", "0.55911916", "0.5575098", "0.5556664", "0.5556566", "0.55527675", "0.55527675", "0.55527675", "0.55517906", "0.5537045", "0.55289567", "0.5527705", "0.5526607", "0.5525795", "0.55233586", "0.5513762", "0.55027795", "0.54924995", "0.54895455", "0.5486201", "0.54723454", "0.54679716", "0.54673636", "0.54386544", "0.54276127", "0.54207385", "0.53838366", "0.53838366", "0.537484", "0.53715", "0.5369557", "0.5362964", "0.5360477", "0.53599083", "0.53531724", "0.53286636", "0.53220457", "0.53147084", "0.5313456", "0.5285734", "0.52821237", "0.5279325", "0.5273571", "0.5273571", "0.5273571", "0.5269955", "0.5266073", "0.5265222", "0.52614796", "0.52540725", "0.5246074", "0.5242808", "0.52304745", "0.5223459", "0.5218051", "0.5217065", "0.5214601", "0.52073115", "0.52068883", "0.5205335", "0.5198701", "0.5198701", "0.51895195", "0.5188489", "0.51832503", "0.5182178" ]
0.0
-1
Sets the value of a config entry.
def []=(key, val) (@configuration ||= setup)[key.to_s] = val end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config=(value); end", "def cfg_set(key, value)\n hr_config.set_for_url(url.to_s, key, value)\n end", "def set_config(key, val)\n @config[key] = val\n end", "def set(key, *value)\n run { conf.set(key, value, config_params) }\n end", "def set_config(key, val)\n config[key] = val\n end", "def config_set key, value\n self.config\n end", "def []=(key, value)\n load_config unless @config\n @config[key] = value\n save_config\n end", "def []=(config_option, value)\n @configuration[config_option.to_sym] = value\n end", "def []=(key, value)\n @config[key.to_s] = value\n end", "def setConfig(key,value)\n @state.config[key] = value\n end", "def value=(config_value)\n set_lxd_config_value(resource[:config], config_value)\n end", "def set_config(key, value)\n return store(:set, \"configs/#{key}\", value).to_s\n end", "def []=(key, value)\n config[key] = value\n end", "def config_set key, value\n n_config = config.dup\n n_config[key]=value\n self.config= n_config\n end", "def config_set key, value\n n_config = config.dup\n n_config[key]=value\n self.config= n_config\n end", "def set(key, value)\n @mutex.synchronize { @config_hash[key] = value }\n end", "def set_config_set_value\n @config_set_value = ConfigSetValue.find(params[:id])\n end", "def []=(key, value)\n gitlib.command(:config, [key, value])\n config_hash[key] = value unless config_hash.empty?\n value\n end", "def set(key, value)\n settings.send :\"#{key}=\", value\n end", "def set(value)\n execute(:set, value)\n end", "def []=(key, val)\n configuration[key] = val\n end", "def set_config_value!(config_parent, key, value)\n #find the configuration\n configuration = config_parent.configurations.find_by(class_name: self.class.to_s, key: key)\n if !configuration.nil?\n configuration.create_or_update_config(self, value)\n end\n end", "def []=(key, val)\n (@configuration ||= setup)[key] = val\n end", "def []=(key, val)\n (@configuration ||= setup)[key] = val\n end", "def set(value)\n execute_only(:set, value)\n end", "def set!(path, value)\n setProperty path, value\n save if respond_to? :save # Only Configuration can save\n value\n end", "def set(name, value)\n update(name, value)\n end", "def value=(new_value)\n if @value.nil?\n @value = new_value\n else\n api.put_config_vars app.name, key => new_value\n @value = new_value\n end\n end", "def setter(section, setting, value)\n method = \"#{setting}=\"\n section.send(method, value) if section.respond_to?(method)\n end", "def []=(key, value)\n validate_key(key)\n return unless Radiant::Config.table_exists?\n # key must be in the form of a string for Radiant:Config\n key = key.to_s\n\n case key\n # TODO: Remove directory config entry since Rack cache does not use it.\n when /_directory$/\n value = validate_directory(value, key)\n @@live_config[key] = Radiant::Config[\"SnS.#{key}\"] = value\n when /_mime_type$/\n validate_mime_type(value, key)\n @@live_config[key] = Radiant::Config[\"SnS.#{key}\"] = value\n Radiant::Cache.clear\n end\n end", "def internal_set(symbol, value)\n if configurables.key?(symbol)\n configurables[symbol].set(configuration, value)\n elsif config_contexts.key?(symbol)\n config_contexts[symbol].restore(value.to_hash)\n else\n if config_strict_mode == :warn\n Chef::Log.warn(\"Setting unsupported config value #{symbol}.\")\n elsif config_strict_mode\n raise UnknownConfigOptionError, \"Cannot set unsupported config value #{symbol}.\"\n end\n configuration[symbol] = value\n end\n end", "def set(key, val)\n @config[key] = val.is_a?(Hash) ? val.with_indifferent_access : val\n self\n end", "def value=(value)\n debug \"set value\"\n file = Tempfile.new('openldap_confgi', '/tmp')\n begin\n file << \"dn: cn=config\\n\"\n file << \"changetype: modify\\n\"\n file << \"replace: #{name}\\n\"\n file << \"#{name}: #{value}\\n\"\n file.close\n # file.path\n Puppet.debug(IO.read file.path)\n\n begin\n ldapmodify(['-Y','EXTERNAL','-H','ldapi:///','-f',file.path])\n rescue Exception => e\n raise Puppet::Error, \"LDIF content:\\n#{IO.read file.path}\\nError message: #{e.message}\"\n end\n ensure\n file.unlink\n end\n @property_hash[:value] = value\n end", "def e_set_setting(key, value)\n set_option(key, value, '_setting_ecommerce')\n end", "def configure_setting(name, value)\n configure do |settings|\n settings.unset!(name)\n settings[name] = parse_setting(settings.setting(name), value)\n end\n end", "def set(key, value)\n return nil if not key\n\n key = key.to_sym if key.class == String\n section = ForjDefault.get_meta_section(key)\n\n return @oConfig.set(key, value) if not section\n return nil if readonly?(key)\n _set(section, key, value)\n end", "def set_adhoc_config_value!(key, value, data_type='String')\n config = \"UniversalAr::Config#{data_type.to_s.titleize}\".classify.constantize.find_or_create_by(subject: self, key: key)\n config.update(value: value)\n end", "def tcfg_set(key, value)\n tier_code_defaults[key] = value\n tcfg_reset\n value\n end", "def set_value(value)\n @value = value\n end", "def set(value)\n value\n end", "def setConf(key, value)\n @conf[key] = value ;\n end", "def cset item, key, val\n @item_config[item][key] = val\n self\n end", "def []=(name, value)\n raise FrozenConfigError, \"Cannot modify frozen config\" if frozen?\n\n name = name.to_sym\n\n unless (setting = _settings[name])\n raise ArgumentError, \"+#{name}+ is not a setting name\"\n end\n\n _configured.add(name)\n\n _values[name] = setting.constructor.(value)\n end", "def setting(nested_key, value)\n settings.set(nested_key, value)\n save_settings!\n end", "def set_value(value)\n send(\"set_#{value[:type]}_value\", value)\n end", "def value=( val )\n data[ address ] = val\n end", "def []=(key, val)\n setting_obj = setting(key) || define_setting(key)\n setting_obj.value = val\n end", "def []=( section, value )\n @ini[section.to_s] = value\n end", "def set(setting, value = nil)\n if value\n command \"set #{setting}=#{value}\"\n else\n command \"set #{setting}\"\n end\n self\n end", "def setconfig(key, val, store=config_store)\n return store.transaction { store[key] = val }\nend", "def set(k, v)\n settings[k.to_sym] = v\n end", "def setting=(value)\n @setting = value\n end", "def []=(k, v)\n @my_conf[k] = v\n end", "def set(name, value)\n validate_parameter_type(options['type'])\n parameter = get_parameter(name)\n parameter = create_parameter(parameter, options['type'], options['key']) unless parameter.exists?\n parameter.write!(value)\n puts parameter.to_s\n end", "def set(k, v)\n settings[k.to_sym] = v\n end", "def setValue(value)\n @value = value\n end", "def write_config_entry(key, value)\n if $has_config.call then\n curr_config = YAML.load(File.read($config_filename))\n else\n curr_config = {}\n end\n\n curr_config[key] = value\n\n File.open($config_filename, 'w') { |f| f.write(curr_config.to_yaml) }\nend", "def set(key, value)\n Lib.set @path, @no_follow, key.to_s, value.to_s\n end", "def set_value( value )\n @value = value \n end", "def []=(name, value)\n @ldap_entry[name] = value\n end", "def set\n requires_preauth\n unless args.size > 0 and args.all? { |a| a.include?('=') }\n error(\"Usage: heroku config:set KEY1=VALUE1 [KEY2=VALUE2 ...]\\nMust specify KEY and VALUE to set.\")\n end\n\n vars = args.inject({}) do |v, arg|\n key, value = arg.split('=', 2)\n v[key] = value\n v\n end\n\n action(\"Setting config vars and restarting #{app}\") do\n api.put_config_vars(app, vars)\n\n @status = begin\n if release = api.get_release(app, 'current').body\n release['name']\n end\n rescue Heroku::API::Errors::RequestFailed\n end\n end\n\n vars.each {|key, value| vars[key] = value.to_s}\n styled_hash(vars)\n end", "def assign(config, value)\n if key\n nest_config = nest(config)\n nest_config[key] = value\n end\n\n @assigned = true\n config\n end", "def set(*indices, value)\n set_root @config, value, *indices\n end", "def value=(v)\n set(v)\n end", "def set(varname, value)\n if varname =~ /^\\./ || varname =~ /\\.$/ || varname.length == 0\n raise \"Invalid variable name\"\n end\n\n conf[varname.to_s] = value\n\n save\n end", "def set_config(key, value)\n system(\"git config --global #{key} '#{value}'\")\n end", "def set_config(key, value)\n\n # TODO Currently protected and private settings are not\n # excluded from the inheritance chain, so this error would\n # only be raised if someone typoed a key.\n raise \"#{key} is not a registered or inherited configuration option for #{self.class}\" \\\n unless self.class.default_config.keys.include?(key.to_s)\n\n default_value = self.class.default_config[key][1]\n value = default_value if value == :default\n config = configurations.where('key = ?', key.to_s).first\n if config\n if value == default_value # setting back to default\n config.destroy\n else\n config.update_attributes(value: value.to_s) # changing a custom setting\n end\n else\n return true if value == default_value # don't create a record for the default\n configurations.create(key: key.to_s, value: value.to_s)\n end\n end", "def set_setting\n end", "def set(key, value)\n change(:set, key, value)\n end", "def set_value(node, path, value)\n path = path.to_s.split('.') unless path.is_a?(Array)\n\n path[0..-2].each_index { |i|\n key = path[i]\n if node.is_a?(Hash)\n key = key.to_sym\n unless node.has_key?(key)\n node[key] = attempt_key_to_int(path[i + 1]).nil? ? {} : []\n end\n node = node[key]\n elsif node.is_a?(Array)\n key = key_to_int(key)\n if key < node.length && -node.length < key\n node = node[key]\n else\n entry = attempt_key_to_int(path[i + 1]).nil? ? {} : []\n if key < -node.length\n node.unshift(entry)\n else\n node[key] = entry\n end\n node = entry\n end\n else\n raise WAB::TypeError, \"Can not set a member of an #{node.class}.\"\n end\n }\n\n key = path[-1]\n\n if node.is_a?(Hash)\n node[key.to_sym] = value\n elsif node.is_a?(Array)\n key = key_to_int(key)\n if key < -node.length\n node.unshift(value)\n else\n node[key] = value\n end\n else\n raise WAB::TypeError, \"Can not set a member of an #{node.class}.\"\n end\n value\n end", "def set(item, value)\n run(\"#{ item } #{ value }\")\n end", "def update(config, value)\n return if unsupported? config\n value = process_input(config, value)\n updated = __update_configuration(config, value)\n value = \"__empty_string__\" if is_blank?(value)\n if updated\n say_success \"Updated configuration: #{config} => #{value}\"\n else\n say_failed \"Could not update configuration: #{config}\"\n end\n end", "def []=(key, val)\n item = find_item(key)\n if item\n @values.set_value(item.key, Settings.parse(val, item.type))\n end\n val\n end", "def []=(path,value)\n set(path, value)\n end", "def config_set(id,valor)\n Configuration.set(id,valor)\n end", "def set(receiver, value)\n unless value.respond_to?(:config)\n value = default.merge(value)\n value = type.init(value)\n end\n \n receiver.send(writer, value)\n end", "def set(key, value)\n end", "def update_jtag_config(cfg, val)\n if JTAG_CONFIG.key?(cfg)\n JTAG_CONFIG[cfg] = val\n else\n fail \"#{cfg} not a part of JTAG_CONFIG\"\n end\n end", "def set(value)\n if (value == 0) || (value == 1)\n IO.write(VALUE % @pin, \"%d\" % value)\n else\n raise \"invalid value #{value.inspect}\"\n end\n end", "def value=(v)\n connection.set(key, v)\n end", "def set_property(name, value)\n Config::Collection.set(name, value)\n end", "def []=(key, value)\n set(key, :val => value)\n end", "def set(value)\n @value = value\n info \"#{name} = #{value.inspect} (#{value.class})\"\n @change_observers.each { |proc| proc.call(value) }\n OmfEc.experiment.log_metadata(name, value, :prop)\n end", "def set(object, value); end", "def set_field_value(name, value)\n\t\tend", "def set(option, value)\n @context.send \"#{option}=\".to_sym, value\n end", "def set(value)\n @value = value\n #info(@name, ' = ', value.inspect, '(type:', value.class,')')\n info(\"#{@name} = #{value.inspect} (#{value.class})\")\n @changeListeners.each { |l|\n l.call(value)\n }\n TraceState.property(@name, :set, {'value' => value.inspect})\n end", "def set(value)\n @value = value\n #info(@name, ' = ', value.inspect, '(type:', value.class,')')\n info('value = ', value.inspect, ' (',value.class,')')\n @changeListeners.each { |l|\n l.call(value)\n }\n TraceState.property(@name, :set, {'value' => value.inspect})\n end", "def set_value value\n if allows? value\n @set_value_handler.call value\n end\n end", "def set(key, value)\n subkeys = key.split('.').reverse\n return false if subkeys.empty?\n\n hash = { subkeys.shift.to_s => value }\n subkeys.each { |v| hash = { v.to_s => hash } }\n @config = @config.deep_merge hash\n true\n end", "def set_to(value)\n @native.set_current_value(value)\n end", "def set(key, value); end", "def set(key, value); end", "def config_set_app_setting(document, settingName, settingValue)\n\t config_set_attribute(document, '//configuration/appSettings/add', 'key', settingName, 'value', settingValue)\n\tend", "def []=(key, value)\n if config = configs[key]\n config.set(receiver, value)\n else\n store[key] = value\n end\n end", "def app_config_key_value=(value)\n @app_config_key_value = value\n end", "def app_settings=(value)\n @children['app-settings'][:value] = value\n end", "def app_settings=(value)\n @children['app-settings'][:value] = value\n end", "def set(key, value, **options); end", "def set(val)\n @value = val\n @http_value = nil\n self\n end" ]
[ "0.71924496", "0.7010172", "0.692519", "0.68895197", "0.688462", "0.68385464", "0.6832461", "0.6806092", "0.67972547", "0.6754969", "0.6753217", "0.6752761", "0.67244047", "0.66976887", "0.66976887", "0.65687174", "0.6543687", "0.6480943", "0.6462865", "0.642735", "0.64197123", "0.6390188", "0.63678217", "0.63678217", "0.63543695", "0.63450676", "0.6327298", "0.6310321", "0.630055", "0.6284984", "0.6279526", "0.6279436", "0.62583435", "0.6250271", "0.6248581", "0.6234553", "0.62112486", "0.619477", "0.61884016", "0.6180905", "0.61801493", "0.6147752", "0.61283094", "0.61258787", "0.6116102", "0.61119443", "0.61086", "0.61056614", "0.6077191", "0.6072269", "0.60652596", "0.60545534", "0.6049796", "0.60473424", "0.60263145", "0.60215545", "0.60194355", "0.6016404", "0.6002527", "0.59831345", "0.5970625", "0.5967097", "0.5965174", "0.59577346", "0.5939811", "0.5902362", "0.59018564", "0.5878274", "0.5869273", "0.58637244", "0.58612055", "0.58504915", "0.5844855", "0.58358747", "0.58300066", "0.5828158", "0.5822963", "0.581991", "0.58196914", "0.5817974", "0.5816206", "0.580501", "0.5797765", "0.57923794", "0.57826984", "0.57792664", "0.5775077", "0.5774393", "0.57711107", "0.5766357", "0.5764935", "0.5760506", "0.5760506", "0.5760274", "0.5733225", "0.5726691", "0.57258266", "0.57258266", "0.57192427", "0.57054883" ]
0.6562834
16
Remove the value of a config entry.
def delete(key) @configuration.delete(key) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_configuration(value)\n @children['configuration'][:value].delete(value)\n end", "def remove(key)\n\t\t\tvalue = @config.shift(key)\n\t\t\treturn value\n\t\tend", "def remove(value)\n connection.zrem(key_label, value)\n end", "def delete(key)\n @config.delete(key.to_s)\n end", "def delete(key)\n self.config.delete(key)\n end", "def remove_value(value)\n @children['value'][:value].delete(value)\n end", "def delete(key)\n load_config unless @config\n @config.delete(key)\n save_config\n end", "def remove_config(name)\n\t\tend", "def remove_config(name)\n variables[name] = nil\n end", "def unset_config(key)\n store :delete, \"configs/#{key}\"\n end", "def delete_setting!(header, name)\n write do \n contents.gsub(find_setting(header, name), '')\n end\n end", "def remove_thing(value)\n @children['thing'][:value].delete(value)\n end", "def remove_thing(value)\n @children['thing'][:value].delete(value)\n end", "def remove_version_info(value)\n @children['version-info'][:value].delete(value)\n end", "def config_delete(name)\n Bundler.settings.set_local(name, nil)\n Bundler.settings.set_global(name, nil)\n end", "def destroy\n @config_value = ConfigValue.find(params[:id])\n @config_value.destroy\n\n redirect_to config_values_url\n end", "def destroy\n @config_value = ConfigValue.find(params[:id])\n @config_value.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_config_values_url) }\n format.xml { head :ok }\n end\n end", "def delete(key)\n configuration.delete(key)\n end", "def remove_entry(path)\n aug.rm(path_to_remove(path))\n end", "def remove(entry)\n @entry_set.delete(get_entry(entry))\n end", "def remove(remove_slot = params[\"remove\"])\n\t\tsession[Constants::SESS_MY_CONFIG].remove(remove_slot)\n\t\tgo_to_config\n\tend", "def unset(key)\n run { conf.unset(key, config_params) }\n end", "def unset!(name)\n (s = setting(name)) && s.unset!\n end", "def remove_record(value)\n @children['record'][:value].delete(value)\n end", "def remove_record(value)\n @children['record'][:value].delete(value)\n end", "def hash_delete(field)\n choose do |menu|\n menu.prompt = \"Please select to remove: \"\n menu.index = :number\n menu.index_suffix = ') '\n menu.choice(:quit, 'Quit') {result = false}\n values = []\n AppConfig.config[field].each do |key, value|\n values << \"#{key} => #{value}\"\n end\n menu.choices(*values) do |value, details|\n if value =~ /(.*\\S)\\s+=>/\n AppConfig.config[field].delete($1)\n end\n end\n end\n end", "def unset_value(key)\n database.delete(key)\n removed_keys << key\n end", "def remove_unprocessed_thing_key_info(value)\n @children['unprocessed-thing-key-info'][:value].delete(value)\n end", "def delete(value)\n @data.delete value\n value\n end", "def remove_route(value)\n @children['route'][:value].delete(value)\n end", "def remove(entry); end", "def cfg_remove(cfg,member)\n obj_remove(cfg,ZoneConfiguration,member)\n end", "def remove_token(value)\n @children['token'][:value].delete(value)\n end", "def remove_config(key, options={})\n unless config_registry.has_key?(key)\n raise NameError.new(\"#{key.inspect} is not a config on #{self}\")\n end\n \n options = {\n :reader => true,\n :writer => true\n }.merge(options)\n \n config = config_registry.delete(key)\n cache_configurations(@configurations != nil)\n \n undef_method(config.reader) if options[:reader]\n undef_method(config.writer) if options[:writer]\n end", "def delete(val)\n count = self.lrem(0, val)\n if count > 0\n val\n else\n nil\n end\n end", "def delete_property(name)\n Config::Collection.delete(name)\n end", "def clear(option)\n @client.call('config.unset', option)\n end", "def delete_value value\r\n #find the pointer to the wanted node using LIST-SEARCH(value)\r\n #then delete that node with LIST-DELETE-BY-NODE(node)\r\n delete_node(self.search(value))\r\n end", "def remove_extension_item(value)\n @children['extension-item'][:value].delete(value)\n end", "def remove_highest(var)\n @configs.each do |c|\n if c.key?(var)\n return c.delete(var)\n end\n end\n\n # return nil if we haven't returned a value yet\n nil\n end", "def remove(value)\n if value.kind_of? Array\n value.each { |v| remove(v) }\n else\n value = PublicEarth::Db::Base.as_id(value)\n value = value.id if value.is_a? Atlas::Place\n value.strip! if value.kind_of? String\n @values.delete(value)\n end\n end", "def remove_package(value)\n @children['package'][:value].delete(value)\n end", "def delete(symbol)\n configuration.delete(symbol)\n end", "def subtract(key, value)\n run { conf.subtract(key, value, config_params) }\n end", "def destroy\n @config_set_value.destroy\n respond_to do |format|\n format.html { redirect_to config_set_values_url, notice: 'Config set value was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def rem(key, value)\n log(\"get :Deltas, #{key}, #{cache_name(value)}\")\n timestamp = connection.get(:Deltas, key, cache_name(value))\n\n log(\"remove :Deltas, #{key} -> #{timestamp_name(timestamp)}\")\n connection.remove(:Deltas, key, timestamp_name(timestamp))\n\n log(\"remove :Deltas, #{key} -> #{cache_name(value)}\")\n connection.remove(:Deltas, key, cache_name(value))\n end", "def delete_at index\n @config.delete_at index\n end", "def unset\n requires_preauth\n if args.empty?\n error(\"Usage: heroku config:unset KEY1 [KEY2 ...]\\nMust specify KEY to unset.\")\n end\n\n args.each do |key|\n action(\"Unsetting #{key} and restarting #{app}\") do\n api.delete_config_var(app, key)\n\n @status = begin\n if release = api.get_release(app, 'current').body\n release['name']\n end\n rescue Heroku::API::Errors::RequestFailed\n end\n end\n end\n end", "def shell_registry_deleteval(key, valname, view)\n key = normalize_key(key)\n # REG DELETE KeyName [/v ValueName | /ve | /va] [/f]\n shell_registry_cmd_result(\"delete \\\"#{key}\\\" /v \\\"#{valname}\\\" /f\", view)\n end", "def deregister_setting(key)\n res = @defaults.delete(key)\n\n # update cache\n @settings.delete(key)\n\n return res\n end", "def remove value\n return false if value.nil?\n\n index = map_get_index_of(value)\n remove_at(index) unless index.nil?\n\n return !index.nil?\n end", "def remove(value)\n @client.execute_udf(@key, @PACKAGE_NAME, 'remove', [@bin_name, value], @policy)\n end", "def delete_value(value)\n keys = @reverse[value]\n @reverse.delete value\n keys.each {|key| @hash.delete(key) }\n end", "def delete(value)\n @driver_instance.delete_list_value(@key, value)\n end", "def registry_deleteval(key, valname, view = REGISTRY_VIEW_NATIVE)\n if session_has_registry_ext\n meterpreter_registry_deleteval(key, valname, view)\n else\n shell_registry_deleteval(key, valname, view)\n end\n end", "def delete(value)\n find_node(value)&.delete\n end", "def remove_terms_of_use_url(value)\n @children['terms-of-use-url'][:value].delete(value)\n end", "def remove_image(value)\n @children['image'][:value].delete(value)\n end", "def delete_entry(key, options)\n @hash.delete(key)\n end", "def lrem(key, count, value)\n node_for(key).lrem(key, count, value)\n end", "def action_remove\n notifying_block do\n delete_config\n end\n end", "def remove(val)\n return false unless @hh.key?(val)\n @hh.delete(val)\n return true\n end", "def rm_service_configuration(config_hash)\n st = match_node_keys(@registry, config_hash, full_address)\n remove_tree_entry(st) if st.is_a?(Tree::TreeNode)\n end", "def remove_permission(value)\n @children['permission'][:value].delete(value)\n end", "def clear_if_config_changed(config); end", "def config_uncache(key)\n cnf = nil\n lock(:c) do\n cnf = @cache[:c].delete(key)\n end\n log cnf ?\n \"config #{key} deleted\" :\n \"config #{key} not cached, not deleted\"\n cnf\n end", "def lrem(key, count, value)\n send_command([:lrem, key, Integer(count), value])\n end", "def clear(config)\n Array(config).each do |setting|\n delete_setting setting\n end\n end", "def unset_lxd_config_value(config_array)\n begin\n output = lxc(['config', 'unset', config_array].flatten!)\n rescue Puppet::ExecutionFailure => e\n Puppet.debug(\"Cannot unset config with lxc config: #{e.inspect}\")\n return nil\n else\n return true\n end\n end", "def remove(entry_point)\n entry_point = entry_point.name if entry_point.kind_of? Borges::Application\n val = @entry_points.delete(entry_point)\n end", "def cfgremove(fabrickey, cfgname, *zonenames)\n result = @zones.altercfg(fabrickey, 'REMOVE', cfgname, *zonenames)\n result[1]\n end", "def remove_public_key(value)\n @children['public-key'][:value].delete(value)\n end", "def remove_value(column_name, val)\n send(\"#{column_name}=\", send(column_name) & ~val)\n end", "def remove_group(value)\n @children['group'][:value].delete(value)\n end", "def delete(value)\n delete_node(find(value))\n end", "def remove(name)\n @configuration_names.delete(name)\n @configurations.delete(name)\n # Clear the current configuration tree and then refresh the whole tree.\n clear\n refresh\n end", "def remove!(entry)\n rel_path = Wide::PathUtils.relative_to_base(base_path, entry.path)\n\n cmd = cmd_prefix.push('rm', '-f', \"path:#{rel_path}\")\n shellout(Escape.shell_command(cmd))\n\n raise CommandFailed.new(\"Failed to remove file #{src_path} in the Mercurial repository in #{base_path}\") if $? && $?.exitstatus != 0\n end", "def remove_exception_set(value)\n @children['exception-set'][:value].delete(value)\n end", "def remove_limiter_value(id, val)\n add_actions \"RemoveLimiterValue(#{id}:#{val})\"\n end", "def delete(value)\n @hash.delete(value) && @hash.send(:convert_key, value)\n end", "def unregister(option)\n @registry.delete(option)\n @options.delete_if {|key, value| option == value }\n option\n end", "def delete_env_var key, val\n key = key.to_s\n env_file = self[:ssh_env_file]\n val = Regexp.escape(val).gsub('/', '\\/').gsub(';', '\\;')\n # if the key only has that single value remove the entire line\n exec(Beaker::SedCommand.new(self['platform'], \"/#{key}=#{val}$/d\", env_file))\n # value in middle of list\n exec(Beaker::SedCommand.new(self['platform'], \"s/#{key}=\\\\(.*\\\\)[;:]#{val}/#{key}=\\\\1/\", env_file))\n # value in start of list\n exec(Beaker::SedCommand.new(self['platform'], \"s/#{key}=#{val}[;:]/#{key}=/\", env_file))\n # update the profile.d to current state\n # match it to the contents of ssh_env_file\n mirror_env_to_profile_d(env_file)\n end", "def cfg_delete(cfg)\n obj_delete cfg, ZoneConfiguration\n end", "def remove_target_set(value)\n @children['target-set'][:value].delete(value)\n end", "def remove(value)\n\t\t\n\t\tnode = @head\n\t\twhile node.value.sal != value do\n\t\t\tnode = node.next\n\t\tend\n\t\t\n\t\tif node != nil\n\t\t\n\t\t\tif node != @head\n\t\t\t\tnode.prev.next = node.next\n\t\t\telse\n\t\t\t\t@head = node.next\n\t\t\tend\n\n\t\t\tif node != @tail\n\t\t\t\tnode.next.prev = node.prev\n\t\t\telse\n\t\t\t\t@tail = node.prev\n\t\t\tend\n\n\t\t\t@size-=1\n\t\tend\t\t\t\n\t\t\t\t\n\tend", "def remove(branch)\n target_entry = entries.find { |e| e['branch_name'] == branch }\n target_entry['removed'] = true if target_entry\n end", "def delete_attribute(key); end", "def remove_reason(value)\n @children['reason'][:value].delete(value)\n end", "def delete_field_value(id)\n delete(\"fieldValues/#{id}\")\n end", "def delete_entry(key, **options); end", "def remove(predicate, value = nil)\n ActiveRDF::FederationManager.delete(self, predicate, value)\n end", "def delete_option(key, meta_key = \"_default\")\n values = cama_options(meta_key)\n key = key.to_sym\n values.delete(key) if values.has_key?(key)\n set_meta(meta_key, values)\n end", "def del(key)\n position = find(key)\n if position != nil\n # delete\n value = @values[position]\n @slots[position] = nil\n @values[position] = nil\n value\n else\n nil\n end\n end", "def remove(value)\n if self.include?(value)\n if head.data == value\n remove_head(value, head)\n else\n remove_value(value, head)\n end\n else\n return nil\n end\n end", "def remove_privacy_statement_url(value)\n @children['privacy-statement-url'][:value].delete(value)\n end", "def delete_option(name)\n @options.delete(name)\n end", "def delete(key)\n dummy = Pair.new(key,nil)\n pair = @tree.remove(dummy)\n return nil unless pair\n return pair.value\n end", "def remove(num)\n self[num].delete(num) if include?(num)\n end" ]
[ "0.73884994", "0.7178903", "0.71487164", "0.6921228", "0.68019474", "0.67671424", "0.6677443", "0.66625893", "0.66153365", "0.6447354", "0.6440813", "0.6440767", "0.6440767", "0.6380671", "0.6372172", "0.63495606", "0.6304644", "0.6278421", "0.6267512", "0.62208825", "0.6183584", "0.6176215", "0.61671627", "0.615562", "0.615562", "0.61250734", "0.6049201", "0.603678", "0.60330945", "0.6009024", "0.59926635", "0.5974901", "0.59618956", "0.59617937", "0.5939141", "0.5904078", "0.5876872", "0.58751535", "0.58727324", "0.58553576", "0.58503187", "0.58494276", "0.5806736", "0.57912713", "0.578314", "0.57515156", "0.57397616", "0.57391083", "0.57374775", "0.57350117", "0.5729375", "0.56861126", "0.5678292", "0.56651235", "0.56607735", "0.5642998", "0.56362754", "0.5633912", "0.5633189", "0.5622091", "0.5604214", "0.56031954", "0.5600617", "0.5599136", "0.5596181", "0.5586318", "0.55839396", "0.55839276", "0.55789524", "0.5566588", "0.556281", "0.5562165", "0.5561565", "0.5548647", "0.5545133", "0.5532152", "0.5513674", "0.55006886", "0.5499671", "0.54937494", "0.54901123", "0.54883695", "0.54842967", "0.5479573", "0.5478984", "0.545711", "0.5447598", "0.54437816", "0.54409224", "0.5431721", "0.54275876", "0.54259694", "0.54252267", "0.5424011", "0.54163384", "0.5414429", "0.5386538", "0.53786695" ]
0.6052736
28
Remove all configuration. This can be useful for testing purpose.
def delete_all @configuration = nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_all_configurations\n super\n end", "def delete_all_configurations\n super\n end", "def clear\n self.configuration = {}\n end", "def clear(config)\n Array(config).each do |setting|\n delete_setting setting\n end\n end", "def reset_configuration\n @configuration = nil\n end", "def remove\n remove_checkpoints\n remove_config\n remove_hiera_template\n end", "def reset\n @config = nil\n end", "def reset\n @config = empty_config\n end", "def delete_configuration\n super\n end", "def delete_configuration\n super\n end", "def reset_config\n config.reset_to_defaults\n end", "def clear\n @mutex.synchronize do\n raise ConfigurationLockedError if @locked\n @patterns.clear\n @types.clear\n @categories.clear\n @methods.clear\n end\n self\n end", "def reset\n self.configuration = ({})\n config_contexts.values.each(&:reset)\n end", "def clear_properties\n Config::Collection.clear\n end", "def reset\n self.configuration = Configuration.new\n end", "def reset_config\n\t\t\t@config = {}\n\t\tend", "def reset_config!\n @log = nil\n @logger = nil\n @log_level = nil\n end", "def reset_config!\n @log = nil\n @logger = nil\n @log_level = nil\n end", "def reset\n Configuration.new\n end", "def reset!\n @config = Configuration.new\n end", "def reset\n @@config_instance = nil\n end", "def clear!\n defined_settings.each {|setting| instance_variable_set(\"@#{setting}\", nil)}\n @storage_adapters = []\n @cached_paths = {}\n end", "def remove(name)\n @configuration_names.delete(name)\n @configurations.delete(name)\n # Clear the current configuration tree and then refresh the whole tree.\n clear\n refresh\n end", "def remove_config(name)\n\t\tend", "def reset\n @configuration = Configuration.new\n end", "def config_delete(name)\n Bundler.settings.set_local(name, nil)\n Bundler.settings.set_global(name, nil)\n end", "def reset\n @config = Config.new\n end", "def reset\n @config = {}\n write_config\n end", "def reset!\n self.configuration = Configuration.new\n end", "def clean\n Dir.foreach(@wd) do |file|\n next if file.start_with?('.') or (file == \"config\")\n filename = File.join(@wd, file)\n FileUtils.remove_file(filename) if File.file?(filename)\n end\n end", "def clean\n (config.keys - ['image']).each { |name|\n env = env(name, name)\n env.clean!\n }\n end", "def remove_config\n FileUtils.cd(self.project_root) { FileUtils.rm_rf \"config/environments/#{self.name}\" }\n end", "def reload_config\n @config = nil\n end", "def reset\n reset_config\n reset_driver\n end", "def reset\n configure({})\n end", "def action_remove\n notifying_block do\n delete_config\n end\n end", "def reset\n VALID_CONFIG_OPTIONS.each { |opt| self.send(\"#{opt}=\", nil) }\n self.logger = nil\n end", "def reset(options={})\n options = {\n :clear => true\n }.merge(options)\n\n registry.each do |option|\n if option.respond_to?(:reset)\n option.reset\n end\n end\n\n config.clear if options[:clear]\n self\n end", "def reload_configuration!\n @configuration = nil\n end", "def reload_configuration!\n @configuration = nil\n end", "def unset_config(key)\n store :delete, \"configs/#{key}\"\n end", "def clear_all\n clear_modules\n end", "def cleanup(config_store, verbose, cache_root = T.unsafe(nil)); end", "def remove_config(name)\n variables[name] = nil\n end", "def clear_tags\n keys_to_remove = extra_config_keys\n\n spec_hash =\n keys_to_remove.map {|key| { :key => key, :value => '' } }\n\n spec = RbVmomi::VIM.VirtualMachineConfigSpec(\n :extraConfig => spec_hash\n )\n @item.ReconfigVM_Task(:spec => spec).wait_for_completion\n end", "def reset\n @config = nil\n @client = nil\n end", "def reset\n VALID_CONFIG_OPTIONS.each { |opt| self.reset_attribute(opt) }\n end", "def clear_if_config_changed(config); end", "def reset!\n default_tags.clear\n adapters.clear\n groups.each_key { |group| singleton_class.send(:remove_method, group) if group && respond_to?(group) }\n @groups = nil\n metrics.each_key { |metric| singleton_class.send(:remove_method, metric) if respond_to?(metric) }\n @metrics = nil\n collectors.clear\n configurators.clear\n instance_variable_set(:@configured_by, nil)\n instance_variable_set(:@debug_was_enabled_by, nil)\n end", "def reset\n reset_adapters\n reset_config\n reset_handlers\n reset_hooks\n end", "def unset_settings(names)\n configure do |settings|\n names.each { |name| settings.unset!(name) }\n end\n end", "def reset\n (@settings||{}).each do |name,instance| \n remove_setter(name)\n remove_getter(name)\n remove_boolean_getter(name)\n instance.destroy\n end\n @settings = Hash.new\n end", "def clear_paths\n mutate_config(:paths) do |paths|\n paths.clear\n end\n end", "def clean!\n stop\n remove_instance_dir!\n FileUtils.remove_entry(config.download_path) if File.exists?(config.download_path)\n FileUtils.remove_entry(config.tmp_save_dir, true) if File.exists? config.tmp_save_dir\n md5.clean!\n FileUtils.remove_entry(config.version_file) if File.exists? config.version_file\n end", "def reset!\n remove_instance_variable \"@service_definitions\" if defined? @service_definitions\n remove_instance_variable \"@services_config_list\" if defined? @services_config_list\n end", "def delete_launch_configs\n auto_scaling = new_auto_scaling\n groups = auto_scaling.groups\n auto_scaling.launch_configurations.each do |config|\n if groups[config.name].nil?\n puts \"deleting asg launch configuration, #{config.name}\"\n config.delete()\n end\n end\nend", "def reset_configuration!\n @configuration = Auth::Configuration.new\n end", "def reset\n CONFIGURATION_DEFAULTS.each { |k, v| send(\"#{k}=\", v) }\n self\n end", "def reset!\n logs.remove\n features.remove\n users.remove\n end", "def delete_all\n super\n Rails.cache.delete_matched(/#{self.configure.cache.namespace}/)\n end", "def unconfigure\n root_notifier.unconfigure\n end", "def teardown()\n # See 6. Disabling the gadget\n # ~ equiv to: echo \"\" > UDC\n System.write(File.join(path_prefix, \"UDC\"), \"\\n\")\n sleep(0.1)\n\n # See 7. Cleaning up\n System.delete(*Dir.glob(File.join(path_prefix, \"configs/*/*\")))\n System.delete(*Dir.glob(File.join(path_prefix, \"configs/*/strings/*\")))\n System.delete(*Dir.glob(File.join(path_prefix, \"configs/*\")))\n System.delete(*Dir.glob(File.join(path_prefix, \"functions/*\")))\n System.delete(*Dir.glob(File.join(path_prefix, \"strings/*\")))\n System.delete(path_prefix)\n end", "def tcfg_reset\n @tcfg_resolved_config = nil\n end", "def reset\n @git = nil\n @configuration = nil\n end", "def reset\n @config_file = nil\n set_defaults\n load_from_file if config_file\n end", "def rm_service_configuration(config_hash)\n st = match_node_keys(@registry, config_hash, full_address)\n remove_tree_entry(st) if st.is_a?(Tree::TreeNode)\n end", "def cleanup(test_configuration)\n if test_configuration[:unit]\n # copy main package.json from project directory in order to use it in the unit-test\n # docker container\n FileUtils.rm_rf(\"#{@test_dir}/unit/package.json\")\n end\n end", "def reset(scope = :all)\n configuration.reset(scope)\n end", "def rm_index_config\n @config.rm_index_config\n end", "def clear\n with_config do\n self.storage.delete_expired_tempfiles\n end\n end", "def clean(mute=false)\n return if @options[:dirty]\n UI.say \"Cleaning up eb remote config and local files\" unless mute\n eb.delete_configuration_template(\n application_name: @updater.app_name,\n template_name: current_name\n ) unless @options[:noop]\n FileUtils.rm_f(@current_path)\n end", "def remove_remaining_notification_settings\n source_project.notification_settings.destroy_all # rubocop: disable DestroyAll\n end", "def destroy_database_configuration_file\n FileUtils.rm(database_configuration_file)\n end", "def clear_data\n data_dir = TaliaCore::CONFIG['data_directory_location']\n iip_dir = TaliaCore::CONFIG['iip_root_directory_location']\n FileUtils.rm_rf(data_dir) if(File.exist?(data_dir))\n FileUtils.rm_rf(iip_dir) if(File.exist?(iip_dir))\n end", "def destroy\n conf.delete 'api'\n end", "def reset_conf_sub\n Juli::Util::Config.instance_variable_set('@singleton__instance__', nil)\n $_repo = nil\n end", "def reset_config\n configure do |config|\n config.provider = :payu\n\n # payu configuration\n config.pos_id = 999\n config.pos_auth_key = 'pos_auth_key'\n config.key1 = 'key1'\n config.key2 = 'key2'\n\n config.test_mode = false\n end\n end", "def clear\n Dir[File.join(@output_dir, '*')].each do |path|\n File.delete(path)\n end\n end", "def clear!\n Padrino.clear_middleware!\n Padrino.mounted_apps.clear\n @_load_paths = nil\n @_dependency_paths = nil\n @_global_configuration = nil\n Padrino.before_load.clear\n Padrino.after_load.clear\n Padrino::Reloader.clear!\n Thread.current[:padrino_loaded] = nil\n end", "def delete( )\n File.delete(@configFileDNE)\n self.clear\n self\n end", "def clean_installation\n clean_paths.each { |path| FileUtils.rm_rf(path) }\n end", "def delete_at index\n @config.delete_at index\n end", "def delete(key)\n self.config.delete(key)\n end", "def cleanall\n FileUtils.rm_r(OUTPUT_DIR, force: true, verbose: true)\n end", "def empty_config\n nil\n end", "def unset(key)\n run { conf.unset(key, config_params) }\n end", "def clear\n Dir[File.join(@output_dir, '*.json')].each do |path|\n File.delete(path)\n end\n end", "def clear_all!\n @commands_and_opts.clear\n self\n end", "def remove( *args )\n args.each { |name|\n name = name.to_s.delete('=')\n code = <<-__\n undef_method :#{name} rescue nil\n undef_method :#{name}= rescue nil\n __\n Loquacious::Configuration.module_eval code\n Loquacious::Configuration::DSL.module_eval code\n }\n end", "def unregister_all\n registry.clear.default = nil\n end", "def reset_active_model_configurations!\n self.class.reset_active_model_configurations!\n end", "def cleanup\n FileUtils.rm_f Dir.glob(File.join(config.folder, '*.items'))\n end", "def cfg_delete(cfg)\n obj_delete cfg, ZoneConfiguration\n end", "def clear!\n @handlers = {}\n @environments = {}\n @requests = []\n end", "def delete_all\n @loaded_constants.each do |const_name|\n if Object.const_defined?(const_name)\n Object.send(:remove_const, const_name)\n end\n end\n Ichiban::HTMLCompiler::Context.clear_user_defined_helpers\n end", "def reset\n self.options = nil\n self.option_processors = nil\n end", "def delete_all\n target.clear\n end", "def clear_exclusions\n automatic_exclusions.clear\n manifest_exclusions.clear\n end", "def undefine_config(tool)\n @setup[tool.to_s] = false\n end" ]
[ "0.81042236", "0.81042236", "0.7791918", "0.7680122", "0.7584492", "0.74850965", "0.73792917", "0.73251456", "0.7309198", "0.7309198", "0.7294231", "0.71759224", "0.71539766", "0.711651", "0.7109858", "0.71056795", "0.70922244", "0.70922244", "0.70493436", "0.70065486", "0.6964348", "0.6956409", "0.69340295", "0.6923716", "0.691808", "0.69110966", "0.68972766", "0.6893841", "0.6870183", "0.68663186", "0.68627733", "0.6862618", "0.68407893", "0.68280494", "0.67892617", "0.67841864", "0.67475307", "0.66964036", "0.66961753", "0.66961753", "0.66761273", "0.66662943", "0.6660096", "0.664322", "0.66362906", "0.663225", "0.6617091", "0.65703326", "0.6549466", "0.65465146", "0.6545458", "0.6527498", "0.6512884", "0.65090644", "0.649718", "0.6481475", "0.6423007", "0.6411414", "0.64078933", "0.6401842", "0.6372272", "0.6357963", "0.63548386", "0.63501066", "0.6335667", "0.6318265", "0.6303229", "0.6299474", "0.626751", "0.62627214", "0.6259317", "0.62566686", "0.6248148", "0.6242319", "0.6239623", "0.62344503", "0.6232347", "0.61975396", "0.6189094", "0.61810535", "0.6177828", "0.61746395", "0.617197", "0.6171211", "0.6163221", "0.61426276", "0.61389005", "0.6134506", "0.6113636", "0.6112513", "0.6106473", "0.6102972", "0.6092706", "0.6059247", "0.60587835", "0.60451406", "0.6041894", "0.6039231", "0.6038029" ]
0.8488825
1
Converts the defaults hash to a Java HashMap used by the Neo4j API.
def to_java_map map = java.util.HashMap.new to_hash.each_pair do |k, v| case v when TrueClass map[k.to_s] = "true" when FalseClass map[k.to_s] = "false" when String, Fixnum, Float map[k.to_s] = v.to_s # skip list and hash values - not accepted by the Java Neo4j API end end map end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_hash\n default_options.to_hash\n end", "def to_hash\n default_options.to_hash\n end", "def to_hash\n dup = @hash.dup\n dup.delete(\"__default__\")\n dup\n end", "def to_hash\n Hash.new(default).merge(self)\n end", "def to_hash\n Hash.new(default).merge(self)\n end", "def to_hash\n Hash.new(default).merge(self)\n end", "def to_hash \n Hash.new(default).merge(self) \n end", "def defaults(hash=nil)\n @defaults = hash unless hash.nil?\n @defaults ||= {}\n end", "def default_hash\n hash = {}\n ALLOWED_KEYS.each do |key|\n hash[key] = 0\n end\n hash\n end", "def defaults\n Hash(@config[:defaults])\n end", "def to_hash\n converter_map.dup\n end", "def to_hash\n if @default_proc && !Hash.method_defined?(:default_proc=)\n # Slow path for default block and Ruby 1.8.7\n hash = Hash.new &@default_proc\n each { |key, value| hash[key] = value }\n return hash\n end\n\n hash = Hash[to_a]\n if @default_proc\n hash.default_proc = @default_proc if hash.respond_to? :default_proc=\n else\n hash.default = @default\n end\n hash\n end", "def hash_representation\n all_defaults.select {|d| d.item_label}\n .collect { |d| [d.name, d.value] }.to_h\n end", "def hash\n { hash: @hash, hashType: @hash_type }\n end", "def to_hash\n _new_hash = Hash.new\n set_defaults(_new_hash)\n\n each do |key, value|\n _new_hash[key] = convert_value(value, conversion: :to_hash)\n end\n _new_hash\n end", "def set_all_defaults(hash, default = nil)\n return unless hash.class == Hash\n hash.default = default\n hash.each_pair do |k, v|\n set_all_defaults(v) if v.class == Hash\n if v.class == Array\n v.each {|z| set_all_defaults(z) if z.class == Hash}\n end\n end\n end", "def makeDefaultOptionHash()\n\t\toptionHash = Hash.new()\n\t\[email protected] do |optDef|\n\t\t\tdefault = optDef.getDefault()\n\t\t\tunless default.nil?\n\t\t\t\toptionHash[optDef.getKey()] = default\n\t\t\tend\n\t\tend\n\t\treturn optionHash\n\tend", "def defaults\n hash = {}\n\n hash[:heating] = nil\n hash[:cooling] = nil\n hash[:interior_lighting] = nil\n hash[:exterior_lighting] = nil\n hash[:interior_equipment] = nil\n hash[:exterior_equipment] = nil\n hash[:electric_vehicles] = nil\n hash[:fans] = nil\n hash[:pumps] = nil\n hash[:heat_rejection] = nil\n hash[:humidification] = nil\n hash[:heat_recovery] = nil\n hash[:water_systems] = nil\n hash[:refrigeration] = nil\n hash[:generators] = nil\n\n return hash\n end", "def defaults(hash)\n { temperature: 10, altitude: 12000, pressure: 500 }.merge(hash)\nend", "def to_hash(options = T.unsafe(nil)); end", "def to_hash(options = T.unsafe(nil)); end", "def to_hash\n h = hash.dup\n @hash.each do |name, node|\n h[name] = node.to_hash if node.respond_to? :to_hash\n end\n h\n end", "def hash\n @hash ||= Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) }\n end", "def peer_hash_defaults(phash)\n\t\t\tdata = phash.dup\n\t\t\tdata[:port] ||= 3333 # @todo Network;:DEFAULT_PORT\n\t\t\tdata[:name] ||= \"SwarmNode_#{data[:uuid]}\"\n\t\t\tdata[:hive_version] ||= hive_version\n\t\t\tdata[:handler] ||= handler_type\n\t\t\tdata[:protocol] ||= protocol_type\n\t\t\tdata[:ssl] ||= 1\n\t\t\tdata[:peers] ||= []\n\t\t\tif data[:peers].is_a?(Array)\n\t\t\t\tdata[:peers] = data[:peers].join(',')\n\t\t\tend\n#\t\t\tdata[:created_at] ||= DateTime.now.to_s\n#\t\t\tdata[:updated_at] ||= DateTime.now.to_s\n\t\t\tdata\n\t\tend", "def with_defaults(other_hash); end", "def to_hash(overrides = {})\n defaults = {interpolate: true, context: self}\n overrides = defaults.merge(overrides)\n hash = {}\n @children.each_pair do |name, child|\n if child.kind_of?(BranchNode)\n hash[name] = child.to_hash(overrides)\n elsif child.kind_of?(PropertyNode)\n hash[name] = child.get_value(overrides)\n end\n end\n # Return the hash.\n hash\n end", "def with_defaults(defaults)\n @hash = defaults.merge(@hash)\n end", "def conndefaults_hash\n\t\treturn self.class.conndefaults_hash\n\tend", "def conndefaults_hash\n\t\treturn self.class.conndefaults_hash\n\tend", "def to_hash\n\t\tpure_hash = {}\n\t\[email protected] do |info|\n\t\t\tpure_hash[info.key] = info.value\n\t\tend\n\t\tpure_hash\n\tend", "def to_hash\n\t\t\trhash = {}\n\t\t\[email protected] {|k,v|\n\t\t\t\tcase v\n\t\t\t\twhen ConfigStruct\n\t\t\t\t\trhash[k] = v.to_h\n\t\t\t\twhen NilClass, FalseClass, TrueClass, Numeric\n\t\t\t\t\t# No-op (can't dup)\n\t\t\t\t\trhash[k] = v\n\t\t\t\twhen Symbol\n\t\t\t\t\trhash[k] = v.to_s\n\t\t\t\telse\n\t\t\t\t\trhash[k] = v.dup\n\t\t\t\tend\n\t\t\t}\n\t\t\treturn rhash\n\t\tend", "def to_hash(hash={})\n node_hash = {}\n\n # Insert node hash into parent hash correctly.\n insert_node_hash_into_parent(hash, name, node_hash)\n\n # Handle child elements\n each_child do |child|\n handle_child_element(child, node_hash)\n end\n\n # Remove content node if it is blank\n remove_blank_content_node node_hash\n\n # Handle attributes\n each_attr { |a| node_hash[a.name] = a.value }\n\n hash\n end", "def to_hash\n instance_variables_hash.inject({}) do |acc, data|\n k,v = data\n v = v.to_hash if v.respond_to?(:to_hash)\n acc[k] = v\n acc\n end\n end", "def to_hash(object)\n validate_class_kit(object.class)\n\n @hash_helper.to_hash(object)\n end", "def to_hash\n ensure_loaded\n @info.merge(@new_info).reject {|key,value| value.nil?}\n end", "def to_dict\n @hash\n end", "def get_hash\r\n get_hash = {}\r\n if @hash.has_key?(self.class::YAML_KEY)\r\n @hash[self.class::YAML_KEY].each do |k, v|\r\n if self.class::BOOLEAN_KEYS.include?(k.to_sym)\r\n get_hash[k] = v ? '1' : '0'\r\n else\r\n get_hash[k] = v\r\n end\r\n end\r\n end\r\n get_hash\r\n end", "def to_hash\n self.class.fields.each_with_object({}) do |key, hash|\n val = send(key)\n hash[key] = val if !val.nil?\n end\n end", "def to_hash\n h = {}\n each do |key,val|\n h[ UniMap.key_to_symbol( key ) ] = val\n end\n h\n end", "def defaults\n hash = {}\n hash[:under_voltage_hours] = nil\n hash[:over_voltage_hours] = nil\n\n return hash\n end", "def merge_with_symbolized_keys(defaults, hash)\n hash.inject(defaults) { |symbolized, (k, v)| deep_set_symbol_key(symbolized, k, v) }\n end", "def to_hash\n hash = {}\n each_pair do |key, value|\n if value.kind_of?(ConfigHash)\n value = value.to_hash\n end\n \n hash[key] = value\n end\n hash\n end", "def to_hash\n {:hashes => @hashes}\n end", "def to_h(keys: attribute_definitions.keys, enforce_read_only: false)\n casted_data = {}\n keys.each do |key|\n value = attribute_to_hash(key, enforce_read_only)\n # If the value is an empty hash but we specify that it is valid (via default value), serialize it\n casted_data[key] = value unless value.nil? || (value.respond_to?(:empty?) && value.empty? &&\n !(attribute_definitions[key].default == value && value.is_a?(Hash)))\n end\n casted_data\n end", "def to_hash\n hash = super\n NetworkElementSummary.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n if value.nil?\n is_nullable = NetworkElementSummary.openapi_nullable.include?(attr)\n next if !is_nullable || (is_nullable && !instance_variable_defined?(:\"@#{attr}\"))\n end\n\n hash[param] = _to_hash(value)\n end\n hash\n end", "def build_default_map(options, path='')\n options.each_pair { |k,v|\n next unless v.is_a?(Hash)\n key_path = path.empty? ? k.to_s : \"#{path}.#{k}\"\n if v.has_key?(:val)\n set(key_path, v[:val])\n else\n build_default_map(v, key_path)\n end\n }\n end", "def to_hash\r\n hash = {}\r\n self.class.attribute_map.each_pair do |attr, param|\r\n value = self.send(attr)\r\n next if value.nil?\r\n hash[param] = _to_hash(value)\r\n end\r\n hash\r\n end", "def to_hash(hash = {})\n node_hash = {}\n\n # Insert node hash into parent hash correctly.\n case hash[name]\n when Array then hash[name] << node_hash\n when Hash then hash[name] = [hash[name], node_hash]\n when nil then hash[name] = node_hash\n end\n\n # Handle child elements\n children.each do |c|\n if c.element?\n c.to_hash(node_hash)\n elsif c.text? || c.cdata?\n node_hash[CONTENT_ROOT] ||= +''\n node_hash[CONTENT_ROOT] << c.content\n end\n end\n\n # Remove content node if it is blank and there are child tags\n node_hash.delete(CONTENT_ROOT) if node_hash.length > 1 && Utils.object_blank?(node_hash[CONTENT_ROOT])\n\n # Handle attributes\n attribute_nodes.each { |a| node_hash[a.node_name] = a.value }\n\n hash\n end", "def to_hash\n hash = Hash[instance_variables.map { |var| [var[1..-1].to_sym, instance_variable_get(var)] }]\n hash.delete(:root)\n hash.delete(:nodes)\n hash.delete(:sequences)\n hash\n end", "def key_map\n hash = {}\n hash['email'] = self.email\n hash['zip'] = self.zip\n hash['user_id'] = self.user_id\n hash\n end", "def to_h\n data = super\n data[:convert] = data.delete(:converter)\n data.stringify_keys\n end", "def defaults\n hash = {}\n hash[:category] = nil\n hash[:item_name] = nil\n hash[:unit_cost] = nil\n hash[:cost_units] = nil\n hash[:item_quantity] = nil\n hash[:total_cost] = nil\n\n return hash\n end", "def to_hash\n ChefConfig::Config.save(true)\n end", "def defaults=(hsh)\n hsh.each { |k, v| @defaults[k] = v }\n end", "def with_defaults!(other_hash); end", "def to_java_map(hash)\n return nil if hash.nil?\n map = java.util.HashMap.new\n hash.each_pair do |k, v|\n case v\n when Symbol\n map[k.to_s] = v.to_s\n else\n map[k.to_s] = v\n end\n end\n map\n end", "def to_hash\n r = ATTR_NAMES.inject({}) { |m,e|\n m[e] = self.send(e)\n m\n }\n r[:product_identity_id] = product_identity_id\n r[:langcode] = lang_code_3_chars\n r[:mappings] = mappings\n r\n end", "def to_hash(options = {})\n out = {}\n keys.each do |k|\n key = options[:symbolize_keys] ? k.to_sym : k.to_s\n out[key] = Hashie::Hash === self[k] ? self[k].to_hash : self[k]\n end\n out\n end", "def to_hash(hash = {})\n node_hash = {}\n\n # Insert node hash into parent hash correctly.\n case hash[name]\n when Array then hash[name] << node_hash\n when Hash then hash[name] = [hash[name], node_hash]\n when nil then hash[name] = node_hash\n end\n\n # Handle child elements\n each_child do |c|\n if c.element?\n c.to_hash(node_hash)\n elsif c.text? || c.cdata?\n node_hash[CONTENT_ROOT] ||= +\"\"\n node_hash[CONTENT_ROOT] << c.content\n end\n end\n\n # Remove content node if it is blank\n if node_hash.length > 1 && node_hash[CONTENT_ROOT].blank?\n node_hash.delete(CONTENT_ROOT)\n end\n\n # Handle attributes\n each_attr { |a| node_hash[a.name] = a.value }\n\n hash\n end", "def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n next if value.nil?\n hash[param] = _to_hash(value)\n end\n hash\n end", "def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n next if value.nil?\n hash[param] = _to_hash(value)\n end\n hash\n end", "def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n next if value.nil?\n hash[param] = _to_hash(value)\n end\n hash\n end", "def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n next if value.nil?\n hash[param] = _to_hash(value)\n end\n hash\n end", "def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n next if value.nil?\n hash[param] = _to_hash(value)\n end\n hash\n end", "def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n next if value.nil?\n hash[param] = _to_hash(value)\n end\n hash\n end", "def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n next if value.nil?\n hash[param] = _to_hash(value)\n end\n hash\n end", "def to_hash()\n Hash[\n self.class.settings.map do |key|\n begin\n [key, self[key]]\n rescue ArgumentError\n nil\n end\n end.compact()\n ]\n end", "def to_hash *args\n hsh = super(*args)\n hsh.each do |attr, val|\n hsh[attr] = val.to_hash if val.respond_to?(:to_hash)\n end\n hsh\n end", "def defaults(hash)\n default_params.update(hash)\n end", "def convert_to_hash\n\n tmp_hash= {}\n self.class_variables.each do|var|\n tmp_hash[var.to_s.delete(\"@@\")] = self.class_variable_get(var)\n end\n\n return tmp_hash\n\n end", "def to_hash\n super.reject { |_k, v| v.nil? }\n end", "def to_hash\n ret = HashWithIndifferentAccess.new\n ret.merge!(self.attributes_for_hash)\n ret.merge!(self.associations_for_hash)\n ret.merge!(self.add_on_data_for_hash)\n ret.merge!(self.association_foreign_keys_for_hash)\n ret\n end", "def to_db_hash\n db_hsh = {}\n to_hash.each{|k,v| db_hsh[k.to_s] = v.to_s unless v.nil? }\n db_hsh\n end", "def data_hash\n @data_hash ||= Hashie::Mash.new(sanitize_data(self.data || {}).reverse_merge(built_in_variables))\n end", "def to_hash\n result = {}\n [[:tn, :tn], [:epg, :epg], [:cnam, :cnam], [:refId, :ref_id]].each do |garbage, pretty|\n # Make sure that this thing ain't nil\n if self.send(pretty)\n result[garbage] = self.send(pretty)\n end\n end\n result\n end", "def as_hash\n {\n :name => self.name,\n :phone => self.phone,\n :website => self.website,\n :email => self.email,\n :owner_name => self.owner_name,\n :owner_id => self.owner_id,\n :contacted => self.contacted,\n :original_contact_date => self.original_contact_date,\n :last_contact_date => self.last_contact_date,\n :contact_name => self.contact_name,\n :contact_id => self.contact_id,\n :register_date => self.register_date,\n :visible => self.visible,\n :verified => self.verified,\n :original_verified_date => self.original_verified_date,\n :last_verified_date => self.last_verified_date,\n :sanctioned => self.sanctioned,\n :original_sanction_date => self.original_sanction_date,\n :last_sanction_date => self.last_sanction_date,\n :description => self.description,\n :allow_comments => self.allow_comments,\n\n :address => self.address.as_hash\n }\n end", "def to_h\n\t\t\thash = Hash.new(nil)\n\t\t\teach_pair { |key, value| hash[key] = value }\n\t\t\thash.freeze\n\t\tend", "def hash\n [id, default_ldap, default_from_address, portal_url_override, site_url, logo_path, contact_sync, server_time_zone, default_calendar, default_address_format, use_ssl_flag, sync_leads_flag, include_portal_link_flag, use_expanded_format_time_flag, use_expanded_format_activity_flag, update_member_time_zones_flag, _info].hash\n end", "def to_hash; end", "def to_hash; end", "def to_hash; end", "def to_hash; end", "def to_hash; end", "def to_hash; end", "def to_hash\n hash = super\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n if value.nil?\n is_nullable = self.class.openapi_nullable.include?(attr)\n next if !is_nullable || (is_nullable && !instance_variable_defined?(:\"@#{attr}\"))\n end\n\n hash[param] = _to_hash(value)\n end\n hash\n end", "def to_hash\n hash = super\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n if value.nil?\n is_nullable = self.class.openapi_nullable.include?(attr)\n next if !is_nullable || (is_nullable && !instance_variable_defined?(:\"@#{attr}\"))\n end\n\n hash[param] = _to_hash(value)\n end\n hash\n end", "def to_hash(merge_hash = nil)\n hash = { class: self.class.name }\n hash.merge!(merge_hash) if merge_hash\n hash\n end", "def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n next if value.nil?\n hash[param] = _to_hash(value)\n end\n hash\n end", "def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n next if value.nil?\n hash[param] = _to_hash(value)\n end\n hash\n end", "def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n next if value.nil?\n hash[param] = _to_hash(value)\n end\n hash\n end", "def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n next if value.nil?\n hash[param] = _to_hash(value)\n end\n hash\n end", "def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n next if value.nil?\n hash[param] = _to_hash(value)\n end\n hash\n end", "def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n next if value.nil?\n hash[param] = _to_hash(value)\n end\n hash\n end", "def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n next if value.nil?\n hash[param] = _to_hash(value)\n end\n hash\n end", "def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n next if value.nil?\n hash[param] = _to_hash(value)\n end\n hash\n end", "def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n next if value.nil?\n hash[param] = _to_hash(value)\n end\n hash\n end", "def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n next if value.nil?\n hash[param] = _to_hash(value)\n end\n hash\n end", "def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n next if value.nil?\n hash[param] = _to_hash(value)\n end\n hash\n end", "def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n next if value.nil?\n hash[param] = _to_hash(value)\n end\n hash\n end", "def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n next if value.nil?\n hash[param] = _to_hash(value)\n end\n hash\n end" ]
[ "0.67691034", "0.67691034", "0.6739721", "0.6715363", "0.6688526", "0.6688526", "0.6648757", "0.649802", "0.64636695", "0.6374837", "0.6330976", "0.63282806", "0.6235643", "0.62268627", "0.6186034", "0.61377585", "0.6116371", "0.60332936", "0.60277724", "0.5993876", "0.5993876", "0.5984503", "0.5970692", "0.595464", "0.59530413", "0.594579", "0.5943351", "0.59332246", "0.59332246", "0.5917489", "0.5902304", "0.5880606", "0.5861917", "0.5860346", "0.5841069", "0.58306515", "0.58150196", "0.58033174", "0.5800169", "0.5798785", "0.57974213", "0.57904303", "0.5767153", "0.5758142", "0.5736324", "0.5725966", "0.5724989", "0.57198364", "0.57142055", "0.57075155", "0.57043713", "0.5697876", "0.56977934", "0.56958824", "0.5690023", "0.56856155", "0.5685531", "0.567454", "0.56691486", "0.5662551", "0.5662551", "0.5662551", "0.5662551", "0.5662551", "0.5662551", "0.5662551", "0.5654923", "0.56537366", "0.5651806", "0.5648796", "0.5646251", "0.56411844", "0.5636499", "0.5633954", "0.56328416", "0.56295097", "0.56264406", "0.5624723", "0.5623856", "0.5623856", "0.5623856", "0.5623856", "0.5623856", "0.5623856", "0.56123775", "0.56123775", "0.5601584", "0.5600451", "0.55999005", "0.5599448", "0.5599244", "0.5598729", "0.5598729", "0.5598729", "0.5598729", "0.5598729", "0.5598729", "0.5598729", "0.5598729", "0.5598729" ]
0.56578475
66
Transforms `switch` to nested `if`expressions
def transform_switch_to_if(switch_expr) _tag, *cases = switch_expr if_expr = ['if', nil, nil, nil] current = if_expr (0..(cases.size - 2)).each do |i| current_cond, current_block = cases[i] current[1] = current_cond current[2] = current_block next_case = cases[i + 1] next_cond, next_block = next_case current[3] = next_cond == 'else' ? next_block : ['if'] current = current[3] end if_expr end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_case(exp)\n obj = exp.shift \n \n with_temporary_variable do |tmp|\n @local_variables_need_no_initialization.add(tmp)\n asgn = want_expression do\n \"#{tmp}=#{process(obj)}\"\n end\n\n new_exp = current_exp = []\n\n while not exp.empty?\n _when = exp.shift\n if _when.nil? or _when.first != :when\n # last element\n raise exp.inspect unless exp.empty?\n current_exp << _when\n else\n conds = _when[1]\n block = _when[2]\n raise unless conds.first == :array\n\n cond = multi_or(conds[1..-1].map {|c| [:call, c, :===, [:array, [:special_inline_js_value, tmp]]] })\n\n my_exp = [:if, cond, block]\n\n current_exp << my_exp\n current_exp = my_exp\n end\n end\n\n if_code = process(new_exp.first)\n\n code = \n if @want_expression \n \"(#{asgn}, #{if_code})\"\n else\n \"#{asgn}#{sep()}#{if_code}\" \n end\n\n code\n end\n end", "def expand_elses(branch); end", "def expand_elses(branch); end", "def case(exp, level)\n code = []\n @scope.add_local \"$case\"\n expr = process exp.shift, :expression\n # are we inside a statement_closure\n returnable = level != :statement\n\n until exp.empty?\n wen = exp.shift\n if wen and wen.first == :when\n returns(wen) if returnable\n wen = process(wen, :expression)\n wen = \"else #{wen}\" unless code.empty?\n code << wen\n elsif wen # s(:else)\n wen = returns(wen) if returnable\n code << \"else {#{process wen, :expression}}\"\n end\n end\n\n code = \"$case = #{expr};#{code.join \"\\n\"}\"\n code = \"(function() { #{code} })()\" if returnable\n code\n end", "def switch_statement\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 16 )\n return_value = SwitchStatementReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n\n _last = _first_0 = nil\n string_literal60 = nil\n expression61 = nil\n case_clause62 = nil\n default_clause63 = nil\n\n tree_for_string_literal60 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 95:5: ^( 'switch' expression ( case_clause )* ( default_clause )? )\n _save_last_1 = _last = @input.look\n _first_1 = nil\n root_1 = @adaptor.create_flat_list\n _last = @input.look\n string_literal60 = match( SWITCH, TOKENS_FOLLOWING_SWITCH_IN_switch_statement_477 )\n\n tree_for_string_literal60 = @adaptor.copy_node( string_literal60 )\n\n root_1 = @adaptor.become_root( tree_for_string_literal60, root_1 )\n\n\n\n match( DOWN, nil )\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_expression_IN_switch_statement_479 )\n expression61 = expression\n @state.following.pop\n\n @adaptor.add_child( root_1, expression61.tree )\n # at line 95:28: ( case_clause )*\n while true # decision 16\n alt_16 = 2\n look_16_0 = @input.peek( 1 )\n\n if ( look_16_0 == CASE )\n alt_16 = 1\n\n end\n case alt_16\n when 1\n # at line 95:28: case_clause\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_case_clause_IN_switch_statement_481 )\n case_clause62 = case_clause\n @state.following.pop\n\n @adaptor.add_child( root_1, case_clause62.tree )\n\n\n else\n break # out of loop for decision 16\n end\n end # loop for decision 16\n # at line 95:41: ( default_clause )?\n alt_17 = 2\n look_17_0 = @input.peek( 1 )\n\n if ( look_17_0 == DEFAULT )\n alt_17 = 1\n end\n case alt_17\n when 1\n # at line 95:41: default_clause\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_default_clause_IN_switch_statement_484 )\n default_clause63 = default_clause\n @state.following.pop\n\n @adaptor.add_child( root_1, default_clause63.tree )\n\n\n end\n\n match( UP, nil )\n @adaptor.add_child( root_0, root_1 )\n _last = _save_last_1\n\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 16 )\n\n end\n \n return return_value\n end", "def when(exp, level)\n arg = exp.shift[1..-1]\n body = exp.shift\n body = process body, level if body\n\n test = []\n until arg.empty?\n a = arg.shift\n\n if a.first == :when # when inside another when means a splat of values\n call = s(:call, s(:js_tmp, \"$splt[i]\"), :===, s(:arglist, s(:js_tmp, \"$case\")))\n splt = \"(function($splt) {for(var i = 0; i < $splt.length; i++) {\"\n splt += \"if (#{process call, :expression}) { return true; }\"\n splt += \"} return false; })(#{process a[1], :expression})\"\n test << splt\n else\n call = s(:call, a, :===, s(:arglist, s(:js_tmp, \"$case\")))\n call = process call, :expression\n # call = \"else \" unless test.empty?\n test << call\n end\n end\n\n \"if (#{test.join \" || \"}) {\\n#{body}\\n}\"\n end", "def expand_elses(branch)\n if branch.nil?\n [nil]\n elsif branch.if_type?\n _condition, elsif_branch, else_branch = *branch\n expand_elses(else_branch).unshift(elsif_branch)\n else\n [branch]\n end\n end", "def expand_elses(branch)\n elsif_branches = expand_elsif(branch)\n else_branch = elsif_branches.any? ? elsif_branches.pop : branch\n [elsif_branches, else_branch]\n end", "def elseif!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 22 )\n\n type = ELSEIF\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 324:10: 'elseif'\n match( \"elseif\" )\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__, 22 )\n\n end", "def process_if exp\n exp = exp.dup\n condition = exp[1] = process exp.condition\n\n if true? condition\n exp[2] = process exp.then_clause if exp.then_clause\n exp[3] = nil\n elsif false? condition\n exp[2] = nil\n exp[3] = process exp.else_clause if exp.else_clause\n else\n exp[2] = process exp.then_clause if exp.then_clause\n exp[3] = process exp.else_clause if exp.else_clause\n end\n\n exp\n end", "def if_to_cond(node = @prog)\n node.traverse(nil) {|st, parent|\n if st.kind_of? ECMA262::StIf\n if st.to_exp?\n t = ECMA262::StExp.new(st.to_exp({}))\n remove_paren(t)\n if t.to_js.length <= st.to_js.length\n parent.replace(st, t)\n end\n end\n end\n }\n if_to_return(node)\n self\n end", "def process_if(exp)\n cond = exp.shift\n _then = exp.shift\n _else = exp.shift\n\n _then_processed = if _then\n process(_then)\n else\n nil\n end\n\n _else_processed = if _else\n process(_else)\n else\n nil\n end\n\n negate = false\n\n if _then_processed.nil?\n # no \"then\" block as in\n #\n # if X\n # else\n # block\n # end\n #\n # => convert into\n #\n # if not X\n # block\n # end\n #\n # by swapping then and else blocks\n # and negating the condition\n\n _then_processed = _else_processed\n _else_processed = nil\n negate = true\n end\n\n cond_processed = without_result do\n conditionalize(cond, negate)\n end\n\n str = \"\"\n\n if @want_expression\n _then_processed ||= resultify(@model.encode_nil)\n _else_processes ||= resultify(@model.encode_nil)\n str << \"(#{cond_processed}?#{_then_processed}:#{_else_processed})\"\n else\n str << \"if(#{cond_processed}){\"\n str << (_then_processed || (@want_result ? resultify(@model.encode_nil) : ''))\n str << \"}\"\n if @want_result\n _else_processed ||= resultify(@model.encode_nil) \n end\n if _else_processed\n str << \"else{\"\n str << _else_processed\n str << \"}\"\n end\n end\n\n return str\n end", "def visit_if(node)\n check_indentation(node)\n\n if @allow_non_nested_indentation\n yield # Continue linting else statement\n elsif node.else\n visit(node.else)\n end\n end", "def k_if!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 36 )\n\n\n\n type = K_IF\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 397:4: ( 'if' | 'when' )\n # at line 397:4: ( 'if' | 'when' )\n alt_10 = 2\n look_10_0 = @input.peek( 1 )\n\n if ( look_10_0 == 0x69 )\n alt_10 = 1\n elsif ( look_10_0 == 0x77 )\n alt_10 = 2\n else\n raise NoViableAlternative( \"\", 10, 0 )\n\n end\n case alt_10\n when 1\n # at line 397:5: 'if'\n match( \"if\" )\n\n\n when 2\n # at line 397:10: 'when'\n match( \"when\" )\n\n\n end\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 36 )\n\n\n end", "def setup_switch_case\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n act_result = nil\n act_hash = @acts[1]\n \n # Get valid action key\n act_hash.each do |cond, action_key|\n bool = false\n begin\n # Try to evaluate script\n bool = eval(cond)\n rescue StandardError => err\n # Blame script user if error :v\n display_error(\"[#{SEQUENCE_CASE},]\",err)\n end\n next unless bool # If condition valid\n act_result = action_key # Assign action key\n break # Break loop checking\n end\n \n # Evaluate action key\n return unless act_result\n is_array = act_result.is_a?(Array)\n \n # If nested array (triggered if first element is array)\n if is_array && act_result[0].is_a?(Array)\n act_result.each do |action|\n next unless action.is_a?(Array)\n @acts = action\n execute_sequence\n end\n # If normal array\n elsif is_array\n @acts = act_result\n execute_sequence\n else\n @acts = [:action, act_result]\n execute_sequence\n end\n end", "def ruby2kif (sexp, var)\n\treturn unless sexp \n \tcase sexp[0]\n \twhen :defn then ruby2kif(sexp[3],sexp[2][1]) #(:defn name (:args v1 v2...) stmt)\n \twhen :scope then ruby2kif(sexp[1],var)\n \twhen :block then parseBlock(sexp, var) #There could be more than one satement in the block \n \twhen :call then rubyterm2kif(sexp, var)\n\twhen :return then ruby2kif(sexp[1],var)\n\twhen :true then pk(\"true\")\n\twhen :false then pk(\"false\")\n\twhen :if # then sexp # (:if cond then else)\n\t\tif sexp[2]\n\t\t op; pk(\"=> \"); ruby2kif(sexp[1],var); sp; ruby2kif(sexp[2],var); cl;\n\t\tend\n\t\tif sexp[3] \n\t op;pk(\"=> \" ); op;pk(\"not \"); ruby2kif(sexp[1],var);cl; sp; ruby2kif(sexp[3],var);cl\n\t\tend\n \n\twhen :and #(:and x y)\n\t\top; pk(\"and \"); ruby2kif(sexp[1],var); sp; ruby2kif(sexp[2],var); cl\n\twhen :or #(:or x y)\n\t\top; pk(\"or \"); ruby2kif(sexp[1],var); sp; ruby2kif(sexp[2],var); cl\n\twhen :not #(:not x)\n\t\top; pk(\"not \"); ruby2kif(sexp[1],var); cl\n \telse log_sexp(sexp, \"ruby2kif\"); raise \"unknown sexp type\"; \n\tend # throw error when found unknown operator\n end", "def elif!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 21 )\n\n type = ELIF\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 323:8: 'elif'\n match( \"elif\" )\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__, 21 )\n\n end", "def eval_if_then_else(node, env, stack_trace)\n\n\tcondition = eval_node_under(node.condition, env, stack_trace)\n\tcase condition\n\tin Boolean\n\t\tif condition.value \n\t\t\treturn eval_node_under(node.true_exp, env, stack_trace), env\n\t\telse\n\t\t\tif condition.false_exp # is not empty\n\t\t\t\treturn eval_node_under(node.false_exp, env, stack_trace), env\n\t\t\telse # Don't do anything (return UnitNode)\n\t\t\t\treturn UnitNode(node.line, node.col), env\n\t\t\tend\n\t\tend\n\telse\n\t\tthrow_error(\"If statement's condition does not evaluate to a Boolean.\", node, stack_trace)\n\tend\nend", "def process_if(exp)\n cond_part = process exp.shift\n\n result = \"if (#{cond_part})\"\n\n then_part = process exp.shift\n else_part = process exp.shift\n\n then_part = \"\" if then_part.nil?\n else_part = \"\" if else_part.nil?\n\n result += \" {\\n\"\n \n then_part = then_part.join(\";\\n\") if Array === then_part\n then_part += \";\" unless then_part =~ /[;}]\\Z/\n # HACK: um... deal with nil correctly (see unless support)\n result += then_part.to_s # + \";\"\n result += \";\" if then_part.nil?\n result += \"\\n\" unless result =~ /\\n\\Z/\n result += \"}\"\n\n if else_part != \"\" then\n result += \" else {\\n\"\n else_part = else_part.join(\";\\n\") if Array === else_part\n else_part += \";\" unless else_part =~ /[;}]\\Z/\n result += else_part\n result += \"\\n}\"\n end\n\n result\n end", "def do_conditional\n cond = inequality\n\n loop do\n type = @lexer.peek_next_type\n\n break unless [:AND, :OR].include? type\n @lexer.skip\n\n # The rhs has to be evaluated here because of short-circuiting\n\n rhs = inequality\n\n cond &&= rhs if type == :AND\n cond ||= rhs if type == :OR\n end\n\n return unless cond\n\n expect [:THEN]\n line_do\n end", "def expand_when_branches(when_branches); end", "def reduce_if(node = @prog)\n node.traverse(nil) {|st, parent|\n if st.kind_of? ECMA262::StIf\n if st.else_st.nil? and\n st.then_st.kind_of? ECMA262::StIf and st.then_st.else_st.nil?\n st.replace(st.cond, ECMA262::ExpLogicalAnd.new(st.cond, st.then_st.cond))\n st.replace(st.then_st, st.then_st.then_st)\n end\n end\n }\n self\n end", "def visitIfStatement(ste,args=nil)\n\t\tcode =[]\n\t\texpcode=[]\n\t\texpcode << \" \"*@indent+\"if ( \"\n\t\texpcode << visitExpression(ste.cond)\n\t\t#p ste.cond.lsmpexp\n\t\t#p expcode\n\t\texpcode << \")\"\n\t\texpcode=expcode.flatten.join\n\t\tcode << expcode\n\t\tindent\n\t\tcode << visitStatement(ste.thenste)\n\t\tif ste.elseste != nil\n\t\t\tcode << \" \"*(@indent-2)+\"else \"\n\t\t\tcode << visitStatement(ste.elseste)\n\t\tend\n\t\tdesindent\n\t\treturn code\n end", "def case!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 23 )\n\n type = CASE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 144:8: 'case'\n match( \"case\" )\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__, 23 )\n\n end", "def switch(it)\n it == true ? false : true\nend", "def switch!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 49 )\n\n type = SWITCH\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 170:10: 'switch'\n match( \"switch\" )\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__, 49 )\n\n end", "def next_phoneme_switch(trie, depth)\n # switch (string[cursor + depth]) {\n # case N: // for N in subtrie.keys\n # // if a case statement matches the current byte AND there's chance\n # // that a longer string might match, recurse.\n # if (max_length >= depth) {\n # // recurse\n # }\n # break;\n # // if there's a :source key here then a phoneme terminates at this\n # // point and this depth is a valid return value.\n # default:\n # return depth;\n # break;\n # }\n indent depth, \"switch(string[cursor + #{depth}]) {\"\n write ''\n trie.each do |key, subtrie|\n next if key == :source\n next if subtrie.empty?\n\n indent depth, \"case #{key}:\"\n\n # Add a comment to help understand the dataset\n describe(subtrie[:source], depth + 1) if subtrie[:source]\n\n if subtrie.keys == [:source]\n indent depth, \" return #{depth + 1};\"\n else\n indent depth, \" if (max_length > #{depth + 1}) {\"\n next_phoneme_switch(subtrie, depth + 1)\n indent depth, ' } else {'\n indent depth, \" return #{depth + 1};\"\n indent depth, ' }'\n end\n\n indent depth, ' break;'\n end\n\n if trie.key?(:source)\n indent depth, ' default:'\n indent depth, \" return #{depth};\"\n end\n indent depth, '}'\n end", "def if_statement\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 15 )\n return_value = IfStatementReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n\n _last = _first_0 = nil\n string_literal52 = nil\n string_literal56 = nil\n clause53 = nil\n block54 = nil\n block55 = nil\n clause57 = nil\n block58 = nil\n block59 = nil\n\n tree_for_string_literal52 = nil\n tree_for_string_literal56 = nil\n\n begin\n # at line 90:3: ( ^( 'if' clause block ( block )? ) | ^( 'unless' clause block ( block )? ) )\n alt_15 = 2\n look_15_0 = @input.peek( 1 )\n\n if ( look_15_0 == IF )\n alt_15 = 1\n elsif ( look_15_0 == UNLESS )\n alt_15 = 2\n else\n raise NoViableAlternative( \"\", 15, 0 )\n end\n case alt_15\n when 1\n root_0 = @adaptor.create_flat_list\n\n\n # at line 90:5: ^( 'if' clause block ( block )? )\n _save_last_1 = _last = @input.look\n _first_1 = nil\n root_1 = @adaptor.create_flat_list\n _last = @input.look\n string_literal52 = match( IF, TOKENS_FOLLOWING_IF_IN_if_statement_436 )\n\n tree_for_string_literal52 = @adaptor.copy_node( string_literal52 )\n\n root_1 = @adaptor.become_root( tree_for_string_literal52, root_1 )\n\n\n\n match( DOWN, nil )\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_clause_IN_if_statement_438 )\n clause53 = clause\n @state.following.pop\n\n @adaptor.add_child( root_1, clause53.tree )\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_block_IN_if_statement_440 )\n block54 = block\n @state.following.pop\n\n @adaptor.add_child( root_1, block54.tree )\n # at line 90:26: ( block )?\n alt_13 = 2\n look_13_0 = @input.peek( 1 )\n\n if ( look_13_0.between?( AMP, AMP_ASGN ) || look_13_0 == POST_DECR || look_13_0.between?( GEQ, AREF ) || look_13_0.between?( GREATER, HAT ) || look_13_0.between?( ARROW, HAT_ASGN ) || look_13_0.between?( ASGN, RETURN ) || look_13_0 == INCR || look_13_0.between?( BREAK, RSHIFT3 ) || look_13_0.between?( LABEL, CATCH ) || look_13_0 == RSHIFT_ASGN || look_13_0 == LEQ || look_13_0.between?( LESS, SLASH ) || look_13_0.between?( SLASH_ASGN, CONTINUE ) || look_13_0.between?( STAR, DECR ) || look_13_0 == STAR_ASGN || look_13_0.between?( LSHIFT, THIS ) || look_13_0 == THROW || look_13_0.between?( MINUS, MOD ) || look_13_0.between?( MOD_ASGN, TYPEOF ) || look_13_0.between?( NEQ, UMINUS ) || look_13_0.between?( NEQQ, UNDEFINED ) || look_13_0.between?( NEW, UPLUS ) || look_13_0.between?( OBJECT, FALSE ) || look_13_0.between?( WITH, PLUS ) || look_13_0.between?( ID, DOC ) )\n alt_13 = 1\n end\n case alt_13\n when 1\n # at line 90:26: block\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_block_IN_if_statement_442 )\n block55 = block\n @state.following.pop\n\n @adaptor.add_child( root_1, block55.tree )\n\n\n end\n\n match( UP, nil )\n @adaptor.add_child( root_0, root_1 )\n _last = _save_last_1\n\n\n\n when 2\n root_0 = @adaptor.create_flat_list\n\n\n # at line 91:5: ^( 'unless' clause block ( block )? )\n _save_last_1 = _last = @input.look\n _first_1 = nil\n root_1 = @adaptor.create_flat_list\n _last = @input.look\n string_literal56 = match( UNLESS, TOKENS_FOLLOWING_UNLESS_IN_if_statement_453 )\n\n tree_for_string_literal56 = @adaptor.copy_node( string_literal56 )\n\n root_1 = @adaptor.become_root( tree_for_string_literal56, root_1 )\n\n\n\n match( DOWN, nil )\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_clause_IN_if_statement_455 )\n clause57 = clause\n @state.following.pop\n\n @adaptor.add_child( root_1, clause57.tree )\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_block_IN_if_statement_457 )\n block58 = block\n @state.following.pop\n\n @adaptor.add_child( root_1, block58.tree )\n # at line 91:30: ( block )?\n alt_14 = 2\n look_14_0 = @input.peek( 1 )\n\n if ( look_14_0.between?( AMP, AMP_ASGN ) || look_14_0 == POST_DECR || look_14_0.between?( GEQ, AREF ) || look_14_0.between?( GREATER, HAT ) || look_14_0.between?( ARROW, HAT_ASGN ) || look_14_0.between?( ASGN, RETURN ) || look_14_0 == INCR || look_14_0.between?( BREAK, RSHIFT3 ) || look_14_0.between?( LABEL, CATCH ) || look_14_0 == RSHIFT_ASGN || look_14_0 == LEQ || look_14_0.between?( LESS, SLASH ) || look_14_0.between?( SLASH_ASGN, CONTINUE ) || look_14_0.between?( STAR, DECR ) || look_14_0 == STAR_ASGN || look_14_0.between?( LSHIFT, THIS ) || look_14_0 == THROW || look_14_0.between?( MINUS, MOD ) || look_14_0.between?( MOD_ASGN, TYPEOF ) || look_14_0.between?( NEQ, UMINUS ) || look_14_0.between?( NEQQ, UNDEFINED ) || look_14_0.between?( NEW, UPLUS ) || look_14_0.between?( OBJECT, FALSE ) || look_14_0.between?( WITH, PLUS ) || look_14_0.between?( ID, DOC ) )\n alt_14 = 1\n end\n case alt_14\n when 1\n # at line 91:30: block\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_block_IN_if_statement_459 )\n block59 = block\n @state.following.pop\n\n @adaptor.add_child( root_1, block59.tree )\n\n\n end\n\n match( UP, nil )\n @adaptor.add_child( root_0, root_1 )\n _last = _save_last_1\n\n\n\n end\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 15 )\n\n end\n \n return return_value\n end", "def case_clause\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 28 )\n return_value = CaseClauseReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n string_literal116 = nil\n char_literal118 = nil\n expression_list117 = nil\n statement_list119 = nil\n\n tree_for_string_literal116 = nil\n tree_for_char_literal118 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 430:5: 'case' expression_list ':' ( statement_list )?\n string_literal116 = match( CASE, TOKENS_FOLLOWING_CASE_IN_case_clause_2873 )\n if @state.backtracking == 0\n\n tree_for_string_literal116 = @adaptor.create_with_payload( string_literal116 )\n root_0 = @adaptor.become_root( tree_for_string_literal116, root_0 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_expression_list_IN_case_clause_2877 )\n expression_list117 = expression_list\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, expression_list117.tree )\n end\n char_literal118 = match( COLON, TOKENS_FOLLOWING_COLON_IN_case_clause_2880 )\n # at line 430:37: ( statement_list )?\n alt_24 = 2\n look_24_0 = @input.peek( 1 )\n\n if ( look_24_0 == GENERAL || look_24_0 == GET || look_24_0 == ARROW || look_24_0 == IF || look_24_0 == REGEX || look_24_0 == INCR || look_24_0 == BREAK || look_24_0 == RETURN || look_24_0 == IS_DEFINED || look_24_0 == LBRACE || look_24_0 == LBRACK || look_24_0.between?( SEMI, CONST ) || look_24_0.between?( SET, LET ) || look_24_0 == DDOC || look_24_0.between?( DECR, LPAREN ) || look_24_0 == DELETE || look_24_0.between?( DGENERAL, DO ) || look_24_0 == THROW || look_24_0 == TILDE || look_24_0 == TRUE || look_24_0 == TRY || look_24_0.between?( TYPEOF, NEW ) || look_24_0.between?( EACH, UNDEFINED ) || look_24_0.between?( NULL, UNLESS ) || look_24_0 == UNTIL || look_24_0 == FALSE || look_24_0 == VAR || look_24_0.between?( VOID, FOR ) || look_24_0 == WHILE || look_24_0.between?( WITH, YIELD ) || look_24_0.between?( IS_UNDEFINED, DOC ) || look_24_0.between?( T__148, T__150 ) )\n alt_24 = 1\n end\n case alt_24\n when 1\n # at line 430:37: statement_list\n @state.following.push( TOKENS_FOLLOWING_statement_list_IN_case_clause_2884 )\n statement_list119 = statement_list\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, statement_list119.tree )\n end\n\n end\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__, 28 )\n\n end\n \n return return_value\n end", "def case_clause\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 17 )\n return_value = CaseClauseReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n\n _last = _first_0 = nil\n string_literal64 = nil\n expression65 = nil\n statement_list66 = nil\n\n tree_for_string_literal64 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 99:5: ^( 'case' expression ( statement_list )? )\n _save_last_1 = _last = @input.look\n _first_1 = nil\n root_1 = @adaptor.create_flat_list\n _last = @input.look\n string_literal64 = match( CASE, TOKENS_FOLLOWING_CASE_IN_case_clause_504 )\n\n tree_for_string_literal64 = @adaptor.copy_node( string_literal64 )\n\n root_1 = @adaptor.become_root( tree_for_string_literal64, root_1 )\n\n\n\n match( DOWN, nil )\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_expression_IN_case_clause_506 )\n expression65 = expression\n @state.following.pop\n\n @adaptor.add_child( root_1, expression65.tree )\n # at line 99:27: ( statement_list )?\n alt_18 = 2\n look_18_0 = @input.peek( 1 )\n\n if ( look_18_0.between?( AMP, AMP_ASGN ) || look_18_0 == POST_DECR || look_18_0.between?( GEQ, AREF ) || look_18_0.between?( GREATER, HAT ) || look_18_0.between?( ARROW, HAT_ASGN ) || look_18_0.between?( ASGN, REGEX ) || look_18_0.between?( IN, RETURN ) || look_18_0 == INCR || look_18_0.between?( BREAK, RSHIFT3 ) || look_18_0.between?( LABEL, CATCH ) || look_18_0 == RSHIFT_ASGN || look_18_0 == LEQ || look_18_0.between?( LESS, SLASH ) || look_18_0.between?( SLASH_ASGN, CONTINUE ) || look_18_0.between?( STAR, DECR ) || look_18_0 == STAR_ASGN || look_18_0.between?( LSHIFT, THIS ) || look_18_0 == THROW || look_18_0.between?( MINUS, MOD ) || look_18_0.between?( MOD_ASGN, TYPEOF ) || look_18_0.between?( NEQ, UMINUS ) || look_18_0.between?( NEQQ, UNDEFINED ) || look_18_0.between?( NEW, UPLUS ) || look_18_0.between?( OBJECT, FALSE ) || look_18_0.between?( WITH, PLUS ) || look_18_0.between?( ID, DOC ) )\n alt_18 = 1\n end\n case alt_18\n when 1\n # at line 99:27: statement_list\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_statement_list_IN_case_clause_509 )\n statement_list66 = statement_list\n @state.following.pop\n\n @adaptor.add_child( root_1, statement_list66.tree )\n\n\n end\n\n match( UP, nil )\n @adaptor.add_child( root_0, root_1 )\n _last = _save_last_1\n\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 17 )\n\n end\n \n return return_value\n end", "def k_else!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 40 )\n\n\n\n type = K_ELSE\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 413:4: 'else'\n match( \"else\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 40 )\n\n\n end", "def parse_stmt\n if consume(:if)\n cond = parse_expression\n raise \"parse error\" if cond.nil?\n block = parse_block\n alt = nil\n if consume(:else)\n alt = parse_block\n end\n Node.new(:if, cond: cond, lhs: block, rhs: alt)\n elsif consume(:return)\n Node.new(:return, args: parse_args)\n else\n parse_expression\n end\n end", "def if_statement\n @instruction.push(@enum.peek.value)\n match(Token.new(:reserved, 'if'))\n @instruction.push(@enum.peek.value)\n match(Token.new(:symbol, '('))\n condition_expression\n @instruction.push(@enum.peek.value)\n match(Token.new(:symbol, ')'))\n @if_count += 1\n @instruction.push('goto state_'+@if_count.to_s+';'+\"\\n\"+'goto state_'+(@if_count+1).to_s+';'+\"\\n\"+' state_'+@if_count.to_s+':;'+\"\\n\")\n @if_count += 1\n block_statements\n @instruction.push(' state_'+@if_count.to_s+\":0;\\n\")\n else_statement\n end", "def if_statement\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 25 )\n return_value = IfStatementReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n string_literal96 = nil\n string_literal97 = nil\n string_literal100 = nil\n clause98 = nil\n block99 = nil\n block101 = nil\n\n tree_for_string_literal96 = nil\n tree_for_string_literal97 = nil\n tree_for_string_literal100 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 413:5: ( 'if' | 'unless' ) clause block ( 'else' block )?\n # at line 413:5: ( 'if' | 'unless' )\n alt_18 = 2\n look_18_0 = @input.peek( 1 )\n\n if ( look_18_0 == IF )\n alt_18 = 1\n elsif ( look_18_0 == UNLESS )\n alt_18 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 18, 0 )\n end\n case alt_18\n when 1\n # at line 413:7: 'if'\n string_literal96 = match( IF, TOKENS_FOLLOWING_IF_IN_if_statement_2720 )\n if @state.backtracking == 0\n\n tree_for_string_literal96 = @adaptor.create_with_payload( string_literal96 )\n root_0 = @adaptor.become_root( tree_for_string_literal96, root_0 )\n\n end\n\n when 2\n # at line 413:15: 'unless'\n string_literal97 = match( UNLESS, TOKENS_FOLLOWING_UNLESS_IN_if_statement_2725 )\n if @state.backtracking == 0\n\n tree_for_string_literal97 = @adaptor.create_with_payload( string_literal97 )\n root_0 = @adaptor.become_root( tree_for_string_literal97, root_0 )\n\n end\n\n end\n @state.following.push( TOKENS_FOLLOWING_clause_IN_if_statement_2730 )\n clause98 = clause\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, clause98.tree )\n end\n @state.following.push( TOKENS_FOLLOWING_block_IN_if_statement_2732 )\n block99 = block\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, block99.tree )\n end\n # at line 413:40: ( 'else' block )?\n alt_19 = 2\n look_19_0 = @input.peek( 1 )\n\n if ( look_19_0 == ELSE )\n alt_19 = 1\n end\n case alt_19\n when 1\n # at line 413:42: 'else' block\n string_literal100 = match( ELSE, TOKENS_FOLLOWING_ELSE_IN_if_statement_2736 )\n @state.following.push( TOKENS_FOLLOWING_block_IN_if_statement_2739 )\n block101 = block\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, block101.tree )\n end\n\n end\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__, 25 )\n\n end\n \n return return_value\n end", "def if_statement(fn)\n match(Token.new(:reserved, 'if'))\n match(Token.new(:symbol, '('))\n tf = condition_expression(fn)\n match(Token.new(:symbol, ')'))\n is_nxt = fn.new_label\n is_else = tf[1]\n fn.code << \"#{tf[0]}:;\\n\"\n #fn.code << block_statements(fn)\n block_statements(fn)\n fn.code << \"goto #{is_nxt};\\n\"\n else_statement(fn, tf[1], is_nxt)\n\n end", "def if!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 19 )\n\n type = IF\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 321:6: 'if'\n match( \"if\" )\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__, 19 )\n\n end", "def if!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 13 )\n\n type = IF\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 134:6: 'if'\n match( \"if\" )\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__, 13 )\n\n end", "def switch_statement(var_env)\n return nil unless eql_lit?(ECMA262::ID_SWITCH)\n\n if eql_lit?(ECMA262::PUNC_LPARENTHESIS) and e=exp(var_env, {}) and eql_lit?(ECMA262::PUNC_RPARENTHESIS) and c = case_block(var_env)\n ECMA262::StSwitch.new(e, c)\n else\n raise ParseError.new(\"unexpected token\", self)\n end\n end", "def if_stmt \n\t\n\t$cst.add_branch(\"IfStatement\")\n\t\n\tmatch_token(\"T_IF\", $tokens[$index])\n\tboolexpr\n\tblock\n\t\n\t$cst.ascend\n\t\nend", "def expand_if(condition, new_node_context = self.node, alt_markup = @markup)\n res = \"\"\n res << \"<% if #{condition} %>\"\n with_context(:node => new_node_context) do\n res << wrap(expand_with)\n end\n\n only = method == 'case' ? %r{^[A-Z]|else|elsif|when} : %w{else elsif when}\n res << expand_with(:in_if => true, :only => only, :markup => alt_markup)\n res << \"<% end %>\"\n res\n end", "def emit_true_if_branch\n emit_self(new(Rubinius::AST::TrueLiteral), if_branch, else_branch)\n end", "def if!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 43 )\n\n\n\n type = IF\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 221:5: 'if'\n match( \"if\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 43 )\n\n\n end", "def parse_else_if_header\n expect(:KW_ELSE_IF)\n expect(:L_PARANTH)\n cond = parse_expression\n expect(:R_PARANTH)\n\n cond\n end", "def tokenize_else(_chunk)\n raise Errors::UnexpectedElse unless @current_scope.inside_if_block?\n token = Token.new Token::ELSE\n @stack << token\n close_if_statement\n token\n end", "def fn_if(condition, when_true, when_false)\n {\n \"Fn::If\" => [condition, when_true, when_false]\n }\n end", "def conditional_statement_Handler(cs)\n\texpr = cs.elems[0]\n\tinstr1 = cs.elems[1]\n\tresult = instr_Handler(instr1)\n\tif (cs.elems[2] != nil)\n\t\tinstr2 = cs.elems[2]\n\t\tresult += instr_Handler(instr2)\n\tend\n\tif (expression_Handler(expr) != :BOOLEAN)\n\t\tputs \"CONDITIONAL STATEMENT ERROR: expression must be boolean.\"\n\t\tresult += 1\n\tend\n\treturn result\nend", "def conditional_statement_Handler(cs)\n\texpr = cs.elems[0]\n\tinstr1 = cs.elems[1]\n\tresult = instr_Handler(instr1)\n\tif (cs.elems[2] != nil)\n\t\tinstr2 = cs.elems[2]\n\t\tresult += instr_Handler(instr2)\n\tend\n\tif (expression_Handler(expr) != :BOOLEAN)\n\t\tputs \"CONDITIONAL STATEMENT ERROR: expression must be boolean.\"\n\t\tresult += 1\n\tend\n\treturn result\nend", "def if_statement\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 11 )\n\n\n value = nil\n\n\n a = nil\n b = nil\n\n\n begin\n # at line 83:5: IF a= expression ( CLOSE | NL (b= statement )* CLOSE )\n match( IF, TOKENS_FOLLOWING_IF_IN_if_statement_630 )\n @state.following.push( TOKENS_FOLLOWING_expression_IN_if_statement_634 )\n a = expression\n @state.following.pop\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value = IfStatementEval.new(a) \n # <-- action\n end\n\n # at line 84:3: ( CLOSE | NL (b= statement )* CLOSE )\n alt_24 = 2\n look_24_0 = @input.peek( 1 )\n\n if ( look_24_0 == CLOSE )\n alt_24 = 1\n elsif ( look_24_0 == NL )\n alt_24 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n\n\n raise NoViableAlternative( \"\", 24, 0 )\n\n end\n case alt_24\n when 1\n # at line 84:5: CLOSE\n match( CLOSE, TOKENS_FOLLOWING_CLOSE_IN_if_statement_642 )\n\n when 2\n # at line 84:13: NL (b= statement )* CLOSE\n match( NL, TOKENS_FOLLOWING_NL_IN_if_statement_646 )\n # at line 84:16: (b= statement )*\n while true # decision 23\n alt_23 = 2\n look_23_0 = @input.peek( 1 )\n\n if ( look_23_0.between?( IDENT, IF ) || look_23_0 == RETURN || look_23_0 == WHILE )\n alt_23 = 1\n\n end\n case alt_23\n when 1\n # at line 84:17: b= statement\n @state.following.push( TOKENS_FOLLOWING_statement_IN_if_statement_651 )\n b = statement\n @state.following.pop\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value.add_statement(b) \n # <-- action\n end\n\n\n else\n break # out of loop for decision 23\n end\n end # loop for decision 23\n\n match( CLOSE, TOKENS_FOLLOWING_CLOSE_IN_if_statement_658 )\n\n end\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 11 )\n\n\n end\n\n return value\n end", "def handle_switch(directive, names, extras); end", "def parse_if_statement cur_tok\n\t\t\n\t\tconditional = parse_next\n\t\tif not (@tokens.peak and @tokens.peak.type == \"Keyword\" and @tokens.peak.value == \"then\")\n\t\t\tthrow_error(\"In If statement, expected 'then', got: #{@tokens.peak}.\", tokens.peak)\n\t\tend\n\t\[email protected] # Get rid of 'then'.\n\n\t\tif_true = parse_next\n\t\tif (@tokens.peak and @tokens.peak.type == \"Keyword\" and @tokens.peak.value == \"end\")\n\t\t\[email protected] \n\t\t\treturn IfThenElse.new(cur_tok.line, cur_tok.col, conditional, if_true)\n\t\telsif not (@tokens.peak and @tokens.peak.type == \"Keyword\" and @tokens.peak.value == \"else\")\n\t\t\tthrow_error(\"In If statement, expected 'else', got: #{@tokens.peak}.\", tokens.peak)\n\t\tend\n\t\[email protected] # Get rid of 'else'.\n\t\t\n\t\tif_false = parse_next\n\t\tif (@tokens.peak and @tokens.peak.type == \"Keyword\" and @tokens.peak.value == \"end\")\n\t\t\[email protected]\n\t\t\treturn IfThenElse.new(cur_tok.line, cur_tok.col, conditional, if_true, if_false)\n\t\telse\n\t\t\tthrow_error(\"In If statement, expected 'end', got: #{@tokens.peak}.\", @tokens.peak)\n\t\tend\n\tend", "def normalize_ifs(ifs)\n case ifs\n when NilClass\n nil\n when Array\n ifs.map do |iff|\n lambda { val = variables.value_of(iff.to_s); !val.nil? && !val.kind_of?(FalseClass) && val != 'false' }\n end\n when Hash\n ifs.each_with_object([]) do |(k, v), arr|\n arr << lambda { variables.value_of(k.to_s) == v }\n end\n when String, Symbol\n [lambda { val = variables.value_of(ifs.to_s); !val.nil? && !val.kind_of?(FalseClass) && val != 'false' }]\n else\n raise TypeError, \"Invalid syntax for if: #{ifs.inspect}\"\n end\n end", "def parse(switch, value, argv)\n raise \"value specified for switch: #{switch}\" if value\n value = (switch == negative_long ? false : true)\n block ? block.call(value) : value\n end", "def my_if(condition, then_clause, else_clause)\n if condition\n then_clause.call\n else\n else_clause.call\n end\nend", "def else!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 20 )\n\n type = ELSE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 322:8: 'else'\n match( \"else\" )\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__, 20 )\n\n end", "def parseBlock(sexp, var)\n op; pk(\"and\")\n for i in 1..sexp.size-1\n\truby2kif(sexp[i],var)\n end\n cl\n end", "def conditional_statement\n unless token_is? :if\n return nil\n end\n\n @scanner.get_next_token # The 'if'\n condition = conditional_expression\n require :new_line\n require :open_block\n statement_list = []\n while (@scanner.look_ahead.is_not? :close_block)\n statement_list << statement()\n end\n\n require :close_block\n return { if: { condition: condition, statements: statement_list }}\n end", "def else!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 44 )\n\n\n\n type = ELSE\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 222:7: 'else'\n match( \"else\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 44 )\n\n\n end", "def else!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 66 )\n\n type = ELSE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 187:8: 'else'\n match( \"else\" )\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__, 66 )\n\n end", "def empty_case_statement?(node)\n node.else_branch.nil? && node.when_branches.all? { |x| x.body.nil? }\n end", "def sIf\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 7 )\n\n begin\n # at line 45:11: IF LPAR comp RPAR bloq ( ELSE bloq )?\n match( IF, TOKENS_FOLLOWING_IF_IN_sIf_333 )\n match( LPAR, TOKENS_FOLLOWING_LPAR_IN_sIf_335 )\n @state.following.push( TOKENS_FOLLOWING_comp_IN_sIf_337 )\n comp\n @state.following.pop\n match( RPAR, TOKENS_FOLLOWING_RPAR_IN_sIf_339 )\n # --> action\n agc_4('if')\n # <-- action\n @state.following.push( TOKENS_FOLLOWING_bloq_IN_sIf_343 )\n bloq\n @state.following.pop\n # --> action\n agc_5('if')\n # <-- action\n # --> action\n agc_4('else')\n # <-- action\n # at line 45:78: ( ELSE bloq )?\n alt_9 = 2\n look_9_0 = @input.peek( 1 )\n\n if ( look_9_0 == ELSE )\n alt_9 = 1\n end\n case alt_9\n when 1\n # at line 45:79: ELSE bloq\n match( ELSE, TOKENS_FOLLOWING_ELSE_IN_sIf_350 )\n @state.following.push( TOKENS_FOLLOWING_bloq_IN_sIf_352 )\n bloq\n @state.following.pop\n\n end\n # --> action\n agc_5('else')\n # <-- action\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 7 )\n\n end\n \n return \n end", "def check_else(els)\n # put through translator with original target to mimic as if\n # else were change;\n # literal=true to make sure always x>y syntax\n return initial(@rule[0], els, true).sub(/\\A(.*)>/, '').strip\n end", "def else_statement(fn, ce_false, is_nxt)\n if @scanner.peek.value == 'else'\n match(Token.new(:identifier, 'else'))\n fn.code << \"#{ce_false}:;\\n\"\n block_statements(fn)\n fn.code << \"#{is_nxt}:;\\n\"\n\n else\n fn.code << \"#{is_nxt}:;\\n\"\n fn.code << \"#{ce_false}:;\\n\"\n end\n end", "def case_statement(number)\n case\n when number < 0\n puts \"This is not a valid entry!\"\n when number <= 50\n puts \"You have chosen #{number}, and it is between 0 and 50\"\n when number <= 100\n puts \"You have chosen #{number}, and it is between 51 and 100\"\n else number > 101\n puts \"#{number} is above 100\"\n end\nend", "def conditional_parentheses(flag)\n if flag\n parentheses { yield }\n else\n yield\n end\n end", "def if!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 5 )\n\n\n\n type = IF\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 26:5: 'si'\n match( \"si\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 5 )\n\n\n end", "def parser_else(args)\r\n if @if_stack.empty?\r\n #_rl_init_file_error (\"$else found without matching $if\")\r\n return 0\r\n end\r\n\r\n # Check the previous (n) levels of the stack to make sure that\r\n # we haven't previously turned off parsing.\r\n return 0 if @if_stack.detect {|x| x }\r\n\r\n # Invert the state of parsing if at top level.\r\n @_rl_parsing_conditionalized_out = !@_rl_parsing_conditionalized_out\r\n return 0\r\n end", "def current_is_switch?\n case peek\n when LONG_RE, SHORT_RE, EQ_RE, SHORT_NUM\n [true, switch?($1)]\n when SHORT_SQ_RE\n [true, $1.split(\"\").any? { |f| switch?(\"-#{f}\") }]\n else\n [false, false]\n end\n end", "def compile_ternif(scope, cond, alt)\n if alt.is_a?(Array) && alt[0] == :ternalt\n if_arm = alt[1]\n else_arm = alt[2]\n else\n if_arm = alt\n end\n compile_if(scope,cond,if_arm,else_arm)\n end", "def compile_ternif(scope, cond, alt)\n if alt.is_a?(Array) && alt[0] == :ternalt\n if_arm = alt[1]\n else_arm = alt[2]\n else\n if_arm = alt\n end\n compile_if(scope,cond,if_arm,else_arm)\n end", "def parse_boolean(switch)\n if current_is_value?\n if [\"true\", \"TRUE\", \"t\", \"T\", true].include?(peek)\n shift\n true\n elsif [\"false\", \"FALSE\", \"f\", \"F\", false].include?(peek)\n shift\n false\n else\n !no_or_skip?(switch)\n end\n else\n @switches.key?(switch) || !no_or_skip?(switch)\n end\n end", "def optimize_if_return(node = @prog)\n retry_flag = true\n while retry_flag\n retry_flag = false\n node.traverse(nil) {|st0, parent0|\n if st0.kind_of? ECMA262::StIf and parent0.kind_of? ECMA262::StatementList\n i = parent0.index(st0)\n break if i.nil?\n parent = parent0.deep_dup\n st = parent[i]\n #\n if parent[i+1].nil? and !parent.kind_of?(ECMA262::SourceElements)\n next\n end\n if parent[i+1].nil? or parent[i+1].to_return?\n s = st\n while s.kind_of? ECMA262::StIf and s.else_st and s.then_st.to_return?\n s = s.else_st\n end\n if s and s.kind_of? ECMA262::StIf and s.then_st.to_return?\n if parent[i+1]\n s.replace(s.else_st, parent[i+1])\n parent.replace(parent[i+1], ECMA262::StEmpty.new)\n else\n s.replace(s.else_st, ECMA262::StReturn.new(ECMA262::ExpVoid.new(ECMA262::ECMA262Numeric.new(0))))\n end\n if_to_cond(parent)\n if parent.to_js(:no_debug => true).length <= parent0.to_js(:no_debug => true).length\n parent0.replace(st0, st)\n if parent[i+1]\n parent0.replace(parent0[i+1], ECMA262::StEmpty.new)\n end\n retry_flag = true\n node = parent0\n end\n end\n end\n end\n }\n end\n self\n end", "def on_ternary_if(node)\n comparsion, op = node.children\n node.children.concat op.children.slice!(2..-1)\n\n on_ternary_if_boolean(node)\n end", "def else_statement\n if @enum.peek.value == 'else'\n @instruction.push('state_'+(@if_count+1).to_s+\":\\n\")\n match(Token.new(:reserved, 'else'))\n block_statements\n end\n end", "def test2_number number\n case\n when number < 0\n puts \"Your number is negative...\"\n when number <= 50\n puts \"#{number} is between 0 and 50\"\n when number <= 100\n puts \"#{number} is between 51 and 100\"\n else\n puts \"#{number} is greater than 100\"\n end\nend", "def create_switch( key, value_filters_map )\n switch = Switch.new\n value_filters_map.each do |value, (filters, listener)|\n create_chain( value.to_s.downcase, filters, listener ) do |chain|\n switch.add_proposition( Selector.new( key, value ), chain )\n end\n end\n switch\n end", "def operator_case_test \n case @operator \n when \"+\"\n puts \"accepted\"\n second_number_function \n when \"-\"\n puts \"accepted\"\n second_number_function\n when \"/\"\n puts \"accepted\"\n second_number_function \n when \"*\" \n puts \"accepted\"\n second_number_function \n else puts \"Operator not recognized.\"\n operator_function \n end \nend", "def compile_if(scope, cond, if_arm, else_arm = nil)\n res = compile_eval_arg(scope, cond)\n l_else_arm = @e.get_local\n l_end_if_arm = @e.get_local\n @e.jmp_on_false(l_else_arm, res)\n compile_eval_arg(scope, if_arm)\n @e.jmp(l_end_if_arm) if else_arm\n @e.local(l_else_arm)\n compile_eval_arg(scope, else_arm) if else_arm\n @e.local(l_end_if_arm) if else_arm\n\n # At the moment, we're not keeping track of exactly what might have gone on\n # in the if vs. else arm, so we need to assume all bets are off.\n @e.evict_all\n\n return [:subexpr]\n end", "def if!(cond_proc, subnode)\r\n @if_count += 1\r\n if_name = \"__json_conditional_#{@if_count}__\".to_sym\r\n @command_queue.push(if_name)\r\n\r\n # Conditionals should not \r\n conditional = proc do |inst, *extra|\r\n if inst.is_a?(DummyUtil)\r\n inst = DummyUtil.new('Conditional')\r\n result = true\r\n else\r\n result = inst.instance_eval(&cond_proc)\r\n end\r\n return subnode.export_inside!(inst) if result && subnode\r\n return nil\r\n end\r\n\r\n @spec_class.send :define_method, if_name, &conditional\r\n @raw[if_name] = subnode\r\n end", "def else!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 6 )\n\n\n\n type = ELSE\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 27:7: 'sino'\n match( \"sino\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 6 )\n\n\n end", "def _reduce_336(val, _values, result)\n else_t, else_ = val[4]\n result = [ val[0],\n @builder.condition(val[0], val[1], val[2],\n val[3], else_t,\n else_, nil),\n ]\n \n result\nend", "def process_else(exp)\n add_to_score :branch\n penalize_by 0.1 do\n process_until_empty exp\n end\n s()\n end", "def compile_if(scope, cond, if_arm, else_arm = nil)\n compile_eval_arg(scope, cond)\n l_else_arm = @e.get_local\n l_end_if_arm = @e.get_local\n @e.jmp_on_false(l_else_arm)\n compile_eval_arg(scope, if_arm)\n @e.jmp(l_end_if_arm) if else_arm\n @e.local(l_else_arm)\n compile_eval_arg(scope, else_arm) if else_arm\n @e.local(l_end_if_arm) if else_arm\n return [:subexpr]\n end", "def casestatement(number)\nanswer = case\n when number < 0\n \"#{number} is negative\"\n when number <= 50\n \"#{number} is between 0 and 50\"\n when number <= 100\n \"#{number} is between 51 and 100\"\n else\n \"#{number} is greater than 100\"\n end\nputs answer # Note how we just moved this INTO the method.\nend", "def rewrite_if(expression)\n # The sexp for the condition passed to if is inside expression[1]\n # We can further process this sexp if it has and/or in it.\n condition = expression[1]\n then_do = expression[2]\n else_do = expression[3]\n\n # This ugly sexp turns into the following Ruby code:\n # VirtualKeywords::REWRITTEN_KEYWORDS.call_if(\n # self, lambda { condition }, lambda { then_do }, lambda { else_do })\n s(:call,\n s(:colon2,\n s(:const, :VirtualKeywords),\n :REWRITTEN_KEYWORDS\n ), :call_if,\n s(:array,\n s(:self),\n s(:iter, s(:fcall, :lambda), nil, condition),\n s(:iter, s(:fcall, :lambda), nil, then_do),\n s(:iter, s(:fcall, :lambda), nil, else_do)\n )\n )\n end", "def extract_cond!(transitions)\n cond = transitions.slice(:if, :unless)\n transitions.delete(:if)\n transitions.delete(:unless)\n cond\n end", "def casefold?() end", "def on_ifop(statement, true_val, false_val)\n return Node.new(\n :ternary,\n [statement, true_val, false_val],\n metadata\n )\n end", "def switch(number, twitch)\n return number if twitch.nil?\n check_num = twitch.index(twitch.find { |x| x != nil })\n# p check_num\n case check_num\n when 0 then number + twitch[check_num]\n when 1 then number - twitch[check_num]\n when 2 then number * twitch[check_num]\n when 3 then number / twitch[check_num]\n end\nend", "def process_else(exp)\n add_to_score :branch\n @scorer.penalize_by 0.1 do\n analyze_list exp\n end\n s()\n end", "def mag_input_case(number)\n result = case\n when number<=50\n 'Number still less than 50.'\n when number >50 && number<=100\n 'Number still between 50 and 100.'\n when number > 100\n \"You're still breaking the rules.\"\n end\n\n return result\nend", "def select(_if, _then, _else, name = \"\")\n Instruction.from_ptr(C.build_select(self, _if, _then, _else, name))\n end", "def _reduce_474(val, _values, result)\n body, _, cond = val\n body = remove_begin body\n\n result = s(:if, cond, body, nil).line body.line\n\n result\nend", "def monty_hall(door_picked, switch_doors)\n # ? door_picked => which door is initially selected\n # ? switch_doors => will the user switch doors, boolean\n\n # * door_picked == 1\n # * if switch_doors => true, then output = 1\n # * if switch_doors => false, then output = 3\n # * door_picked > 1\n # * if switch_doors => true, then output = 2\n # * if switch_doors => false, then output = 4\n \n scen_one = (door_picked == 1 && !switch_doors)\n scen_two = (door_picked > 1 && switch_doors)\n scen_three = (door_picked == 1 && switch_doors)\n scen_four = (door_picked > 1 && !switch_doors)\n\n # ? Output => \n # * 1: Success w/ no switch\n # * 2: Success w/ switch\n # * 3: Failure w/ no switch\n # * 4: Failure w/ switch\n \n if scen_one\n output = 1\n elsif scen_two\n output = 2\n elsif scen_three\n output = 3\n else scen_four\n output = 4\n end\n\n output\n \nend", "def optimize_if_return2(node = @prog)\n node.traverse(nil) {|st, parent|\n if st.kind_of? ECMA262::StIf and st.else_st and parent.kind_of? ECMA262::StatementList\n st.remove_empty_statement\n if (st.then_st.kind_of? ECMA262::StBlock and st.then_st[-1].kind_of? ECMA262::StReturn) or\n st.then_st.kind_of? ECMA262::StReturn\n idx = parent.index(st)\n parent[idx+1..0] = st.else_st\n st.replace(st.else_st, nil)\n end\n end\n }\n self\n end", "def if_proc; end", "def vowels_with_ternary_operator(letter)\n (vowels.include? letter) ? true : false # this only seems to work when I put the conditional in parenthesis\nend", "def if(condition, true_value, false_value)\n {\"Fn::If\" => [condition, true_value, false_value]}\n end", "def main\n\n #\n # In Ruby, everything is an expression, even the control structures.\n #\n\n #\n # if, else, elsif\n #\n # The value that results from evaluating an if expression is the\n # value of the last expression in the code that was executed, or\n # nil if no block of code is executed.\n #\n \n x = 3\n\n if x == 1\n name = \"one\"\n elsif x == 2\n name = \"two\"\n elsif x == 3\n name = \"three\"\n elsif x == 4\n name = \"four\"\n else\n name = \"many\"\n end\n\n puts name\n\n # here is another way to write the above if expression\n\n if x == 1\n name = \"one\"\n elsif x == 2\n name = \"two\"\n elsif x == 3 then name = \"three\"\n elsif x == 4 ; name = \"four\"\n else\n name = \"many\"\n end\n\n puts name\n\n # here is another way to write the above if expression\n\n name = if x == 1 then \"one\"\n elsif x == 2 then \"two\"\n elsif x == 3 then \"three\"\n elsif x == 4 then \"four\"\n else \"many\"\n end\n\n puts name\n\n # for single-line conditionals: use \"if\" as a modifier\n y = x.odd? if x.respond_to?(:odd?)\n puts y\n \n #\n # unless is the opposite of if. unless executes code only if associated\n # expression evaluates to false or nil. elsif clauses are not allowed.\n #\n x = 10\n unless x == 0\n puts \"x is not 0\"\n else\n puts \"x is 0\"\n end\n \n # for single-line conditionals: use \"unless\" as a modifier\n s = x.to_s unless x.nil?\n puts s\n \n #\n # case statement is a multiway conditional. Like if, case returns a value\n #\n x = 5\n case x\n when 1\n name = \"one\"\n when 2\n name = \"two\"\n when 3\n name = \"three\"\n when 4\n name = \"four\"\n else # optional\n name = \"many\"\n end\n puts name\n \n # since case returns a value, here is another way to write the above case\n name = case x\n when 1\n \"one\"\n when 2\n \"two\"\n when 3\n \"three\"\n when 4\n \"four\"\n else \"many\"\n end\n puts name\n \n #\n # Ruby has three looping statements: while, until, and for/in.\n #\n x = 10\n while x >= 0 do\n puts x\n x -= 1\n end\n puts\n \n # above code using until\n x = 10\n until x < 0 do\n puts x\n x -= 1\n end\n puts\n \n # while as a modifier\n x = 0\n puts x = x + 1 while x < 10\n puts\n \n # until as a modifier\n x = 0\n puts x = x + 1 until x == 10\n puts\n \n #\n # for/in loop is used to iterate through the elements of an enumerable object\n #\n for i in 1..10 do\n print i, \" \"\n end\n print \"\\n\\n\"\n \n # print elements in an array\n a = [5, 10, 15, 20, 25]\n for e in a do\n print e, \" \"\n end\n print \"\\n\\n\"\n \n # print keys and values in a hash\n h = {:a => 1, :b => 2, :c => 3}\n for key,value in h\n puts \"#{key} => #{value}\"\n end\n puts\n \nend", "def categorize_by_case(number)\n case number\n when <= 50\n puts \"#{number} is between 0 and 50.\"\n when <= 100\n puts \"#{number} is between 51 and 100.\"\n else \n puts \"#{number} is above 100.\"\n end\nend", "def collapse_boolean_literals(node)\n map node do |n|\n case n\n when And\n if n.children.any? do |c|\n False === c\n end\n puts \"Collapsing and(false)\"\n False.new\n else\n n.children.delete_if do |c|\n True === c\n end\n n\n end\n when Or\n if n.children.any? do |c|\n True === c\n end\n puts \"Collapsing or(true)\"\n True.new\n else\n n.children.delete_if do |c|\n False === c\n end\n n\n end\n else\n n\n end\n end\n end" ]
[ "0.70899206", "0.67532337", "0.67532337", "0.64739573", "0.6440181", "0.6146391", "0.6141592", "0.6138998", "0.6123627", "0.60947526", "0.58883935", "0.5840469", "0.57809496", "0.57747877", "0.5759751", "0.5699032", "0.5673397", "0.5672154", "0.56571805", "0.5650493", "0.5638123", "0.55948764", "0.5551256", "0.5526445", "0.5432295", "0.54318374", "0.54163986", "0.536677", "0.53470373", "0.53273356", "0.53234303", "0.5279733", "0.52784467", "0.5218401", "0.52028763", "0.52016735", "0.5193196", "0.5179306", "0.51759595", "0.51491475", "0.51369905", "0.513374", "0.51247966", "0.51146847", "0.5109677", "0.51004803", "0.51004803", "0.5062565", "0.5054929", "0.5052587", "0.5043082", "0.5040606", "0.5034566", "0.5028556", "0.50264287", "0.5017236", "0.50149196", "0.5013434", "0.50089365", "0.5006655", "0.50036407", "0.49998617", "0.49997014", "0.49949592", "0.49793756", "0.49789453", "0.49689335", "0.49474272", "0.49474272", "0.49452507", "0.49436736", "0.4917075", "0.4911373", "0.4907499", "0.49023536", "0.4900212", "0.48895496", "0.48889896", "0.48825225", "0.48660913", "0.48616755", "0.48595533", "0.48526597", "0.48472", "0.48434043", "0.4843225", "0.48290965", "0.48212117", "0.48140654", "0.4812571", "0.4806061", "0.48059854", "0.4793585", "0.4790921", "0.47906023", "0.47783807", "0.47716665", "0.47695306", "0.47675925", "0.47597978" ]
0.8090183
0
Transforms `for` to `while`expression
def transform_for_to_while(for_expr) _tag, init, condition, modifier, body = for_expr ['begin', init, ['while', condition, ['begin', body, modifier]]] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def for_loop\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 21 )\n return_value = ForLoopReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n\n _last = _first_0 = nil\n string_literal77 = nil\n string_literal83 = nil\n __ID85__ = nil\n __FOR_IN88__ = nil\n __ID90__ = nil\n variable_statement78 = nil\n expression79 = nil\n expression80 = nil\n expression81 = nil\n block82 = nil\n variable_statement84 = nil\n expression86 = nil\n block87 = nil\n variable_statement89 = nil\n expression91 = nil\n block92 = nil\n\n tree_for_string_literal77 = nil\n tree_for_string_literal83 = nil\n tree_for_ID85 = nil\n tree_for_FOR_IN88 = nil\n tree_for_ID90 = nil\n\n begin\n # at line 116:3: ( ^( 'for' ( variable_statement | expression ) expression expression block ) | ^( 'each' ( variable_statement | ID ) expression block ) | ^( FOR_IN ( variable_statement | ID ) expression block ) )\n alt_24 = 3\n case look_24 = @input.peek( 1 )\n when FOR then alt_24 = 1\n when EACH then alt_24 = 2\n when FOR_IN then alt_24 = 3\n else\n raise NoViableAlternative( \"\", 24, 0 )\n end\n case alt_24\n when 1\n root_0 = @adaptor.create_flat_list\n\n\n # at line 116:5: ^( 'for' ( variable_statement | expression ) expression expression block )\n _save_last_1 = _last = @input.look\n _first_1 = nil\n root_1 = @adaptor.create_flat_list\n _last = @input.look\n string_literal77 = match( FOR, TOKENS_FOLLOWING_FOR_IN_for_loop_603 )\n\n tree_for_string_literal77 = @adaptor.copy_node( string_literal77 )\n\n root_1 = @adaptor.become_root( tree_for_string_literal77, root_1 )\n\n\n\n match( DOWN, nil )\n # at line 116:15: ( variable_statement | expression )\n alt_21 = 2\n look_21_0 = @input.peek( 1 )\n\n if ( look_21_0 == VAR )\n alt_21 = 1\n elsif ( look_21_0.between?( AMP, AMP_ASGN ) || look_21_0 == POST_DECR || look_21_0.between?( GEQ, AREF ) || look_21_0.between?( GREATER, HAT ) || look_21_0.between?( ARROW, HAT_ASGN ) || look_21_0 == ASGN || look_21_0 == REGEX || look_21_0 == IN || look_21_0 == INCR || look_21_0.between?( INSTANCEOF, RSHIFT3 ) || look_21_0 == RSHIFT3_ASGN || look_21_0 == RSHIFT_ASGN || look_21_0 == LEQ || look_21_0.between?( LESS, SLASH ) || look_21_0 == SLASH_ASGN || look_21_0.between?( STAR, DECR ) || look_21_0 == STAR_ASGN || look_21_0 == LSHIFT || look_21_0.between?( DELETE, THIS ) || look_21_0.between?( MINUS, TILDE ) || look_21_0.between?( MINUS_ASGN, MOD ) || look_21_0.between?( MOD_ASGN, TYPEOF ) || look_21_0.between?( NEQ, UMINUS ) || look_21_0.between?( NEQQ, UNDEFINED ) || look_21_0 == NEW || look_21_0 == NOT || look_21_0.between?( NULL, UPLUS ) || look_21_0 == OBJECT || look_21_0.between?( EQ, OR_ASGN ) || look_21_0 == FALSE || look_21_0 == PIPE || look_21_0 == PIPE_ASGN || look_21_0 == PLUS || look_21_0.between?( ID, DOC ) )\n alt_21 = 2\n else\n raise NoViableAlternative( \"\", 21, 0 )\n end\n case alt_21\n when 1\n # at line 116:17: variable_statement\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_variable_statement_IN_for_loop_608 )\n variable_statement78 = variable_statement\n @state.following.pop\n\n @adaptor.add_child( root_1, variable_statement78.tree )\n\n\n when 2\n # at line 116:38: expression\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_expression_IN_for_loop_612 )\n expression79 = expression\n @state.following.pop\n\n @adaptor.add_child( root_1, expression79.tree )\n\n\n end\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_expression_IN_for_loop_616 )\n expression80 = expression\n @state.following.pop\n\n @adaptor.add_child( root_1, expression80.tree )\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_expression_IN_for_loop_618 )\n expression81 = expression\n @state.following.pop\n\n @adaptor.add_child( root_1, expression81.tree )\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_block_IN_for_loop_620 )\n block82 = block\n @state.following.pop\n\n @adaptor.add_child( root_1, block82.tree )\n\n match( UP, nil )\n @adaptor.add_child( root_0, root_1 )\n _last = _save_last_1\n\n\n\n when 2\n root_0 = @adaptor.create_flat_list\n\n\n # at line 117:5: ^( 'each' ( variable_statement | ID ) expression block )\n _save_last_1 = _last = @input.look\n _first_1 = nil\n root_1 = @adaptor.create_flat_list\n _last = @input.look\n string_literal83 = match( EACH, TOKENS_FOLLOWING_EACH_IN_for_loop_630 )\n\n tree_for_string_literal83 = @adaptor.copy_node( string_literal83 )\n\n root_1 = @adaptor.become_root( tree_for_string_literal83, root_1 )\n\n\n\n match( DOWN, nil )\n # at line 117:15: ( variable_statement | ID )\n alt_22 = 2\n look_22_0 = @input.peek( 1 )\n\n if ( look_22_0 == VAR )\n alt_22 = 1\n elsif ( look_22_0 == ID )\n alt_22 = 2\n else\n raise NoViableAlternative( \"\", 22, 0 )\n end\n case alt_22\n when 1\n # at line 117:17: variable_statement\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_variable_statement_IN_for_loop_634 )\n variable_statement84 = variable_statement\n @state.following.pop\n\n @adaptor.add_child( root_1, variable_statement84.tree )\n\n\n when 2\n # at line 117:38: ID\n _last = @input.look\n __ID85__ = match( ID, TOKENS_FOLLOWING_ID_IN_for_loop_638 )\n\n tree_for_ID85 = @adaptor.copy_node( __ID85__ )\n\n @adaptor.add_child( root_1, tree_for_ID85 )\n\n\n\n end\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_expression_IN_for_loop_642 )\n expression86 = expression\n @state.following.pop\n\n @adaptor.add_child( root_1, expression86.tree )\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_block_IN_for_loop_644 )\n block87 = block\n @state.following.pop\n\n @adaptor.add_child( root_1, block87.tree )\n\n match( UP, nil )\n @adaptor.add_child( root_0, root_1 )\n _last = _save_last_1\n\n\n\n when 3\n root_0 = @adaptor.create_flat_list\n\n\n # at line 118:5: ^( FOR_IN ( variable_statement | ID ) expression block )\n _save_last_1 = _last = @input.look\n _first_1 = nil\n root_1 = @adaptor.create_flat_list\n _last = @input.look\n __FOR_IN88__ = match( FOR_IN, TOKENS_FOLLOWING_FOR_IN_IN_for_loop_654 )\n\n tree_for_FOR_IN88 = @adaptor.copy_node( __FOR_IN88__ )\n\n root_1 = @adaptor.become_root( tree_for_FOR_IN88, root_1 )\n\n\n\n match( DOWN, nil )\n # at line 118:15: ( variable_statement | ID )\n alt_23 = 2\n look_23_0 = @input.peek( 1 )\n\n if ( look_23_0 == VAR )\n alt_23 = 1\n elsif ( look_23_0 == ID )\n alt_23 = 2\n else\n raise NoViableAlternative( \"\", 23, 0 )\n end\n case alt_23\n when 1\n # at line 118:17: variable_statement\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_variable_statement_IN_for_loop_658 )\n variable_statement89 = variable_statement\n @state.following.pop\n\n @adaptor.add_child( root_1, variable_statement89.tree )\n\n\n when 2\n # at line 118:38: ID\n _last = @input.look\n __ID90__ = match( ID, TOKENS_FOLLOWING_ID_IN_for_loop_662 )\n\n tree_for_ID90 = @adaptor.copy_node( __ID90__ )\n\n @adaptor.add_child( root_1, tree_for_ID90 )\n\n\n\n end\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_expression_IN_for_loop_666 )\n expression91 = expression\n @state.following.pop\n\n @adaptor.add_child( root_1, expression91.tree )\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_block_IN_for_loop_668 )\n block92 = block\n @state.following.pop\n\n @adaptor.add_child( root_1, block92.tree )\n\n match( UP, nil )\n @adaptor.add_child( root_0, root_1 )\n _last = _save_last_1\n\n\n\n end\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 21 )\n\n end\n \n return return_value\n end", "def while_stmt \n\t\n\t$cst.add_branch(\"WhileStatement\")\n\t\n\tmatch_token(\"T_WHILE\", $tokens[$index])\n\tboolexpr\n\tblock\n\t\n\t$cst.ascend\n\t\nend", "def modify_while\n x = 0\n puts x += 1 while x<10\nend", "def for_statement\n consume(:lparen, \"Expect '(' after 'for'.\")\n\n initializer = nil\n if match?(:semicolon)\n initializer = nil\n elsif match?(:var)\n initializer = var_declaration\n else\n initializer = expression_statement\n end\n\n condition = nil\n if !check?(:semicolon)\n condition = expression\n end\n consume(:semicolon, \"Expect ';' after loop condition.\")\n\n increment = nil\n if !check?(:rparen)\n increment = expression\n end\n consume(:rparen, \"Expect ')' after for clause.\")\n\n body = statement\n\n if !increment.nil?\n body = Ringo::Block.new([body, Ringo::Expression.new(increment)])\n end\n\n if condition.nil?\n condition = Ringo::Literal.new(true)\n end\n body = Ringo::While.new(condition, body)\n\n if !initializer.nil?\n body = Ringo::Block.new([initializer, body])\n end\n\n return body\n end", "def do_while(&blk)\n s = self.ensure_enum\n Enumerator.new do |out|\n while s.has_next?\n break unless blk.call(s.peek)\n out.yield s.next\n end\n end\n end", "def while_statement(fn)\n bgn = fn.new_label\n @loop_begin_label = bgn\n match(Token.new(:reserved, 'while'))\n match(Token.new(:symbol, '('))\n fn.code << \"#{bgn}:;\\n\"\n tf = condition_expression(fn)\n @loop_exit_label = tf[1]\n match(Token.new(:symbol, ')'))\n fn.code << \"#{tf[0]}:;\\n\"\n block_statements(fn)\n fn.code << \"goto #{bgn};\\n\"\n fn.code << \"#{tf[1]}:;\\n\"\n\n end", "def rewrite_while(expression)\n condition = expression[1]\n body = expression[2]\n \n # This was a true in the example I checked (in sexps_while.txt)\n # but I'm not sure what it's for.\n third = expression[3]\n if third != true # Should be true, not just a truthy object\n raise UnexpectedSexp, 'Expected true as the 3rd element in a while, ' +\n \"but got #{third}, this is probably a bug.\"\n end\n\n s(:call,\n s(:colon2,\n s(:const, :VirtualKeywords),\n :REWRITTEN_KEYWORDS\n ), :call_while,\n s(:array,\n s(:self),\n s(:iter, s(:fcall, :lambda), nil, condition),\n s(:iter, s(:fcall, :lambda), nil, body)\n )\n )\n end", "def while_statement\n i = 1\n result = 1\n while i <= 10\n result = result * i\n i += 1\n end\nend", "def compilewhile\n\n end", "def while(sexp, level)\n expr, stmt = sexp\n stmt_level = (level == :expression ? :statement_closure : :statement)\n\n code = \"while (#{process expr, :expression}){\"\n\n in_while { code += process(stmt, :statement) }\n code += \"}\"\n\n if stmt_level == :statement_closure\n code = \"(function() {\\n#{code}})()\"\n end\n\n code\n end", "def virtual_while(&block)\n virtualize_keyword(:while, @while_rewriter, block)\n end", "def do_while_statement\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 30 )\n return_value = DoWhileStatementReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n string_literal123 = nil\n string_literal125 = nil\n string_literal128 = nil\n block124 = nil\n clause126 = nil\n statement_end127 = nil\n clause129 = nil\n statement_end130 = nil\n\n tree_for_string_literal123 = nil\n tree_for_string_literal125 = nil\n tree_for_string_literal128 = nil\n stream_DO = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token DO\" )\n stream_WHILE = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token WHILE\" )\n stream_UNTIL = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token UNTIL\" )\n stream_statement_end = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule statement_end\" )\n stream_block = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule block\" )\n stream_clause = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule clause\" )\n begin\n # at line 442:5: 'do' block ( 'while' clause statement_end -> ^( 'while' clause block ) | 'until' clause statement_end -> ^( 'until' clause block ) )\n string_literal123 = match( DO, TOKENS_FOLLOWING_DO_IN_do_while_statement_2926 )\n if @state.backtracking == 0\n stream_DO.add( string_literal123 )\n end\n @state.following.push( TOKENS_FOLLOWING_block_IN_do_while_statement_2928 )\n block124 = block\n @state.following.pop\n if @state.backtracking == 0\n stream_block.add( block124.tree )\n end\n # at line 443:5: ( 'while' clause statement_end -> ^( 'while' clause block ) | 'until' clause statement_end -> ^( 'until' clause block ) )\n alt_26 = 2\n look_26_0 = @input.peek( 1 )\n\n if ( look_26_0 == WHILE )\n alt_26 = 1\n elsif ( look_26_0 == UNTIL )\n alt_26 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 26, 0 )\n end\n case alt_26\n when 1\n # at line 443:7: 'while' clause statement_end\n string_literal125 = match( WHILE, TOKENS_FOLLOWING_WHILE_IN_do_while_statement_2936 )\n if @state.backtracking == 0\n stream_WHILE.add( string_literal125 )\n end\n @state.following.push( TOKENS_FOLLOWING_clause_IN_do_while_statement_2938 )\n clause126 = clause\n @state.following.pop\n if @state.backtracking == 0\n stream_clause.add( clause126.tree )\n end\n @state.following.push( TOKENS_FOLLOWING_statement_end_IN_do_while_statement_2940 )\n statement_end127 = statement_end\n @state.following.pop\n if @state.backtracking == 0\n stream_statement_end.add( statement_end127.tree )\n end\n # AST Rewrite\n # elements: clause, block, WHILE\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 443:36: -> ^( 'while' clause block )\n # at line 443:39: ^( 'while' clause block )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( stream_WHILE.next_node, root_1 )\n\n @adaptor.add_child( root_1, stream_clause.next_tree )\n @adaptor.add_child( root_1, stream_block.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 # at line 444:7: 'until' clause statement_end\n string_literal128 = match( UNTIL, TOKENS_FOLLOWING_UNTIL_IN_do_while_statement_2960 )\n if @state.backtracking == 0\n stream_UNTIL.add( string_literal128 )\n end\n @state.following.push( TOKENS_FOLLOWING_clause_IN_do_while_statement_2962 )\n clause129 = clause\n @state.following.pop\n if @state.backtracking == 0\n stream_clause.add( clause129.tree )\n end\n @state.following.push( TOKENS_FOLLOWING_statement_end_IN_do_while_statement_2964 )\n statement_end130 = statement_end\n @state.following.pop\n if @state.backtracking == 0\n stream_statement_end.add( statement_end130.tree )\n end\n # AST Rewrite\n # elements: block, clause, UNTIL\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 444:36: -> ^( 'until' clause block )\n # at line 444:39: ^( 'until' clause block )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( stream_UNTIL.next_node, root_1 )\n\n @adaptor.add_child( root_1, stream_clause.next_tree )\n @adaptor.add_child( root_1, stream_block.next_tree )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end\n end\n # AST Rewrite\n # elements: DO, do_while_statement\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 446:5: -> ^( 'do' $do_while_statement)\n # at line 446:8: ^( 'do' $do_while_statement)\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( stream_DO.next_node, root_1 )\n\n @adaptor.add_child( root_1, stream_return_value.next_tree )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\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__, 30 )\n\n end\n \n return return_value\n end", "def test_while_1\n lex(\"while id < id do\nid := id + id ;\nid := id ;\nid := id + int ;\nend\n\")\n\n assert_nothing_raised(ParseError){parseWhileLoop()}\n end", "def compile_while(scope, cond, body)\n @e.loop do |br|\n var = compile_eval_arg(scope, cond)\n @e.jmp_on_false(br)\n compile_exp(scope, body)\n end\n return [:subexpr]\n end", "def compile_while(scope, cond, body)\n @e.loop do |br|\n var = compile_eval_arg(scope, cond)\n @e.jmp_on_false(br)\n compile_exp(scope, body)\n end\n return [:subexpr]\n end", "def process_while(exp)\n cond = process exp.shift\n body = process exp.shift\n body += \";\" unless body =~ /;/\n is_precondition = exp.shift\n if is_precondition then\n return \"while (#{cond}) {\\n#{body.strip}\\n}\"\n else\n return \"{\\n#{body.strip}\\n} while (#{cond})\"\n end\n end", "def using_while\nlevitation_force = 6\nwhile levitation_force < 10\n puts \"Wingardium Leviosa\"\n levitation_force += 1\nend\nend", "def while(&block)\n\t\t\t\t\trepeat &block\n\t\t\t\tend", "def while!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 23 )\n\n type = WHILE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 325:9: 'while'\n match( \"while\" )\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__, 23 )\n\n end", "def iteration_statement(var_env)\n for_statement(var_env) or while_statement(var_env) or do_while_statement(var_env)\n end", "def while!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 80 )\n\n type = WHILE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 201:9: 'while'\n match( \"while\" )\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__, 80 )\n\n end", "def while!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 46 )\n\n\n\n type = WHILE\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 224:8: 'while'\n match( \"while\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 46 )\n\n\n end", "def do_while_statement\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 19 )\n return_value = DoWhileStatementReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n\n _last = _first_0 = nil\n string_literal69 = nil\n while_statement70 = nil\n\n tree_for_string_literal69 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 107:5: ^( 'do' while_statement )\n _save_last_1 = _last = @input.look\n _first_1 = nil\n root_1 = @adaptor.create_flat_list\n _last = @input.look\n string_literal69 = match( DO, TOKENS_FOLLOWING_DO_IN_do_while_statement_549 )\n\n tree_for_string_literal69 = @adaptor.copy_node( string_literal69 )\n\n root_1 = @adaptor.become_root( tree_for_string_literal69, root_1 )\n\n\n\n match( DOWN, nil )\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_while_statement_IN_do_while_statement_551 )\n while_statement70 = while_statement\n @state.following.pop\n\n @adaptor.add_child( root_1, while_statement70.tree )\n\n match( UP, nil )\n @adaptor.add_child( root_0, root_1 )\n _last = _save_last_1\n\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 19 )\n\n end\n \n return return_value\n end", "def while_statement\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 20 )\n return_value = WhileStatementReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n\n _last = _first_0 = nil\n string_literal71 = nil\n string_literal74 = nil\n clause72 = nil\n block73 = nil\n clause75 = nil\n block76 = nil\n\n tree_for_string_literal71 = nil\n tree_for_string_literal74 = nil\n\n begin\n # at line 111:3: ( ^( 'while' clause block ) | ^( 'until' clause block ) )\n alt_20 = 2\n look_20_0 = @input.peek( 1 )\n\n if ( look_20_0 == WHILE )\n alt_20 = 1\n elsif ( look_20_0 == UNTIL )\n alt_20 = 2\n else\n raise NoViableAlternative( \"\", 20, 0 )\n end\n case alt_20\n when 1\n root_0 = @adaptor.create_flat_list\n\n\n # at line 111:5: ^( 'while' clause block )\n _save_last_1 = _last = @input.look\n _first_1 = nil\n root_1 = @adaptor.create_flat_list\n _last = @input.look\n string_literal71 = match( WHILE, TOKENS_FOLLOWING_WHILE_IN_while_statement_568 )\n\n tree_for_string_literal71 = @adaptor.copy_node( string_literal71 )\n\n root_1 = @adaptor.become_root( tree_for_string_literal71, root_1 )\n\n\n\n match( DOWN, nil )\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_clause_IN_while_statement_570 )\n clause72 = clause\n @state.following.pop\n\n @adaptor.add_child( root_1, clause72.tree )\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_block_IN_while_statement_572 )\n block73 = block\n @state.following.pop\n\n @adaptor.add_child( root_1, block73.tree )\n\n match( UP, nil )\n @adaptor.add_child( root_0, root_1 )\n _last = _save_last_1\n\n\n\n when 2\n root_0 = @adaptor.create_flat_list\n\n\n # at line 112:5: ^( 'until' clause block )\n _save_last_1 = _last = @input.look\n _first_1 = nil\n root_1 = @adaptor.create_flat_list\n _last = @input.look\n string_literal74 = match( UNTIL, TOKENS_FOLLOWING_UNTIL_IN_while_statement_582 )\n\n tree_for_string_literal74 = @adaptor.copy_node( string_literal74 )\n\n root_1 = @adaptor.become_root( tree_for_string_literal74, root_1 )\n\n\n\n match( DOWN, nil )\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_clause_IN_while_statement_584 )\n clause75 = clause\n @state.following.pop\n\n @adaptor.add_child( root_1, clause75.tree )\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_block_IN_while_statement_586 )\n block76 = block\n @state.following.pop\n\n @adaptor.add_child( root_1, block76.tree )\n\n match( UP, nil )\n @adaptor.add_child( root_0, root_1 )\n _last = _save_last_1\n\n\n\n end\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 20 )\n\n end\n \n return return_value\n end", "def my_while(cond, &body)\n while cond.call\n body.call\n end\nend", "def while_statement\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 31 )\n return_value = WhileStatementReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n string_literal131 = nil\n string_literal134 = nil\n clause132 = nil\n block133 = nil\n clause135 = nil\n block136 = nil\n\n tree_for_string_literal131 = nil\n tree_for_string_literal134 = nil\n\n begin\n # at line 450:3: ( 'while' clause block | 'until' clause block )\n alt_27 = 2\n look_27_0 = @input.peek( 1 )\n\n if ( look_27_0 == WHILE )\n alt_27 = 1\n elsif ( look_27_0 == UNTIL )\n alt_27 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 27, 0 )\n end\n case alt_27\n when 1\n root_0 = @adaptor.create_flat_list\n\n\n # at line 450:5: 'while' clause block\n string_literal131 = match( WHILE, TOKENS_FOLLOWING_WHILE_IN_while_statement_3010 )\n if @state.backtracking == 0\n\n tree_for_string_literal131 = @adaptor.create_with_payload( string_literal131 )\n root_0 = @adaptor.become_root( tree_for_string_literal131, root_0 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_clause_IN_while_statement_3013 )\n clause132 = clause\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, clause132.tree )\n end\n @state.following.push( TOKENS_FOLLOWING_block_IN_while_statement_3015 )\n block133 = block\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, block133.tree )\n end\n\n when 2\n root_0 = @adaptor.create_flat_list\n\n\n # at line 451:5: 'until' clause block\n string_literal134 = match( UNTIL, TOKENS_FOLLOWING_UNTIL_IN_while_statement_3021 )\n if @state.backtracking == 0\n\n tree_for_string_literal134 = @adaptor.create_with_payload( string_literal134 )\n root_0 = @adaptor.become_root( tree_for_string_literal134, root_0 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_clause_IN_while_statement_3024 )\n clause135 = clause\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, clause135.tree )\n end\n @state.following.push( TOKENS_FOLLOWING_block_IN_while_statement_3026 )\n block136 = block\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, block136.tree )\n end\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__, 31 )\n\n end\n \n return return_value\n end", "def rewrite_until(expression)\n condition = expression[1]\n body = expression[2]\n \n # This was a true in the example I checked (in sexps_while.txt)\n # but I'm not sure what it's for.\n third = expression[3]\n if third != true # Should be true, not just a truthy object\n raise UnexpectedSexp, 'Expected true as the 3rd element in a while, ' +\n \"but got #{third}, this is probably a bug.\"\n end\n\n s(:call,\n s(:colon2,\n s(:const, :VirtualKeywords),\n :REWRITTEN_KEYWORDS\n ), :call_until,\n s(:array,\n s(:self),\n s(:iter, s(:fcall, :lambda), nil, condition),\n s(:iter, s(:fcall, :lambda), nil, body)\n )\n )\n end", "def in_while\n return unless block_given?\n @scope.push_while\n result = yield\n @scope.pop_while\n\n result\n end", "def using_while\n\tlevitation_force = 6\n\twhile levitation_force < 10\n puts \"Wingardium Leviosa\"\n levitation_force += 1\n end\nend", "def my_custom_while_with_range_op(the_max, the_increment)\n numbers = []\n (0..the_max).step(the_increment).each do |i|\n puts \"At the top i is #{i}\"\n numbers.push(i)\n i += the_increment\n puts \"Numbers now: \", numbers\n puts \"At the bottom i is #{i}\"\n end\n return numbers\nend", "def test_while_loop\n $i = 1\n $counter = 5\n while $i < $counter do\n assert_equal ($i >= 0), true\n assert_equal ($i < $counter), true\n $i += 1\n end\n end", "def while(&blk)\n loop{ !blk[] }\n end", "def do_for\n var, start, finish, step = collect_for_parms\n\n # Mark our place in the program because we'll need to return here at the\n # top of each loop\n\n place_line = @program.cur_line\n @variables[var] = start\n\n # Top of the FOR loop\n\n loop do\n val = value_of(var)\n\n break if step < 0 && val < finish # Counting down\n break if step > 0 && val > finish # Counting up\n\n # Go round the loop until we reach our NEXT or END, or fall out of\n # the bottom of the program, which is bad m'kay.\n\n break if do_for_loop(place_line) == :END\n\n # We got NEXT, so go around again, as long as the (optional) variable\n # matches, if specified\n\n id = @lexer.next\n fail 'NEXT WITHOUT FOR ERROR' if id.type == :ident && id.value != var\n @variables[var] += step\n end\n end", "def while_statement\n #@instruction.push(@enum.peek.value)\n @while_bool = true\n @while_count+=1\n @instruction.push(\"start_while_\"+@while_count.to_s+\":;\\nif\")\n match(Token.new(:reserved, 'while'))\n @instruction.push(@enum.peek.value)\n match(Token.new(:symbol, '('))\n condition_expression\n @instruction.push(@enum.peek.value)\n match(Token.new(:symbol, ')'))\n @instruction.push(\" goto while_\"+@while_count.to_s+\";\\ngoto end_while_\"+@while_count.to_s+\";\\nwhile_\"+@while_count.to_s+\":;\\n\")\n block_statements\n if @while_bool==false\n @while_count=@while_count-1\n end\n @instruction.push(\"goto start_while_\"+@while_count.to_s+\";\\nend_while_\"+@while_count.to_s+\":0;\\n\")\n @while_bool=false\n end", "def for!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 18 )\n\n type = FOR\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 320:7: 'for'\n match( \"for\" )\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__, 18 )\n\n end", "def for!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 78 )\n\n type = FOR\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 199:7: 'for'\n match( \"for\" )\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__, 78 )\n\n end", "def yield_with_while_loop(array, &block)\n i = 0\n while i < array.length\n yield array[i]\n i += 1\n end\nend", "def while_statement\n consume(:lparen, \"Expect '(' after while.\")\n condition = expression\n consume(:rparen, \"Expect ')' after while condition.\")\n body = statement\n\n return Ringo::While.new(condition, body)\n end", "def process_for(exp)\n receiver = exp.shift\n asgn = exp.shift\n block = exp.shift\n\n new_exp = [:iter,\n [:call, receiver, :each],\n asgn,\n block]\n\n process(new_exp)\n end", "def looper\n for i in 1..10\n puts i\n end\nend", "def for_statement\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 33 )\n return_value = ForStatementReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n string_literal140 = nil\n char_literal141 = nil\n char_literal144 = nil\n char_literal147 = nil\n char_literal150 = nil\n for_statement_initialiser_part142 = nil\n blank143 = nil\n expression_list145 = nil\n blank146 = nil\n expression_list148 = nil\n blank149 = nil\n block151 = nil\n\n tree_for_string_literal140 = nil\n tree_for_char_literal141 = nil\n tree_for_char_literal144 = nil\n tree_for_char_literal147 = nil\n tree_for_char_literal150 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 465:5: 'for' '(' ( for_statement_initialiser_part | blank ) ';' ( expression_list | blank ) ';' ( expression_list | blank ) ')' block\n string_literal140 = match( FOR, TOKENS_FOLLOWING_FOR_IN_for_statement_3101 )\n if @state.backtracking == 0\n\n tree_for_string_literal140 = @adaptor.create_with_payload( string_literal140 )\n root_0 = @adaptor.become_root( tree_for_string_literal140, root_0 )\n\n end\n char_literal141 = match( LPAREN, TOKENS_FOLLOWING_LPAREN_IN_for_statement_3108 )\n # at line 467:5: ( for_statement_initialiser_part | blank )\n alt_29 = 2\n look_29_0 = @input.peek( 1 )\n\n if ( look_29_0 == GENERAL || look_29_0 == GET || look_29_0 == ARROW || look_29_0 == REGEX || look_29_0 == INCR || look_29_0 == IS_DEFINED || look_29_0 == LBRACE || look_29_0 == LBRACK || look_29_0 == SET || look_29_0 == LET || look_29_0 == DDOC || look_29_0.between?( DECR, LPAREN ) || look_29_0 == DELETE || look_29_0.between?( DGENERAL, MACRO ) || look_29_0.between?( MINUS, THIS ) || look_29_0 == TILDE || look_29_0 == TRUE || look_29_0.between?( TYPEOF, NEW ) || look_29_0.between?( EACH, UNDEFINED ) || look_29_0 == NULL || look_29_0 == FALSE || look_29_0 == VAR || look_29_0 == VOID || look_29_0.between?( FUNCTION, PLUS ) || look_29_0.between?( IS_UNDEFINED, DOC ) || look_29_0.between?( T__148, T__150 ) )\n alt_29 = 1\n elsif ( look_29_0 == SEMI )\n alt_29 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 29, 0 )\n end\n case alt_29\n when 1\n # at line 467:7: for_statement_initialiser_part\n @state.following.push( TOKENS_FOLLOWING_for_statement_initialiser_part_IN_for_statement_3117 )\n for_statement_initialiser_part142 = for_statement_initialiser_part\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, for_statement_initialiser_part142.tree )\n end\n\n when 2\n # at line 467:40: blank\n @state.following.push( TOKENS_FOLLOWING_blank_IN_for_statement_3121 )\n blank143 = blank\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, blank143.tree )\n end\n\n end\n char_literal144 = match( SEMI, TOKENS_FOLLOWING_SEMI_IN_for_statement_3125 )\n # at line 468:5: ( expression_list | blank )\n alt_30 = 2\n look_30_0 = @input.peek( 1 )\n\n if ( look_30_0 == GENERAL || look_30_0 == GET || look_30_0 == ARROW || look_30_0 == REGEX || look_30_0 == INCR || look_30_0 == IS_DEFINED || look_30_0 == LBRACE || look_30_0 == LBRACK || look_30_0 == SET || look_30_0 == DDOC || look_30_0.between?( DECR, LPAREN ) || look_30_0 == DELETE || look_30_0.between?( DGENERAL, MACRO ) || look_30_0.between?( MINUS, THIS ) || look_30_0 == TILDE || look_30_0 == TRUE || look_30_0.between?( TYPEOF, NEW ) || look_30_0.between?( EACH, UNDEFINED ) || look_30_0 == NULL || look_30_0 == FALSE || look_30_0 == VOID || look_30_0.between?( FUNCTION, PLUS ) || look_30_0.between?( IS_UNDEFINED, DOC ) || look_30_0.between?( T__148, T__150 ) )\n alt_30 = 1\n elsif ( look_30_0 == SEMI )\n alt_30 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 30, 0 )\n end\n case alt_30\n when 1\n # at line 468:7: expression_list\n @state.following.push( TOKENS_FOLLOWING_expression_list_IN_for_statement_3134 )\n expression_list145 = expression_list\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, expression_list145.tree )\n end\n\n when 2\n # at line 468:25: blank\n @state.following.push( TOKENS_FOLLOWING_blank_IN_for_statement_3138 )\n blank146 = blank\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, blank146.tree )\n end\n\n end\n char_literal147 = match( SEMI, TOKENS_FOLLOWING_SEMI_IN_for_statement_3143 )\n # at line 469:5: ( expression_list | blank )\n alt_31 = 2\n look_31_0 = @input.peek( 1 )\n\n if ( look_31_0 == GENERAL || look_31_0 == GET || look_31_0 == ARROW || look_31_0 == REGEX || look_31_0 == INCR || look_31_0 == IS_DEFINED || look_31_0 == LBRACE || look_31_0 == LBRACK || look_31_0 == SET || look_31_0 == DDOC || look_31_0.between?( DECR, LPAREN ) || look_31_0 == DELETE || look_31_0.between?( DGENERAL, MACRO ) || look_31_0.between?( MINUS, THIS ) || look_31_0 == TILDE || look_31_0 == TRUE || look_31_0.between?( TYPEOF, NEW ) || look_31_0.between?( EACH, UNDEFINED ) || look_31_0 == NULL || look_31_0 == FALSE || look_31_0 == VOID || look_31_0.between?( FUNCTION, PLUS ) || look_31_0.between?( IS_UNDEFINED, DOC ) || look_31_0.between?( T__148, T__150 ) )\n alt_31 = 1\n elsif ( look_31_0 == RPAREN )\n alt_31 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 31, 0 )\n end\n case alt_31\n when 1\n # at line 469:7: expression_list\n @state.following.push( TOKENS_FOLLOWING_expression_list_IN_for_statement_3152 )\n expression_list148 = expression_list\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, expression_list148.tree )\n end\n\n when 2\n # at line 469:25: blank\n @state.following.push( TOKENS_FOLLOWING_blank_IN_for_statement_3156 )\n blank149 = blank\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, blank149.tree )\n end\n\n end\n char_literal150 = match( RPAREN, TOKENS_FOLLOWING_RPAREN_IN_for_statement_3164 )\n @state.following.push( TOKENS_FOLLOWING_block_IN_for_statement_3171 )\n block151 = block\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, block151.tree )\n end\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__, 33 )\n\n end\n \n return return_value\n end", "def for_iterator\n\tfor item in 1..3 do\n\t puts \"The current item is #{item}.\"\n\tend\nend", "def for_loop params\n from = params[:from] #.to_f\n to = params[:to] #.to_f\n by = params[:by].abs #.to_f\n\n from.step(to, (from > to) ? -1 * by : by) do |value|\n yield value\n end\nend", "def evenLoop(n)\n i = 0\n while i < n*2 do\n return i\n i+=2\n end\nend", "def while_statement\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 12 )\n\n\n value = nil\n\n\n a = nil\n b = nil\n\n\n begin\n # at line 88:5: WHILE a= expression ( CLOSE | NL (b= statement )* CLOSE )\n match( WHILE, TOKENS_FOLLOWING_WHILE_IN_while_statement_676 )\n @state.following.push( TOKENS_FOLLOWING_expression_IN_while_statement_680 )\n a = expression\n @state.following.pop\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value = WhileStatementEval.new(a) \n # <-- action\n end\n\n # at line 89:3: ( CLOSE | NL (b= statement )* CLOSE )\n alt_26 = 2\n look_26_0 = @input.peek( 1 )\n\n if ( look_26_0 == CLOSE )\n alt_26 = 1\n elsif ( look_26_0 == NL )\n alt_26 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n\n\n raise NoViableAlternative( \"\", 26, 0 )\n\n end\n case alt_26\n when 1\n # at line 89:5: CLOSE\n match( CLOSE, TOKENS_FOLLOWING_CLOSE_IN_while_statement_688 )\n\n when 2\n # at line 89:13: NL (b= statement )* CLOSE\n match( NL, TOKENS_FOLLOWING_NL_IN_while_statement_692 )\n # at line 89:16: (b= statement )*\n while true # decision 25\n alt_25 = 2\n look_25_0 = @input.peek( 1 )\n\n if ( look_25_0.between?( IDENT, IF ) || look_25_0 == RETURN || look_25_0 == WHILE )\n alt_25 = 1\n\n end\n case alt_25\n when 1\n # at line 89:17: b= statement\n @state.following.push( TOKENS_FOLLOWING_statement_IN_while_statement_697 )\n b = statement\n @state.following.pop\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value.add_statement(b) \n # <-- action\n end\n\n\n else\n break # out of loop for decision 25\n end\n end # loop for decision 25\n\n match( CLOSE, TOKENS_FOLLOWING_CLOSE_IN_while_statement_704 )\n\n end\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 12 )\n\n\n end\n\n return value\n end", "def generateLoop2\n for i in 1...10 do #do optional\n puts i\n end\n end", "def looper\n for i in 1..10\n puts i #needs an indent\n end\n # needs to return the final result of the loop to fulfil the test.\nend", "def block_statement\n until %w(e l u).include?($lookahead)\n case $lookahead\n when \"i\"\n if_statement\n when \"w\"\n while_statement\n when \"p\"\n loop_statement\n when \"r\"\n repeat_statement\n else\n other\n end\n end\nend", "def sWhile\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 8 )\n\n begin\n # at line 46:11: WHILE LPAR ( comp )? RPAR bloq\n match( WHILE, TOKENS_FOLLOWING_WHILE_IN_sWhile_365 )\n # --> action\n agc_4()\n # <-- action\n match( LPAR, TOKENS_FOLLOWING_LPAR_IN_sWhile_369 )\n # at line 46:32: ( comp )?\n alt_10 = 2\n look_10_0 = @input.peek( 1 )\n\n if ( look_10_0 == MINUS || look_10_0 == LPAR || look_10_0.between?( ID, STRING ) )\n alt_10 = 1\n end\n case alt_10\n when 1\n # at line 46:32: comp\n @state.following.push( TOKENS_FOLLOWING_comp_IN_sWhile_371 )\n comp\n @state.following.pop\n\n end\n match( RPAR, TOKENS_FOLLOWING_RPAR_IN_sWhile_374 )\n # --> action\n agc_4('while')\n # <-- action\n @state.following.push( TOKENS_FOLLOWING_bloq_IN_sWhile_378 )\n bloq\n @state.following.pop\n # --> action\n agc_5('while')\n # <-- action\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 8 )\n\n end\n \n return \n end", "def basic_loop\n answer = 1\n iterator = 1\n\n until iterator == @exponent do\n answer *= @integer\n iterator += 1 \n end \n\n answer\n end", "def looper \r\n for i in 1..10\r\n puts i\r\n end\r\nend", "def setup_while\n return TSBS.error(@acts[0], 2, @used_sequence) if @acts.size < 3\n cond = @acts[1]\n action_key = @acts[2]\n actions = (action_key.class == String ? TSBS::AnimLoop[action_key] :\n action_key)\n if actions.nil?\n show_action_error(action_key)\n end\n begin\n while eval(cond)\n exe_act = actions.clone\n until exe_act.empty? || @break_action\n @acts = exe_act.shift\n execute_sequence\n end\n end\n rescue StandardError => err\n display_error(\"[#{SEQUENCE_WHILE},]\",err)\n end\n end", "def while_loop_function(start)\n i = start\n numbers = []\n loop_limit = 6\n increment = 1\n\n while i < loop_limit\n puts \"At the top i is #{i}\"\n numbers.push(i)\n \n i += increment\n puts \"Numbers now: \", numbers\n puts \"At the bottom i is #{i}\"\n end\n \n puts \"The numbers: \"\n\n numbers.each {|num| puts num }\nend", "def my_loop\n while true\n yield\n end\nend", "def factorial(x)\n i = 1\n result = 1\n until i > x\n result *= i\n i +=1\n end\n puts result\nend", "def execute_LOOP(operand)\n\t\tjump_conditionally_to_signed_displacement(operand, !(perform_counting_loop.zero?))\n\tend", "def repeat_hi(num)\n i = 0\n while i < num\n puts \"hi\"\n i += 1\n end\nend", "def print_nums\n i = 10\n while i >= 0\n puts i \n i -= 1\n end\nend", "def yield_with_while_loop(array, &block)\n i = 0\n while i < array.length\n block.call(array[i])\n#yield array[i]\ni+=1\nend\nend", "def looper\n i = 0\n while i < 20\n i += 1\n # break if i == 9\n # next if i.even?\n # return if i == 9\n puts i\n end\n puts \"done with the loop\"\nend", "def looping_by_multi_2( num )\n\n result = 1\n\n while( result < num )\n result *= 2\n puts( result )\n end\n\nend", "def do_until(&blk)\n s = self.ensure_enum\n Enumerator.new do |out|\n until s.empty?\n break if blk.call(s.peek)\n out.yield s.next\n end\n end\n end", "def factorial(n)\n result = 1\n i = 1\n\n until i > n\n result *= i\n i += 1\n end\n\n puts result\n\nend", "def myloop\n while true\n yield\n end\nend", "def looper\n for i in 1..10\n return i\n end\nend", "def repeat_hi(num)\n i = 0\n while i < num\n puts 'hi'\n i += 1\n end\nend", "def factorial_iter(num)\n return \"Cannot calculate factorial of 0 or a negative number\" if num <= 0\n\n result = 1\n\n until num <= 1\n result *= num\n num -= 1\n end\n\n return result\nend", "def compute_loop(index)\n start_index = index\n end_index = compute_loop_length(index)\n counter = @program_space[@data_ptr]\n if counter > 0\n while index <= end_index\n current_char = @program_data[index]\n if current_char == ']'\n index = start_index-1 if @program_space[@data_ptr] != 0\n else\n compute_program(current_char, index)\n end\n index += 1\n end\n end\n return end_index+1\nend", "def while_count(num)\n while num >=0\n puts num\n num-=1\n end\nend", "def parse_while_header\n token = expect(:KW_WHILE)\n expect(:L_PARANTH)\n expr = parse_expression\n expect(:R_PARANTH)\n\n header = WhileHeader.new(expr, @curr_parsed_loop)\n header.token = token\n header\n end", "def tokenize_loop_iterator(_chunk)\n validate_loop_iterator_parameter @stack[-1], @stack[-2]\n\n (@stack << Token.new(Token::LOOP_ITERATOR)).last\n end", "def loop_test(x)\n loop do\n x = 'hi, there'\n a = x\n break\n end\nend", "def example(str)\n i = 3\n loop do\n puts str\n i -= 1\n break if i == 0\n end\nend", "def while\n\t\t\tprogram = pop\n\t\t\tcond = pop\n\t\t\traise ArgumentError, \"WHILE: first element is not an Array.\" unless cond.is_a? Array\n\t\t\traise ArgumentError, \"WHILE: second element is not an Array.\" unless program.is_a? Array\n\t\t\tsave_stack\n\t\t\t~cond\n\t\t\tres = pop\n\t\t\trestore_stack\n\t\t\tif res then \n\t\t\t\t~program\n\t\t\t\t[cond, program].each {|e| push e }\n\t\t\t\tself.while\n\t\t\tend\n\t\tend", "def setup_while\n return unless PONY::ERRNO::check_sequence(current_act)\n cond = @acts[1]\n action_key = @acts[2]\n actions = (action_key.class == String ? TSBS::AnimLoop[action_key] : action_key)\n if actions.nil?\n show_action_error(action_key)\n end\n begin\n while eval(cond)\n exe_act = actions.clone\n until exe_act.empty? || @break_sequence\n @acts = exe_act.shift\n execute_sequence\n end\n end\n rescue StandardError => err\n display_error(\"[#{SEQUENCE_WHILE},]\",err)\n end\n end", "def endless_loop\n loop { yield }\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 factorial_iter(n)\n factorial = 1\n until n == 0\n factorial *= n\n n -= 1\n end\n\n return factorial\nend", "def printNums\r\n i = 1\r\n while i <= 5\r\n puts i\r\n\r\n i -= 1\r\n end\r\nend", "def loop_forever; end", "def check_loop_usage_condition(stream, node)\n if node.is_a?(Twig::Node::Expression::GetAttr) && node.get_node('node').is_a?(Twig::Node::Expression::Name) && 'loop' == node.get_node('node').get_attribute('name')\n raise Twig::Error::Syntax.new('The \"loop\" variable cannot be used in a looping condition.', node.lineno, stream.filename)\n end\n node.each do |n|\n if n\n check_loop_usage_condition(stream, n)\n end\n end\n end", "def factorial(input)\n i = input\n output = input\n while i > 1\n input = input - 1\n output = output * input\n i += -1\n end\n return output\nend", "def for(operation); end", "def test_0800_take_while\n @@log.debug \"test_0800_take_while starts\" if @@log.debug?\n assert_respond_to(@list, :take_while, \"test_0800_take_while_respond\")\n # Type check\n enum = @list.take_while\n result = enum.is_a? Enumerator\n assert(result,\"test_0800_take_while_class\") \n # Take while true\n result = @list.take_while {|obj|\n obj == @cab ? false : true\n }\n assert_equal(result, [@aen, @bsb], \"test_0800_take_while_first2\")\n #\n @@log.debug \"test_0800_take_while ends\" if @@log.debug?\n end", "def take_while list, &block\n # your solution here\n list.take_while &block\n \nend", "def test_next_statement\n i = 0\n result = []\n while i < 10\n i += 1\n next if (i % 2) == 0\n result << i\n end\n assert_equal (1..10).step(2).to_a, result\n end", "def example4\n val = 1\n while val < 10\n if val == 5\n puts \"valが5になった\"\n end\n p val \n val += 1\n end\nend", "def method_return_from_loop\n (1..10).each do |n|\n if n == 5\n return 5 * 5\n end\n end\n nil\n end", "def until!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 70 )\n\n type = UNTIL\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 191:9: 'until'\n match( \"until\" )\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__, 70 )\n\n end", "def repeater(n, str)\n i = 0\n while i < n\n puts str\n i += 1\n end\nend", "def evenLoop(n)\n total = n * 2\n for x in 1..total\n if x % 2 == 0\n x\n end\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 while_block\n @while_block || nil\n end", "def loop; end", "def factorial(num)\n \n i = 1 # 1. set a start njumber \n while i <= num # 2. set a stop number\n puts i \n i += 1 # 3. increment for iteration\n end\nend", "def factorial(number)\ni = 1\noutput = 1\n\n while i < number + 1\n output = output * i\n i += 1\n end\n return output\nend", "def get_loop_even(num)\n (0..num).each { |x| x if (x%2==0)}\nend", "def takeWhile(&blk)\n Rubylude.new ->() {\n while value = @generator.resume\n return unless blk.call(value)\n Fiber.yield value\n end\n }\n end", "def repeatHello(n)\n i = 0\n while i < n\n puts 'hello'\n i += 1\n end\nend", "def sumto(num)\n i = 0\n output = 0\n while i < num + 1\n output += i\n i += 1\n end\n return output\nend" ]
[ "0.65082234", "0.6499518", "0.6420092", "0.64042795", "0.635707", "0.6321666", "0.6283487", "0.625449", "0.6238574", "0.6174425", "0.607747", "0.60531", "0.60411763", "0.60126317", "0.60126317", "0.5955936", "0.59337515", "0.5925265", "0.59237796", "0.5912331", "0.59095484", "0.58848417", "0.5856163", "0.58536524", "0.58421123", "0.57943773", "0.57941395", "0.5778072", "0.57543683", "0.57538646", "0.57135296", "0.5708544", "0.565316", "0.5644341", "0.56322736", "0.5619346", "0.558054", "0.5557414", "0.5545968", "0.5516674", "0.5482543", "0.5477466", "0.5469895", "0.54668343", "0.54656696", "0.54636914", "0.54440546", "0.5431601", "0.5423729", "0.5399116", "0.53715193", "0.5357958", "0.53471047", "0.5345925", "0.53455", "0.53279483", "0.5323842", "0.5320666", "0.5317748", "0.5294964", "0.5276369", "0.5271513", "0.52672344", "0.5262565", "0.5247797", "0.5241476", "0.5241144", "0.52411276", "0.5218116", "0.5204554", "0.519312", "0.5192961", "0.5190026", "0.518297", "0.51787674", "0.5174492", "0.51546735", "0.5150486", "0.5145534", "0.51409334", "0.5137444", "0.51296675", "0.51295877", "0.5120536", "0.51186794", "0.51183057", "0.51068586", "0.5100337", "0.509445", "0.50799775", "0.50776553", "0.507648", "0.507615", "0.5075987", "0.50729316", "0.50629866", "0.5053115", "0.5052583", "0.50481886", "0.50451016" ]
0.8376138
0
Transforms `(++ )` to `(set (+ 1))`
def transform_inc_to_set(inc_expr) _tag, expr = inc_expr ['set', expr, ['+', expr, 1]] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transform_inc_val_to_set(inc_expr)\n _tag, expr, val = inc_expr\n ['set', expr, ['+', expr, val]]\n end", "def plus(reg)\n return lambda do |pos|\n statelist = reg.call(pos)\n curpos = pos + statelist.size\n endstate = { '' => Set.new( [pos, curpos + 1] ) }\n statelist << endstate\n return statelist\n end\nend", "def incr(x) x + 1 end", "def incr\n add(1)\n end", "def succ\n self + ONE\n end", "def succ\n return self + 1\n end", "def increment!\n @value += @increment\n \n self\n end", "def add(number)\n if @set[number]\n @set[number] = @set[number]+1\n else\n @set[number] = 1\n end\n end", "def increment(node)\n change_by node, 1\n end", "def add_to_set(set, word)\n\tif !(set.key?(word))\n\t\tset.merge!(word => 1)\n\telse\n\t\tset[word] += 1\n\tend\nend", "def succ\n d = self.dup\n d.succ!\n # d.taint if self.tainted?\n d\n end", "def _inc(key,value)\n _set(key, (_get(key) || 0) + value)\n end", "def count_with_increment(start, inc)\n lambda do\n tmp = start\n start += inc\n tmp\n end\nend", "def increment\n @value += 1\n end", "def INC\n operand = unwrap_integer evaluation_stack.pop\n evaluation_stack.push operand + 1\n end", "def succ(v)\n @forw[v] || Set.new\n end", "def increment(start, inc)\n\t\t\t\tProc.new{start +=inc}\nend", "def opt(reg)\n return lambda do |pos|\n startstate = { '' => Set.new( [pos + 1] ) }\n\n statelist = [startstate]\n curpos = pos + statelist.size\n\n statelist += reg.call(curpos)\n curpos = pos + statelist.size\n\n startstate[''] << curpos\n\n return statelist\n end\nend", "def succ\n if @combo == nil or @combo == @set[-@num_elements..-1]\n return nil if (@num_elements +=1) > @set.length\n @combo = @set[0,@num_elements]\n else\n index = (1..@num_elements).find {|i| @combo[-i] < @set[-i]}\n @combo[-index, index] = @set[@map[@combo[-index]], index]\n end\n @combo\n end", "def increment\n curr_value = counter\n self.counter = curr_value + 1\n save\n curr_value\n end", "def __to_inc__\n self\n end", "def transform_dec_to_set(dec_expr)\n _tag, expr = dec_expr\n ['set', expr, ['-', expr, 1]]\n end", "def incr!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 17 )\n\n type = INCR\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 138:8: '++'\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__, 17 )\n\n end", "def zincrby(key, increment, member); end", "def zincrby(key, increment, member); end", "def inc(key)\n \n end", "def increment(a)\n a = a + 1\nend", "def succ() end", "def succ() end", "def succ() end", "def increment\n @counter = @counter + 1\n end", "def succ!() end", "def increment_order!\n @current += 1\n end", "def incr(key); end", "def incr(key); end", "def increment_nums!()\n i = 0\n self.each do |element|\n if element.class() == Fixnum\n self[i] = self[i] + 1\n i += 1\n else\n i += 1\n end\n end\n end", "def increment_counter(counter)\n\tcounter += 1\n\treturn counter\nend", "def plus_one(digits)\n digits[-1] += 1 \n digits \nend", "def incrby(key, increment); end", "def incrby(key, increment); end", "def mutate(num)\n num += 1\n end", "def incr(key, timestamp, set_name)\n redis.zadd(set_name, timestamp, key)\n redis.incr(key).to_i\n end", "def each_plus_one(array)\n array.map { |number|\n number += 1\n }\nend", "def ^(enum)\n if enum.is_a?(Set)\n enum = try_integer_set(enum)\n return enum.is_a?(IntegerSet) ? self.class.from_i(@val ^ enum.to_i) : enum ^ self\n end\n n = IntegerSet.new(enum)\n each { |o| if n.include?(o) then n.delete(o) else n.add(o) end }\n n\n end", "def increment_id!\n self.id = (self.id + 1) % 0x10000\n end", "def increment_count(current_count)\n current_count.to_i + 1\n end", "def plus_one(array)\n array[-1] += 1\n \n index = -1\n \n while array[index] == 10\n if array[index-1]\n array[index-1] += 1 \n else\n array.unshift(1)\n end\n array[index] = 0\n index -= 1\n end\n \n array\nend", "def +(num)\n old_plus(old_plus(num))\n end", "def unshift(value)\n end", "def incr_count\n @count ||= 0\n @count += 1\n end", "def increment *args\n accumulators.incr(scope(*args))\n end", "def increment\n Dictionary.db.zincrby @key, 1, @value\n end", "def next_number(num)\n return num += 1\nend", "def succ\n s = dup\n s.season = next_season_code\n s.year = year + 1 if s.first?\n s\n end", "def transform_dec_val_to_set(dec_expr)\n _tag, expr, val = dec_expr\n ['set', expr, ['-', expr, val]]\n end", "def inc(v = 1)\n sync { @v += v }\n end", "def succ!(n = 1)\n if (n < 0)\n dec!(- n)\n else\n for i in (1 .. n)\n\tif @d == m_days\n\t @d = 1\n\t m_succ!(1)\n\telse\n\t @d += 1\n\tend\n end\n end\n return self\n end", "def succ\n self.class.new(@total + 1)\n end", "def next!\n id = @counter.next!\n id = @counter.next! while @map[id]\n register id\n end", "def succ\n end", "def zincrby(key, increment, member)\n node_for(key).zincrby(key, increment, member)\n end", "def inc\n $i + 1\n end", "def increment_counter\n unless self.count.nil?\n self.count += 1\n else\n self.count = 1\n end\n end", "def increment(key)\n @counter[key] += 1\n end", "def increment \n\t\t@counter = @counter + 1\n\tend", "def succ\n @nxt || self\n end", "def incr major, minor\n incr_by major, minor, 1\n end", "def next_mark\n @mark ||= 0\n @mark += 1\n \":#{@mark}\"\nend", "def increment_value str\n str.concat str.next.slice(-1)\nend", "def next_number(number)\n return number += 1\nend", "def succ\n Timecode.new(@tc_mode, nil, @tc_count+1)\n end", "def succ\n PowerOfTwo.new( @value + @value )\n end", "def E\n @x += 1\n end", "def setCount count\n count += 1\n puts \"the total number of sets found : #{count}\"\n count\nend", "def inc(cb)\n c = 0\n additive = 0\n left_32 = cb.slice(12..15)\n while c<=4\n additive += left_32(c)\n c+=1\n end\n additive %= 4\n cb = cb.setbyte(15,additive)\nend", "def increment\n self.class.increment(self)\n end", "def increment_operator\n incremented = false\n i = 0\n while (incremented == false && i<(@operator_value.size) && @operator_increment_completed==false)\n if @operator_value[i] < (@operators.size-1)\n @operator_value[i] += 1\n incremented = true\n else\n @operator_value[i] = 0\n i+=1\n end\n end\n incremented\n end", "def incrby(key, increment)\n node_for(key).incrby(key, increment)\n end", "def add_up(num)\n return (1..num).inject(:+)\nend", "def increment(v = 1)\n if @value.kind_of?(String)\n @value = (to_f_or_i(@value) + v).to_s if to_f_or_i(@value)\n else\n @value += v\n end\n end", "def increment_counter(counter_name, id)\n update_all \"#{counter_name} = #{counter_name} + 1\", \"#{primary_key} = #{id}\"\n end", "def aset(index, value)\n end", "def incr(key)\n node_for(key).incr(key)\n end", "def succ(source); end", "def next_id\n (@curr_id +=1).to_s\n end", "def incr_x(val = 1)\n update(y, x + val)\n apply_pos\n end", "def forward\n recursive_set(*@out) { |n| n.out }\n end", "def hincrby(key, field, increment); end", "def hincrby(key, field, increment); end", "def change_set_fn\n -> f, g, prev, this {\n f.(Set.new(this) - Set.new(prev))\n g.(Set.new(prev) - Set.new(this))\n }.curry\n end", "def increment!\n\t\t\t\t@vertices += 1\n\t\t\t\t@count += 1\n\t\t\tend", "def SimpleAdding(num\n total = 1.upto(num).reduce(&:+)\n total \nend", "def increase(attr)\n raise NoMethodError, \"undefined method `#{attr}` for #{self}\" unless self.respond_to?(attr)\n raise NotCounterbleError, \"not countable attributs `#{attr}` for #{self}\" unless countable.include? attr\n self.send(\"#{attr}=\", self.send(attr).send(:+, 1))\n end", "def make_id\n new_id = @id\n @id += 1\n new_id\n end", "def alt(*list)\n return lambda do |pos|\n startstate = { '' => Set.new }\n statelist = [startstate]\n endstate = { '' => Set.new }\n curpos = pos + statelist.size\n list.each do |item|\n startstate[''] << curpos\n statelist += item.call(curpos)\n statelist << endstate\n curpos = pos + statelist.size\n end\n endstate[''] << curpos\n return statelist\n end\nend", "def &(enum)\n if enum.instance_of?(IntegerSet)\n n = self.class.from_i(@val & enum.to_i)\n else\n n = self.class.new\n do_with_enum(enum) { |o| n.add(o) if include?(o) }\n end\n n\n end", "def succ_s\n a_s(@succ)\n end", "def plus_one(number)\n number + 1\nend", "def set_literal\n <<-CODE\n next_int;\n tuple_put(state, cpu_current_literals(state, c), _int, stack_top());\n CODE\n end", "def increment_and_save!\n update_and_save { self.last_value = (last_value || 0) + 1 }\n end" ]
[ "0.6812443", "0.6358723", "0.6274109", "0.60673857", "0.60572845", "0.6006127", "0.5761416", "0.57488865", "0.5741002", "0.5737076", "0.5698682", "0.5697059", "0.56441516", "0.56254303", "0.5602991", "0.55986685", "0.55882615", "0.55832213", "0.55612993", "0.5522802", "0.5507481", "0.5506215", "0.54580015", "0.54351497", "0.54351497", "0.5432963", "0.5429963", "0.5413379", "0.5413379", "0.5413379", "0.5391838", "0.5384107", "0.5383177", "0.53521", "0.53521", "0.53385293", "0.5332754", "0.53079563", "0.53069085", "0.53069085", "0.53002614", "0.5290388", "0.52050364", "0.5198909", "0.5195664", "0.5175022", "0.51556736", "0.5152119", "0.51517123", "0.5139958", "0.51376235", "0.51370233", "0.51344097", "0.51121426", "0.51121306", "0.5099997", "0.5086518", "0.50768894", "0.5076474", "0.50733876", "0.50588775", "0.50549424", "0.5047481", "0.5047172", "0.50363636", "0.50297064", "0.5025471", "0.5000024", "0.4997623", "0.49963242", "0.49906975", "0.49895236", "0.49799484", "0.4976805", "0.49673894", "0.49633023", "0.4960881", "0.4951455", "0.49332654", "0.49202898", "0.49181405", "0.49129045", "0.48985848", "0.48973012", "0.48922962", "0.48867083", "0.4885985", "0.4874295", "0.4874295", "0.48712763", "0.48703828", "0.48664975", "0.48586836", "0.48541808", "0.48525807", "0.48349363", "0.48325822", "0.4830024", "0.48286673", "0.4822903" ]
0.7238825
0
Transforms `( )` to `(set ( 1))`
def transform_dec_to_set(dec_expr) _tag, expr = dec_expr ['set', expr, ['-', expr, 1]] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set=(_arg0); end", "def k_set!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 63 )\n\n\n\n type = K_SET\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 505:3: 'set'\n match( \"set\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 63 )\n\n\n end", "def set!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 37 )\n\n type = SET\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 158:7: 'set'\n match( \"set\" )\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__, 37 )\n\n end", "def transform_inc_to_set(inc_expr)\n _tag, expr = inc_expr\n ['set', expr, ['+', expr, 1]]\n end", "def transform_inc_val_to_set(inc_expr)\n _tag, expr, val = inc_expr\n ['set', expr, ['+', expr, val]]\n end", "def mset(*_arg0); end", "def set; end", "def set; end", "def const_set(p0, p1) end", "def transform_dec_val_to_set(dec_expr)\n _tag, expr, val = dec_expr\n ['set', expr, ['-', expr, val]]\n end", "def plus(reg)\n return lambda do |pos|\n statelist = reg.call(pos)\n curpos = pos + statelist.size\n endstate = { '' => Set.new( [pos, curpos + 1] ) }\n statelist << endstate\n return statelist\n end\nend", "def aset(index, value)\n end", "def let_simple_set(arr, variables)\n variables.set_var(arr[1], arr[2])\n arr[2].to_i\n end", "def set( s )\n @pipe[-1].clear << s\n end", "def set(values); end", "def mset(*args); end", "def add_to_set(set, word)\n\tif !(set.key?(word))\n\t\tset.merge!(word => 1)\n\telse\n\t\tset[word] += 1\n\tend\nend", "def set\n\t$one = \"1\"\n\t$two = \"2\"\n\t$three = \"3\"\n\t$four = \"4\"\n\t$five = \"5\"\n\t$six = \"6\"\n\t$seven = \"7\"\n\t$eight = \"8\"\n\t$nine = \"9\"\n\t$turn = 0\t\t\nend", "def watch_for_set=(_arg0); end", "def set!(*args)\n end", "def convert(y)\n y.chars.to_a.to_set\nend", "def test_set_eval\n set = SetVariableEval.new(@int_var, @int_lit)\n set.eval\n assert_equal \"SET [Y+9], 10\\n\", MPPCompiler.last\n end", "def c1= c; @c1 = (c == 1) ? 1 : 0; end", "def opt(reg)\n return lambda do |pos|\n startstate = { '' => Set.new( [pos + 1] ) }\n\n statelist = [startstate]\n curpos = pos + statelist.size\n\n statelist += reg.call(curpos)\n curpos = pos + statelist.size\n\n startstate[''] << curpos\n\n return statelist\n end\nend", "def set_literal\n <<-CODE\n next_int;\n tuple_put(state, cpu_current_literals(state, c), _int, stack_top());\n CODE\n end", "def set!(args)\n collection_modifier_update('$set', args)\n end", "def to_expanded_set\r\n (target.map { |x| x.to_i } << to_i).to_set # include the group value as well\r\n end", "def call(value)\n coerced = value.map { |item| super(item) }\n\n @set ? Set.new(coerced) : coerced\n end", "def change_set_fn\n -> f, g, prev, this {\n f.(Set.new(this) - Set.new(prev))\n g.(Set.new(prev) - Set.new(this))\n }.curry\n end", "def set(index, val)\n \n end", "def munge(value)\n value\n end", "def parse_set\n @current_set = Set.new\n @current_match.add_set @current_set\n end", "def __set()\n caller.each do |c|\n source = c[/^([^:]+):/,1]\n set = @@__sets[source]\n return set if set\n end\n\n :original\n end", "def ^(enum)\n if enum.is_a?(Set)\n enum = try_integer_set(enum)\n return enum.is_a?(IntegerSet) ? self.class.from_i(@val ^ enum.to_i) : enum ^ self\n end\n n = IntegerSet.new(enum)\n each { |o| if n.include?(o) then n.delete(o) else n.add(o) end }\n n\n end", "def x=(_); end", "def x=(_); end", "def []=(*) end", "def to_set\n require 'set' unless defined?(::Set)\n each.to_set\n end", "def new_set\r\n @sets[@current_set_name] = @current_set\r\n @current_set = []\r\n end", "def set\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 49 )\n set_start_index = @input.index\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return \n end\n # at line 336:6: ( 'S' | 's' ) ( 'E' | 'e' ) ( 'T' | 't' )\n if @input.peek( 1 ).between?( T__38, T__39 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__28, T__29 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__16, T__17 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 49 )\n memoize( __method__, set_start_index, success ) if @state.backtracking > 0\n\n end\n \n return \n end", "def process_set(match, function, type_table)\n name = match[1]\n array_index = match[3]\n value = match[4]\n\n # Error checking:\n unless function.is_a? Function\n raise \"Can only set variables inside functions\"\n end\n\n var_list = function.var_list\n unless var_list.include?(name)\n raise \"Undeclared variable '#{name}'\"\n end\n\n var = function.var_list.get(name)\n if array_index != nil and (not var.is_array?)\n raise \"Cannot use array index on non-array variable\"\n end\n\n # Parse value and create instruction\n ident_list = function.ident_list\n value_expression = process_expression(value, ident_list, type_table)\n\n var_type = var.type\n if array_index\n var_type = var.type.element_type\n end\n\n unless value_expression.type.castable?(var_type)\n raise \"Cannot convert expression type #{value_expression.type.to_s} \" +\n \"to variable type #{var_type.to_s}\"\n end\n\n instruction = SetVariableInstruction.new(var, value_expression, function)\n\n # The variable is being used as an array, add array index to instruction\n if array_index\n index_expression = process_expression(array_index, ident_list,\n type_table)\n instruction.array_index = index_expression\n\n unless index_expression.type.castable?(WORD_TYPE)\n raise \"Cannot convert array index #{index_expression.type.to_s} \" +\n \"to word type\"\n end\n end\n\n function.add_instruction(instruction)\n return true\nend", "def assignment_op\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 47 )\n return_value = AssignmentOpReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n set224 = nil\n\n tree_for_set224 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line \n set224 = @input.look\n if @input.peek(1) == AMP_ASGN || @input.peek(1) == HAT_ASGN || @input.peek(1) == ASGN || @input.peek(1) == RSHIFT3_ASGN || @input.peek(1) == RSHIFT_ASGN || @input.peek(1) == SLASH_ASGN || @input.peek( 1 ).between?( LSHIFT_ASGN, STAR_ASGN ) || @input.peek(1) == MINUS_ASGN || @input.peek(1) == MOD_ASGN || @input.peek(1) == OR_ASGN || @input.peek(1) == PIPE_ASGN || @input.peek(1) == PLUS_ASGN\n @input.consume\n if @state.backtracking == 0\n @adaptor.add_child( root_0, @adaptor.create_with_payload( set224 ) )\n end\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\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__, 47 )\n\n end\n \n return return_value\n end", "def alt(*list)\n return lambda do |pos|\n startstate = { '' => Set.new }\n statelist = [startstate]\n endstate = { '' => Set.new }\n curpos = pos + statelist.size\n list.each do |item|\n startstate[''] << curpos\n statelist += item.call(curpos)\n statelist << endstate\n curpos = pos + statelist.size\n end\n endstate[''] << curpos\n return statelist\n end\nend", "def set_counts(set,count)\t\n\n\tnewcount = (set=='new')? count : \"0\"\n\trisingcount = (set=='rising')? count : \"0\"\n\thotcount = (set=='hot')? count : \"0\"\n\n\treturn newcount, risingcount, hotcount\n\nend", "def MakeSet(dset, x)\n unless dset[x] \n # add x to the disjoint-set tree\n dset[x] = {parent: x, size:1}\n end\nend", "def set(tuple)\n build(tuple) if @tuple.nil?\n @tuple = tuple\n self\n end", "def set(bit, value = true)\n if value\n @bits = union convert_bit(bit)\n @set_indexes << bit unless @set_indexes.include?(bit)\n elsif set?(bit)\n @bits = xor convert_bit(bit)\n @set_indexes.delete(bit)\n end\n\n @bits\n end", "def set\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 53 )\n\n\n return_value = SetReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n\n root_0 = nil\n\n __K_SET284__ = nil\n __LLAIZQ285__ = nil\n __K_VALUE286__ = nil\n __LLADER287__ = nil\n\n\n tree_for_K_SET284 = nil\n tree_for_LLAIZQ285 = nil\n tree_for_K_VALUE286 = nil\n tree_for_LLADER287 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 243:3: K_SET LLAIZQ K_VALUE LLADER\n __K_SET284__ = match( K_SET, TOKENS_FOLLOWING_K_SET_IN_set_1202 )\n if @state.backtracking == 0\n tree_for_K_SET284 = @adaptor.create_with_payload( __K_SET284__ )\n @adaptor.add_child( root_0, tree_for_K_SET284 )\n\n end\n\n __LLAIZQ285__ = match( LLAIZQ, TOKENS_FOLLOWING_LLAIZQ_IN_set_1204 )\n if @state.backtracking == 0\n tree_for_LLAIZQ285 = @adaptor.create_with_payload( __LLAIZQ285__ )\n @adaptor.add_child( root_0, tree_for_LLAIZQ285 )\n\n end\n\n __K_VALUE286__ = match( K_VALUE, TOKENS_FOLLOWING_K_VALUE_IN_set_1206 )\n if @state.backtracking == 0\n tree_for_K_VALUE286 = @adaptor.create_with_payload( __K_VALUE286__ )\n @adaptor.add_child( root_0, tree_for_K_VALUE286 )\n\n end\n\n __LLADER287__ = match( LLADER, TOKENS_FOLLOWING_LLADER_IN_set_1208 )\n if @state.backtracking == 0\n tree_for_LLADER287 = @adaptor.create_with_payload( __LLADER287__ )\n @adaptor.add_child( root_0, tree_for_LLADER287 )\n\n end\n\n\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n if @state.backtracking == 0\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\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\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 53 )\n\n\n end\n\n return return_value\n end", "def msetnx(*_arg0); end", "def set(enumerable); end", "def const_set(arg0, arg1)\n end", "def set(*args)\n run \"set #{OptArg.parse(*args)}\"\n nil\n end", "def bits_set\n (\"%b\" % self).count('1')\n #to_s(2).count('1') # alternative\n #count = 0 # alternative\n #byte = self.abs\n #count += byte & 1 and byte >>= 1 until byte == 0 # cf. http://snippets.dzone.com/posts/show/4233\n #count\n end", "def to_set(klass = IntegerSet, *args, &block)\n return self if instance_of?(IntegerSet) && klass == IntegerSet && block.nil? && args.empty?\n klass.new(self, *args, &block)\n end", "def set(sets)\n view.update_many(\"$set\" => collect_operations(sets))\n end", "def left=(_arg0); end", "def left=(_arg0); end", "def set(*args)\n # not supported\n end", "def set(*args)\n # not supported\n end", "def operator=(_arg0); end", "def to_set(klass = Set, *args, &block)\n return self if instance_of?(Set) && klass == Set && block.nil? && args.empty?\n klass.new(self, *args, &block)\n end", "def x=(val); self[0] = val; end", "def y=(_); end", "def y=(_); end", "def set\n @items.each do |d|\n eval d.rubify\n end\n end", "def set(value)\n mutate build_map(value)\n end", "def parse_set_mem\n if @row.gsub!(/([ \\t]*~\\^)([^\\n]+\\n)/,'')\n set_mem = $2 \n if !global_set_mem(set_mem)\n p \"setMem ^ => #{set_mem}\" if @dbg[:parse]\n @mem_tag[\"^\"]= set_mem\n end \n end\n end", "def sets\n end", "def c2= c; @c2 = (c == 1) ? 1 : 0; end", "def set(value)\n execute_only(:set, value)\n end", "def set_lexer_state( state )\n unless @lexer_state.number == state.number\n unless @lookahead.empty?\n rewind( @lookahead[0] )\n @lookahead.clear\n end\n \n @lexer_state = state\n end\n end", "def test_set_unmatched_type\n set = SetVariableEval.new(@bool_var, @int_lit)\n assert_raise TypeError do\n set.eval\n end\n end", "def first= value\n self[0] = value\n end", "def value=(_); end", "def fill_square(n, set, idx)\n set[idx] = n\n end", "def getset(key); end", "def test_set_values\n ogg = dummy()\n\n assert !ogg.has_tag?(\"A\")\n\n ogg.set_values(\"A\", \"B\")\n assert_equal Set[\"B\"], ogg['A']\n\n ogg.set_values(\"A\", \"C\", \"D\")\n assert_equal Set[\"C\", \"D\"], ogg['A']\n\n # This will remove the tag\n ogg.set_values(\"A\", *[])\n assert !ogg.has_tag?(\"A\")\n end", "def nested_to_set(obj)\n if obj.is_a? Array\n obj.map{ |v| nested_to_set(v) }.to_set\n elsif obj.is_a? Hash\n obj.inject({}) do |h,(k,v)|\n h.merge!(k => nested_to_set(v))\n end\n else\n obj\n end\n end", "def set(&block)\n @set = block\n end", "def set(&block)\n @set = block\n end", "def c0= c; @c0 = (c == 1) ? 1 : 0; end", "def push_reset\n @stack << Set.new\n end", "def set_only(value)\n shift_out_with_index { |bit, i| bit.set_only = (value[i] == 0b1) }\n self\n end", "def set_clear_item(set)\r\n if set != @o.isSet?\r\n @o.fire_event(\"onclick\") \r\n @container.wait\r\n end\r\n end", "def call(value)\n coerced = value.map do |item|\n coerced_item = super(item)\n\n return coerced_item if coerced_item.is_a?(InvalidValue)\n\n coerced_item\n end\n\n @set ? Set.new(coerced) : coerced\n end", "def unaltered(value)\n value\n end", "def unaltered(value)\n value\n end", "def set_one(row,col)\n\t\tpixels[row][col] = 1\n\tend", "def mset(*args)\n send_command([:mset] + args)\n end", "def to_set\n a = Set.new\n @index.each_value do |s|\n s.each do |t|\n a << t\n end\n end\n a\n end", "def yale_row_as_set i\n require 'set'\n yale_row_as_array(i).to_set\n end", "def not_set\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 23 )\n return_value = NotSetReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n char_literal112 = nil\n not_terminal113 = nil\n element_options114 = nil\n block115 = nil\n element_options116 = nil\n\n tree_for_char_literal112 = nil\n stream_T__87 = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token T__87\" )\n stream_not_terminal = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule not_terminal\" )\n stream_block = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule block\" )\n stream_element_options = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule element_options\" )\n begin\n # at line 261:4: '~' ( not_terminal ( element_options )? -> ^( '~' not_terminal ( element_options )? ) | block ( element_options )? -> ^( '~' block ( element_options )? ) )\n char_literal112 = match( T__87, TOKENS_FOLLOWING_T__87_IN_not_set_1864 )\n if @state.backtracking == 0\n stream_T__87.add( char_literal112 )\n end\n # at line 262:3: ( not_terminal ( element_options )? -> ^( '~' not_terminal ( element_options )? ) | block ( element_options )? -> ^( '~' block ( element_options )? ) )\n alt_57 = 2\n look_57_0 = @input.peek( 1 )\n\n if ( look_57_0.between?( TOKEN_REF, CHAR_LITERAL ) )\n alt_57 = 1\n elsif ( look_57_0 == T__81 )\n alt_57 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 57, 0 )\n end\n case alt_57\n when 1\n # at line 262:5: not_terminal ( element_options )?\n @state.following.push( TOKENS_FOLLOWING_not_terminal_IN_not_set_1870 )\n not_terminal113 = not_terminal\n @state.following.pop\n if @state.backtracking == 0\n stream_not_terminal.add( not_terminal113.tree )\n end\n # at line 262:18: ( element_options )?\n alt_55 = 2\n look_55_0 = @input.peek( 1 )\n\n if ( look_55_0 == T__88 )\n alt_55 = 1\n end\n case alt_55\n when 1\n # at line 262:18: element_options\n @state.following.push( TOKENS_FOLLOWING_element_options_IN_not_set_1872 )\n element_options114 = element_options\n @state.following.pop\n if @state.backtracking == 0\n stream_element_options.add( element_options114.tree )\n end\n\n end\n # AST Rewrite\n # elements: T__87, element_options, not_terminal\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 262:35: -> ^( '~' not_terminal ( element_options )? )\n # at line 262:38: ^( '~' not_terminal ( element_options )? )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( stream_T__87.next_node, root_1 )\n\n @adaptor.add_child( root_1, stream_not_terminal.next_tree )\n # at line 262:57: ( element_options )?\n if stream_element_options.has_next?\n @adaptor.add_child( root_1, stream_element_options.next_tree )\n\n end\n\n stream_element_options.reset();\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 # at line 263:5: block ( element_options )?\n @state.following.push( TOKENS_FOLLOWING_block_IN_not_set_1890 )\n block115 = block\n @state.following.pop\n if @state.backtracking == 0\n stream_block.add( block115.tree )\n end\n # at line 263:11: ( element_options )?\n alt_56 = 2\n look_56_0 = @input.peek( 1 )\n\n if ( look_56_0 == T__88 )\n alt_56 = 1\n end\n case alt_56\n when 1\n # at line 263:11: element_options\n @state.following.push( TOKENS_FOLLOWING_element_options_IN_not_set_1892 )\n element_options116 = element_options\n @state.following.pop\n if @state.backtracking == 0\n stream_element_options.add( element_options116.tree )\n end\n\n end\n # AST Rewrite\n # elements: T__87, element_options, block\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 263:29: -> ^( '~' block ( element_options )? )\n # at line 263:32: ^( '~' block ( element_options )? )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( stream_T__87.next_node, root_1 )\n\n @adaptor.add_child( root_1, stream_block.next_tree )\n # at line 263:44: ( element_options )?\n if stream_element_options.has_next?\n @adaptor.add_child( root_1, stream_element_options.next_tree )\n\n end\n\n stream_element_options.reset();\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end\n end\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__, 23 )\n\n end\n \n return return_value\n end", "def set(x,y)\n @board[x][y] = 1\n return self\n end", "def value=(n)\n Gate.activate\n self.set(n)\n Gate.deactivate\n end", "def |(enum)\n new_set = TreeSet.new\n [self, enum].each do |enumerable|\n enumerable.each do |val|\n new_set << val\n end\n end\n new_set\n end", "def not_set\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 23)\n return_value = NotSetReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n char_literal112 = nil\n not_terminal113 = nil\n element_options114 = nil\n block115 = nil\n element_options116 = nil\n\n tree_for_char_literal112 = nil\n stream_T__87 = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token T__87\")\n stream_not_terminal = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule not_terminal\")\n stream_block = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule block\")\n stream_element_options = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule element_options\")\n begin\n # at line 270:4: '~' ( not_terminal ( element_options )? -> ^( '~' not_terminal ( element_options )? ) | block ( element_options )? -> ^( '~' block ( element_options )? ) )\n char_literal112 = match(T__87, TOKENS_FOLLOWING_T__87_IN_not_set_1869) \n if @state.backtracking == 0\n stream_T__87.add(char_literal112)\n end\n # at line 271:3: ( not_terminal ( element_options )? -> ^( '~' not_terminal ( element_options )? ) | block ( element_options )? -> ^( '~' block ( element_options )? ) )\n alt_57 = 2\n look_57_0 = @input.peek(1)\n\n if (look_57_0.between?(TOKEN_REF, CHAR_LITERAL)) \n alt_57 = 1\n elsif (look_57_0 == T__81) \n alt_57 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 57, 0)\n raise nvae\n end\n case alt_57\n when 1\n # at line 271:5: not_terminal ( element_options )?\n @state.following.push(TOKENS_FOLLOWING_not_terminal_IN_not_set_1875)\n not_terminal113 = not_terminal\n @state.following.pop\n if @state.backtracking == 0\n stream_not_terminal.add(not_terminal113.tree)\n end\n # at line 271:18: ( element_options )?\n alt_55 = 2\n look_55_0 = @input.peek(1)\n\n if (look_55_0 == T__88) \n alt_55 = 1\n end\n case alt_55\n when 1\n # at line 271:18: element_options\n @state.following.push(TOKENS_FOLLOWING_element_options_IN_not_set_1877)\n element_options114 = element_options\n @state.following.pop\n if @state.backtracking == 0\n stream_element_options.add(element_options114.tree)\n end\n\n end\n # AST Rewrite\n # elements: not_terminal, T__87, element_options\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 271:35: -> ^( '~' not_terminal ( element_options )? )\n # at line 271:38: ^( '~' not_terminal ( element_options )? )\n root_1 = @adaptor.create_flat_list!\n root_1 = @adaptor.become_root(stream_T__87.next_node, root_1)\n\n @adaptor.add_child(root_1, stream_not_terminal.next_tree)\n # at line 271:57: ( element_options )?\n if stream_element_options.has_next?\n @adaptor.add_child(root_1, stream_element_options.next_tree)\n\n end\n\n stream_element_options.reset();\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 # at line 272:5: block ( element_options )?\n @state.following.push(TOKENS_FOLLOWING_block_IN_not_set_1895)\n block115 = block\n @state.following.pop\n if @state.backtracking == 0\n stream_block.add(block115.tree)\n end\n # at line 272:11: ( element_options )?\n alt_56 = 2\n look_56_0 = @input.peek(1)\n\n if (look_56_0 == T__88) \n alt_56 = 1\n end\n case alt_56\n when 1\n # at line 272:11: element_options\n @state.following.push(TOKENS_FOLLOWING_element_options_IN_not_set_1897)\n element_options116 = element_options\n @state.following.pop\n if @state.backtracking == 0\n stream_element_options.add(element_options116.tree)\n end\n\n end\n # AST Rewrite\n # elements: block, element_options, T__87\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 272:29: -> ^( '~' block ( element_options )? )\n # at line 272:32: ^( '~' block ( element_options )? )\n root_1 = @adaptor.create_flat_list!\n root_1 = @adaptor.become_root(stream_T__87.next_node, root_1)\n\n @adaptor.add_child(root_1, stream_block.next_tree)\n # at line 272:44: ( element_options )?\n if stream_element_options.has_next?\n @adaptor.add_child(root_1, stream_element_options.next_tree)\n\n end\n\n stream_element_options.reset();\n\n @adaptor.add_child(root_0, root_1)\n\n\n\n return_value.tree = root_0\n\n end\n end\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__, 23)\n\n end\n \n return return_value\n end", "def make_set(x,y,z)\n return [x,y,z]\n end", "def rInlSetInvocation\n addStaticInlMethods()\n return tab + 'statSet((int)(' + rExp + '));\\n'\nend", "def set\r\n assert_exists\r\n assert_enabled\r\n #highlight(:set)\r\n set_clear_item(true)\r\n #highlight(:clear)\r\n end", "def setting(value)\n result = 0\n shift_out_with_index do |bit, i|\n result |= bit.setting(value[i])\n end\n result\n end" ]
[ "0.6269487", "0.6157073", "0.6126773", "0.6060199", "0.5949183", "0.5681861", "0.56674725", "0.56674725", "0.5479863", "0.5452042", "0.5416909", "0.541476", "0.54129785", "0.5400769", "0.53996706", "0.53427625", "0.5330251", "0.5295366", "0.5289325", "0.5285828", "0.52601475", "0.52467626", "0.5231021", "0.5210482", "0.5203992", "0.51666695", "0.516252", "0.5125189", "0.51012874", "0.50999326", "0.50986063", "0.50956756", "0.50820965", "0.5081607", "0.5078383", "0.5078383", "0.50704986", "0.5052626", "0.5052621", "0.50504416", "0.5036806", "0.5036731", "0.50118613", "0.5000846", "0.49752006", "0.49751255", "0.4948316", "0.4940434", "0.4930713", "0.49281326", "0.4919785", "0.49113458", "0.48981413", "0.48882025", "0.4884988", "0.4883346", "0.4883346", "0.48811117", "0.48811117", "0.48725122", "0.48687634", "0.48637527", "0.48553815", "0.48553815", "0.48523015", "0.48486608", "0.48482332", "0.48371434", "0.4832494", "0.48273245", "0.4814737", "0.48102096", "0.48038805", "0.48025396", "0.4799601", "0.47992676", "0.4786798", "0.4785655", "0.47741607", "0.47741607", "0.47741085", "0.47684258", "0.4764681", "0.47621346", "0.4756262", "0.47474813", "0.47474813", "0.47463042", "0.47462198", "0.47457293", "0.47445315", "0.4743981", "0.47424865", "0.47386894", "0.47336635", "0.47283885", "0.47246143", "0.4712412", "0.47094452", "0.470517" ]
0.55855435
8
Transforms `(+= )` to `(set (+ ))`
def transform_inc_val_to_set(inc_expr) _tag, expr, val = inc_expr ['set', expr, ['+', expr, val]] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transform_inc_to_set(inc_expr)\n _tag, expr = inc_expr\n ['set', expr, ['+', expr, 1]]\n end", "def plus(reg)\n return lambda do |pos|\n statelist = reg.call(pos)\n curpos = pos + statelist.size\n endstate = { '' => Set.new( [pos, curpos + 1] ) }\n statelist << endstate\n return statelist\n end\nend", "def add_to_set(set, word)\n\tif !(set.key?(word))\n\t\tset.merge!(word => 1)\n\telse\n\t\tset[word] += 1\n\tend\nend", "def add_to_set(adds)\n prepare_atomic_operation do |ops|\n process_atomic_operations(adds) do |field, value|\n existing = send(field) || attributes[field]\n if existing.nil?\n attributes[field] = []\n # Read the value out of attributes:\n # https://jira.mongodb.org/browse/MONGOID-4874\n existing = attributes[field]\n end\n values = [ value ].flatten(1)\n values.each do |val|\n existing.push(val) unless existing.include?(val)\n end\n ops[atomic_attribute_name(field)] = { \"$each\" => values }\n end\n { \"$addToSet\" => ops }\n end\n end", "def add_each_to_set(adds)\n view.update_many(\"$addToSet\" => collect_each_operations(adds))\n end", "def add(*args)\n args.flatten! # allow [] as a param\n args.each do |arg|\n arg = arg.to_sym if arg.is_a? String\n @set << arg unless @set.include? arg # avoid duplicates\n end\n end", "def atomic_array_add_to_sets\n @atomic_array_add_to_sets ||= {}\n end", "def set=(_arg0); end", "def **(other)\n self + other\n end", "def param_plus(param_id, *args, &block)\n val = super(param_id, *args, &block)\n maesb_sets.compact.inject(val) {|r, item| r += item.params[param_id] }\n end", "def +(x); end", "def add!(rhs)\n @x += rhs.x\n @y += rhs.y\n self\n end", "def method4(first, second)\n first = first << second\nend", "def +(num)\n old_plus(old_plus(num))\n end", "def set_add(key, value)\n perform_update(:set_add, key, value.to_s)\n end", "def mset(*args); end", "def +(*values); end", "def +\n push pop + pop\n end", "def operators= new_ops\n @operators = new_ops.gsub(/[^+*-]/, '').split(//)\n reset\n end", "def operator=(_arg0); end", "def set(values); end", "def do_plus s; a = mega_pop(s); b = mega_pop(s); s[:stack].push(a+b); end", "def set; end", "def set; end", "def add!(rhs)\n add rhs, self\n end", "def +(rvalue)\n values = coerce(rvalue)\n return ( values[1] + values[0])\n end", "def add_all(set)\n raise NotImplementedError\n end", "def add(val)\n @set.include?(val) ? nil : @set.push(val)\n end", "def add!(rhs)\n @x += rhs.x\n @y += rhs.y\n @z += rhs.z\n self\n end", "def +(other)\n `return self + other;`\n end", "def +(other)\n `return self + other;`\n end", "def +(ary)\n ary.each { |a| self << a }\n self\n end", "def tricky_method(a_string_param, an_array_param)\n a_string_param << \"rutabaga\" #originally +=. shovel operator modifies original object. \n an_array_param << \"rutabaga\" #(\"mutates the caller)\"\nend", "def mset(*_arg0); end", "def +(rhs)\n union(rhs)\n end", "def +(other)\n return dup.add(other)\n end", "def Add(val)\n self.value += val\n end", "def setnx(key, value); end", "def setnx(key, value); end", "def +(*others)\n self.dup.add!(*others)\n end", "def []= k,v\n\t set k,v\n\t end", "def __copy_on_write__(*)\n super.tap do\n new_set = __getobj__.instance_variable_get(:@set).dup\n __getobj__.instance_variable_set(:@set, new_set)\n end\n end", "def +(another)\n self.concat(another)\n end", "def parse_line(line)\n target, operator, *commande = line.split(' ')\n self[target] = [] if self[target].nil?\n self[target] << [operator == '+=', Proc.new {|repository| eval(commande.join(' ')) }]\n end", "def generic_set(key, value)\n modify(key, value) || uncomment(key, value) || add_new(key, value)\n end", "def change_set_fn\n -> f, g, prev, this {\n f.(Set.new(this) - Set.new(prev))\n g.(Set.new(prev) - Set.new(this))\n }.curry\n end", "def set(key, value); end", "def set(key, value); end", "def +(addend)\n self.plus(addend).to_sub\n end", "def chain=(*rulesets)\n @chain = rulesets.map{ |b| b.to_sym }\n end", "def add(number)\n if @set[number]\n @set[number] = @set[number]+1\n else\n @set[number] = 1\n end\n end", "def op_set(attrname = nil)\n attrname ||= pop\n attrvalue = pop\n receiver = peek\n if receiver.respond_to?(:[]=)\n receiver[attrname] = attrvalue\n elsif receiver.respond_to?(:\"#{attrname}=\")\n receiver.send(:\"#{attrname}=\", attrvalue)\n else\n raise Error, \"Unable to set #{attrname} on #{receiver.inspect}\"\n end\n end", "def add!(p)\n@x += p.x\n@y += p.y\nself\nend", "def to_expanded_set\r\n (target.map { |x| x.to_i } << to_i).to_set # include the group value as well\r\n end", "def set(enumerable); end", "def +(other); end", "def +(other); end", "def +(other); end", "def +(y)\n @x + y\n end", "def tricky_method(a_string_param, an_array_param)\n a_string_param += \"rutabaga\" # += reassigns the value of a variable and is not destructive\n an_array_param << \"rutabaga\" # shovel operator (actually a method) is destructive and modifies the caller\nend", "def execute_XCHG(left, right)\n\t\tleft.value, right.value = right.value, left.value\n\tend", "def add(p)\nq = self.dup\nq.add!(p)\nend", "def assignment_op\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 47 )\n return_value = AssignmentOpReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n set224 = nil\n\n tree_for_set224 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line \n set224 = @input.look\n if @input.peek(1) == AMP_ASGN || @input.peek(1) == HAT_ASGN || @input.peek(1) == ASGN || @input.peek(1) == RSHIFT3_ASGN || @input.peek(1) == RSHIFT_ASGN || @input.peek(1) == SLASH_ASGN || @input.peek( 1 ).between?( LSHIFT_ASGN, STAR_ASGN ) || @input.peek(1) == MINUS_ASGN || @input.peek(1) == MOD_ASGN || @input.peek(1) == OR_ASGN || @input.peek(1) == PIPE_ASGN || @input.peek(1) == PLUS_ASGN\n @input.consume\n if @state.backtracking == 0\n @adaptor.add_child( root_0, @adaptor.create_with_payload( set224 ) )\n end\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\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__, 47 )\n\n end\n \n return return_value\n end", "def add(left, right, result) #method\n left = get_dir(left)\n right = get_dir(right)\n @current_context[result] = get_value(left) + get_value(right)\n end", "def _reduce_191(val, _values, result)\n result = new_assign(val[0], val[1], val[2])\n \n result\nend", "def watch_for_set=(_arg0); end", "def my_hash_modification_method!(source, thing_to_modify)\n# source = Hash[source.map {|k,v| [k, thing_to_modify + v ]}]\nsource.each do |key, value|\n source[key] = value + thing_to_modify\nend\nend", "def +(data)\n self.dps+= data.dps\n self\nend", "def add(this, that)\n\tthis + that\nend", "def transform_dec_val_to_set(dec_expr)\n _tag, expr, val = dec_expr\n ['set', expr, ['-', expr, val]]\n end", "def set!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 37 )\n\n type = SET\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 158:7: 'set'\n match( \"set\" )\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__, 37 )\n\n end", "def k_set!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 63 )\n\n\n\n type = K_SET\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 505:3: 'set'\n match( \"set\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 63 )\n\n\n end", "def +(other)\n combine(:add, other)\n end", "def set!(args)\n collection_modifier_update('$set', args)\n end", "def add(val1, val2) val1 + val2 end", "def on_opassign(variable, operator, value)\n return on_assign(variable, value).updated(:op_assign)\n end", "def +(other)\n @vector.merge!(other.hash){|key, oldval, newval| newval + oldval}\n end", "def +(p)\n group(self, p)\n .fmap {|(x, y)| x + y }\n .tap {|r| r.label = \"(#{label} + #{p.label})\" }\n end", "def +(other)\n other.inject(clone) do |copy, e|\n copy << e\n end\n end", "def _add(target, rhs)\n case rhs\n when Sym\n @delayed.each do |rule|\n rule.replace(rhs, target) if rule.target == rhs\n end\n @grammar.delete_symbol(rhs)\n else\n rhs.each_rule do |rule|\n rule.target = target\n @grammar.add(rule)\n end\n end\n flush_delayed\n end", "def set!(*args)\n end", "def add!( calculator )\n @committed += calculator.committed\n @not_committed += calculator.not_committed\n end", "def +(delta)\n clone.increment(Meangirls.node, delta)\n end", "def test_set_eval\n set = SetVariableEval.new(@int_var, @int_lit)\n set.eval\n assert_equal \"SET [Y+9], 10\\n\", MPPCompiler.last\n end", "def +(elem)\n plus(elem)\n end", "def add(num_1, num_2)\n add = num_1 + num_2\nend", "def aset(index, value)\n end", "def reducx(*values)\n @assign = values.compact.reduce({ }, :merge).keep_if &value_present\n self\n end", "def set(object, value); end", "def getset(key); end", "def _reduce_174(val, _values, result)\n result = node_assign val[0], val[2]\n \n result\nend", "def action_plus_set\r\n features(FEATURE_ACTION_PLUS).collect {|ft| ft.value }\r\n end", "def _reduce_195(val, _values, result)\n result = self.node_assign val[0], val[2]\n \n result\nend", "def _reduce_195(val, _values, result)\n result = self.node_assign val[0], val[2]\n \n result\nend", "def _reduce_195(val, _values, result)\n result = self.node_assign val[0], val[2]\n \n result\nend", "def _reduce_195(val, _values, result)\n result = self.node_assign val[0], val[2]\n \n result\nend", "def _reduce_195(val, _values, result)\n result = self.node_assign val[0], val[2]\n \n result\nend", "def reducx(*values)\n @assign = values.compact.reduce({ }, :merge!).keep_if &value_present\n self\n end", "def set(sets)\n view.update_many(\"$set\" => collect_operations(sets))\n end", "def _reduce_188(val, _values, result)\n result = new_assign(val[0], val[1], val[2])\n \n result\nend" ]
[ "0.6234682", "0.6066214", "0.6028541", "0.6002726", "0.59775984", "0.5937529", "0.5705494", "0.56881034", "0.5628338", "0.5606911", "0.5593371", "0.5541609", "0.5517003", "0.5509002", "0.5489131", "0.5468621", "0.5449312", "0.54473984", "0.54438317", "0.5384107", "0.5369717", "0.5365375", "0.5357216", "0.5357216", "0.53476286", "0.53122044", "0.5310313", "0.52993745", "0.52957726", "0.52863264", "0.52863264", "0.5277523", "0.5272516", "0.5266446", "0.52576035", "0.5251304", "0.5229556", "0.52267957", "0.52267957", "0.522513", "0.5214316", "0.5209179", "0.51888394", "0.5176392", "0.5173077", "0.5172579", "0.5144504", "0.5144504", "0.51320606", "0.51221216", "0.5120119", "0.5113224", "0.51123565", "0.5099278", "0.5088183", "0.50723004", "0.50723004", "0.50723004", "0.5060681", "0.50544035", "0.5046341", "0.5045828", "0.5044331", "0.5044181", "0.5041932", "0.50390756", "0.50296026", "0.5028241", "0.5024149", "0.5008624", "0.5008147", "0.5007706", "0.49990863", "0.49973422", "0.4997081", "0.49954927", "0.49946997", "0.4988435", "0.49727553", "0.49724025", "0.4959141", "0.4958456", "0.49576867", "0.49501345", "0.49500516", "0.4949412", "0.49475253", "0.4944877", "0.49391642", "0.49388224", "0.4936878", "0.49352163", "0.4929927", "0.4929927", "0.4929927", "0.4929927", "0.4929927", "0.49277914", "0.49265373", "0.4925636" ]
0.63655674
0
Transforms `(= )` to `(set ( ))`
def transform_dec_val_to_set(dec_expr) _tag, expr, val = dec_expr ['set', expr, ['-', expr, val]] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set=(_arg0); end", "def set!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 37 )\n\n type = SET\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 158:7: 'set'\n match( \"set\" )\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__, 37 )\n\n end", "def set(values); end", "def k_set!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 63 )\n\n\n\n type = K_SET\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 505:3: 'set'\n match( \"set\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 63 )\n\n\n end", "def set; end", "def set; end", "def operator=(_arg0); end", "def set!(*args)\n end", "def lhs= exp\n expect(*ASSIGNMENT_BOOL)\n @my_hash_value = nil\n self[1] = exp\n end", "def compile_assignment(identifier)\n shift :equal\n\n if identifier.type == :identifier\n variable = set(identifier)\n value = compile_vexpression\n variable.value = value\n else\n value = compile_vexpression\n variable = identifier\n end\n\n code :set, variable, value\n end", "def set(*args)\n run \"set #{OptArg.parse(*args)}\"\n nil\n end", "def assignment_op\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 47 )\n return_value = AssignmentOpReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n set224 = nil\n\n tree_for_set224 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line \n set224 = @input.look\n if @input.peek(1) == AMP_ASGN || @input.peek(1) == HAT_ASGN || @input.peek(1) == ASGN || @input.peek(1) == RSHIFT3_ASGN || @input.peek(1) == RSHIFT_ASGN || @input.peek(1) == SLASH_ASGN || @input.peek( 1 ).between?( LSHIFT_ASGN, STAR_ASGN ) || @input.peek(1) == MINUS_ASGN || @input.peek(1) == MOD_ASGN || @input.peek(1) == OR_ASGN || @input.peek(1) == PIPE_ASGN || @input.peek(1) == PLUS_ASGN\n @input.consume\n if @state.backtracking == 0\n @adaptor.add_child( root_0, @adaptor.create_with_payload( set224 ) )\n end\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\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__, 47 )\n\n end\n \n return return_value\n end", "def rhs= exp\n expect :attrasgn, :safe_attrasgn, *ASSIGNMENT_BOOL\n @my_hash_value = nil\n\n if self.node_type == :attrasgn or self.node_type == :safe_attrasgn\n self[3] = exp\n else\n self[2] = exp\n end\n end", "def set!(args)\n collection_modifier_update('$set', args)\n end", "def set( s )\n @pipe[-1].clear << s\n end", "def attribute_to_set; end", "def set(path, value)\n return aset(nil, value) if path.nil?\n aset(path.split(':'), value)\n end", "def __set()\n caller.each do |c|\n source = c[/^([^:]+):/,1]\n set = @@__sets[source]\n return set if set\n end\n\n :original\n end", "def __copy_on_write__(*)\n super.tap do\n new_set = __getobj__.instance_variable_get(:@set).dup\n __getobj__.instance_variable_set(:@set, new_set)\n end\n end", "def const_set(p0, p1) end", "def chain=(*rulesets)\n @chain = rulesets.map{ |b| b.to_sym }\n end", "def transform_inc_val_to_set(inc_expr)\n _tag, expr, val = inc_expr\n ['set', expr, ['+', expr, val]]\n end", "def set(enumerable); end", "def watch_for_set=(_arg0); end", "def set\n @items.each do |d|\n eval d.rubify\n end\n end", "def assignment\n @name = get_name\n match '='\n expression\n emit_ln \"LEA #{@name} (PC),A0\"\n emit_ln 'MOVE D0,(A0)'\nend", "def mset(*args); end", "def op_set(attrname = nil)\n attrname ||= pop\n attrvalue = pop\n receiver = peek\n if receiver.respond_to?(:[]=)\n receiver[attrname] = attrvalue\n elsif receiver.respond_to?(:\"#{attrname}=\")\n receiver.send(:\"#{attrname}=\", attrvalue)\n else\n raise Error, \"Unable to set #{attrname} on #{receiver.inspect}\"\n end\n end", "def func_set(args)\n p1 = _eval(car(args))\n p2 = _eval(car(cdr(args)))\n\n if p1 == @o_man.nil\n if @lint\n Error.warn(\"warning: setting the value of a nil object\")\n end\n else\n @o_man.set_object(p1, p2)\n end\n return p2\n end", "def []= k,v\n\t set k,v\n\t end", "def mset(*_arg0); end", "def set(tuple)\n build(tuple) if @tuple.nil?\n @tuple = tuple\n self\n end", "def set(object, value); end", "def do_assignment(leadin)\n ident = leadin.type == :LET ? (expect [:ident]).value : leadin.value\n\n expect [:assign]\n\n @variables[ident] = if @lexer.peek_next_type == :string\n @lexer.next.value\n else\n expression_value\n end\n end", "def parse_and_add_set(cmd)\n # First strip out the superfluous equal's sign if present\n cmd.delete '='\n raise \"Invalid format for SET statement.\" unless cmd.length == 3\n ret = nil\n \n # Get the variable name\n case cmd[1].downcase\n when 'debug'\n ret = @debug = to_bool(cmd[2])\n when 'max_file_length'\n ret = @max_file_length = cmd[2].to_i\n when 'full_event_display'\n ret = @full_event_display = to_bool(cmd[2])\n when 'parse_file_contents'\n ret = @parse_file_contents = to_bool(cmd[2])\n when 'syn_timeout_delay'\n ret = @syn_timeout_delay = cmd[2].to_i\n when 'stream_timeout_delay'\n ret = @stream_timeout_delay = cmd[2].to_i\n else\n raise \"Invalid user variable: #{cmd[1]}\"\n end\n return cmd[1], ret\n end", "def test_set_eval\n set = SetVariableEval.new(@int_var, @int_lit)\n set.eval\n assert_equal \"SET [Y+9], 10\\n\", MPPCompiler.last\n end", "def set(value)\n execute_only(:set, value)\n end", "def to_set\n require 'set' unless defined?(::Set)\n each.to_set\n end", "def set(assignments)\n assignments.map do |attr, value|\n next unless attr.present?\n\n name = attr.is_a?(Arel::Attributes::Attribute) ? attr.name : attr.to_s\n\n quoted = record.class.connection.quote_column_name(name)\n \"#{quoted} = (#{value.to_sql})\"\n end.join(', ')\n end", "def parse_set_mem\n if @row.gsub!(/([ \\t]*~\\^)([^\\n]+\\n)/,'')\n set_mem = $2 \n if !global_set_mem(set_mem)\n p \"setMem ^ => #{set_mem}\" if @dbg[:parse]\n @mem_tag[\"^\"]= set_mem\n end \n end\n end", "def set(hash)\n set_restricted(hash, nil, nil)\n end", "def set(*args)\n # not supported\n end", "def set(*args)\n # not supported\n end", "def assignment\n expr = conditional\n\n if match?(:equal)\n equals = previous\n value = expression\n\n if expr.is_a?(Ringo::Variable)\n name = expr.name\n return Ringo::Assign.new(name, value)\n elsif expr.is_a?(Ringo::Get)\n return Ringo::Set.new(expr.object, expr.name, value)\n end\n\n error(equals, \"Invalid assignment target.\")\n end\n\n return expr\n end", "def assign_operator()\n\n\n\n # 289:5: ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' )\n alt42 = 12\n # 288:1: assign_operator : ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' );\n case look_ahead(1)\n when :EQUAL\n alt42 = 1\n when :PLUS\n alt42 = 2\n when :MINUS\n alt42 = 3\n when :TIMES\n alt42 = 4\n when :SLASH\n alt42 = 5\n when :ECOMMERCIAL\n alt42 = 6\n when :PIPE\n alt42 = 7\n when :WEDGE\n alt42 = 8\n when :MODULUS\n alt42 = 9\n when :LEFT_ANGULAR_BRACKET\n alt42 = 10\n when :RIGHT_ANGULAR_BRACKET\n # 288:1: assign_operator : ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' );\n look_ahead42_11 = look_ahead(2)\n if look_ahead42_11 == :RIGHT_ANGULAR_BRACKET \n # 288:1: assign_operator : ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' );\n look_ahead42_12 = look_ahead(3)\n if look_ahead42_12 == :RIGHT_ANGULAR_BRACKET \n alt42 = 11\n elsif look_ahead42_12 == :EQUAL \n alt42 = 12\n else\n raise \"Expected: 288:1: assign_operator : ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' );\"\n end\n else\n raise \"Expected: 288:1: assign_operator : ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' );\"\n end\n else\n raise \"Expected: 288:1: assign_operator : ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' );\"\n\n end\n case alt42\n when 1\n # 289:9: '='\n match(:EQUAL)\n when 2\n # 290:9: '+' '='\n match(:PLUS)\n match(:EQUAL)\n when 3\n # 291:9: '-' '='\n match(:MINUS)\n match(:EQUAL)\n when 4\n # 292:9: '*' '='\n match(:TIMES)\n match(:EQUAL)\n when 5\n # 293:9: '/' '='\n match(:SLASH)\n match(:EQUAL)\n when 6\n # 294:9: '&' '='\n match(:ECOMMERCIAL)\n match(:EQUAL)\n when 7\n # 295:9: '|' '='\n match(:PIPE)\n match(:EQUAL)\n when 8\n # 296:9: '^' '='\n match(:WEDGE)\n match(:EQUAL)\n when 9\n # 297:9: '%' '='\n match(:MODULUS)\n match(:EQUAL)\n when 10\n # 298:9: '<' '<' '='\n match(:LEFT_ANGULAR_BRACKET)\n match(:LEFT_ANGULAR_BRACKET)\n match(:EQUAL)\n when 11\n # 299:9: '>' '>' '>' '='\n match(:RIGHT_ANGULAR_BRACKET)\n match(:RIGHT_ANGULAR_BRACKET)\n match(:RIGHT_ANGULAR_BRACKET)\n match(:EQUAL)\n when 12\n # 300:9: '>' '>' '='\n match(:RIGHT_ANGULAR_BRACKET)\n match(:RIGHT_ANGULAR_BRACKET)\n match(:EQUAL)\n end\n\n\n\n end", "def set(&block)\n @set = block\n end", "def set(&block)\n @set = block\n end", "def nested_to_set(obj)\n if obj.is_a? Array\n obj.map{ |v| nested_to_set(v) }.to_set\n elsif obj.is_a? Hash\n obj.inject({}) do |h,(k,v)|\n h.merge!(k => nested_to_set(v))\n end\n else\n obj\n end\n end", "def setter( name ) (name.to_s + '=').to_sym end", "def reducx(*values)\n @assign = values.compact.reduce({ }, :merge).keep_if &value_present\n self\n end", "def to_setter\n\t\t\t\t(to_getter.to_s+\"=\").to_sym\n\t\t\tend", "def reducx(*values)\n @assign = values.compact.reduce({ }, :merge!).keep_if &value_present\n self\n end", "def set(ot)\n merge(ot)\n self\n end", "def spread_value(dest, value)\r\n if @char_set.default && value\r\n dest.default = true\r\n\r\n @char_set.each do |key, char_set_value|\r\n dest[key] = false unless char_set_value\r\n end\r\n else\r\n self.each do |key|\r\n dest[key] = value\r\n end\r\n end\r\n end", "def cop=(_); end", "def cop=(_); end", "def convert(y)\n y.chars.to_a.to_set\nend", "def value=(_); end", "def assign!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 47 )\n\n type = ASSIGN\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 373:10: '='\n match( 0x3d )\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__, 47 )\n\n end", "def getset(key, value); end", "def getset(key, value); end", "def process_set(match, function, type_table)\n name = match[1]\n array_index = match[3]\n value = match[4]\n\n # Error checking:\n unless function.is_a? Function\n raise \"Can only set variables inside functions\"\n end\n\n var_list = function.var_list\n unless var_list.include?(name)\n raise \"Undeclared variable '#{name}'\"\n end\n\n var = function.var_list.get(name)\n if array_index != nil and (not var.is_array?)\n raise \"Cannot use array index on non-array variable\"\n end\n\n # Parse value and create instruction\n ident_list = function.ident_list\n value_expression = process_expression(value, ident_list, type_table)\n\n var_type = var.type\n if array_index\n var_type = var.type.element_type\n end\n\n unless value_expression.type.castable?(var_type)\n raise \"Cannot convert expression type #{value_expression.type.to_s} \" +\n \"to variable type #{var_type.to_s}\"\n end\n\n instruction = SetVariableInstruction.new(var, value_expression, function)\n\n # The variable is being used as an array, add array index to instruction\n if array_index\n index_expression = process_expression(array_index, ident_list,\n type_table)\n instruction.array_index = index_expression\n\n unless index_expression.type.castable?(WORD_TYPE)\n raise \"Cannot convert array index #{index_expression.type.to_s} \" +\n \"to word type\"\n end\n end\n\n function.add_instruction(instruction)\n return true\nend", "def set(*args)\n unless(args.size > 1)\n raise ArgumentError,\n 'Set requires at least one key and a value'\n end\n value = args.pop\n set_key = args.pop\n leaf = args.inject(self) do |memo, key|\n unless(memo[key].is_a?(Hash))\n memo[key] = Smash.new\n end\n memo[key]\n end\n leaf[set_key] = value\n value\n end", "def set(string = None)\n if None == string\n execute(:set)\n else\n execute_only(:set, string)\n end\n end", "def transform_dec_to_set(dec_expr)\n _tag, expr = dec_expr\n ['set', expr, ['-', expr, 1]]\n end", "def set(pairs={})\n if not(immutable?)\n pairs.each {|idx, val| self[idx] = val}\n return self\n else\n pairs.inject(self) {|obj, (idx, val)| obj.send(\"[]=\", idx, val)}\n end\n end", "def set(sets)\n view.update_many(\"$set\" => collect_operations(sets))\n end", "def value=(v)\n set(v)\n end", "def set(name,value)\n foundit = false\n @wrapped.map! do |item|\n /^([\\w]*)=(.*)$/ =~ item\n #puts \"#{name} 1=#{$1} and 2=#{$2}\"\n if ($1 == name)\n #puts \"updating #{$1}\"\n foundit = true\n \"#{$1}=#{value}\"\n else\n item\n end\n end\n #puts \"appending #{name}=#{value}\" unless foundit\n append(name,value) unless foundit\n end", "def y=(_); end", "def y=(_); end", "def change_set_fn\n -> f, g, prev, this {\n f.(Set.new(this) - Set.new(prev))\n g.(Set.new(prev) - Set.new(this))\n }.curry\n end", "def attribute_assignment(node)\n if node.left_value.message.is_a?(Sexp) && node.left_value.message.to_s =~ /_id$/\n receiver = node.left_value.receiver.to_s\n @assignments[receiver] = true\n end\n end", "def set(hash)\n if @where\n raise QueryError, 'Filtering has already been provided. Must filter after setting values.'\n end\n\n @sets ||= {}\n hash.each do |key, value|\n @sets[key] = value_escape(value)\n end\n self\n end", "def js_set(pairs = {})\n raise ArgumentError, \"only a single variable is supported\" if pairs.keys.length > 1\n pairs.map.each { |var, expr| js_value %Q|#{var.to_s} = #{marshal expr}| }.join(COLON)\n end", "def set(setters)\n prepare_atomic_operation do |ops|\n process_atomic_operations(setters) do |field, value|\n send(\"#{field}=\", value)\n ops[atomic_attribute_name(field)] = attributes[field]\n end\n { \"$set\" => ops }\n end\n end", "def set\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 53 )\n\n\n return_value = SetReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n\n root_0 = nil\n\n __K_SET284__ = nil\n __LLAIZQ285__ = nil\n __K_VALUE286__ = nil\n __LLADER287__ = nil\n\n\n tree_for_K_SET284 = nil\n tree_for_LLAIZQ285 = nil\n tree_for_K_VALUE286 = nil\n tree_for_LLADER287 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 243:3: K_SET LLAIZQ K_VALUE LLADER\n __K_SET284__ = match( K_SET, TOKENS_FOLLOWING_K_SET_IN_set_1202 )\n if @state.backtracking == 0\n tree_for_K_SET284 = @adaptor.create_with_payload( __K_SET284__ )\n @adaptor.add_child( root_0, tree_for_K_SET284 )\n\n end\n\n __LLAIZQ285__ = match( LLAIZQ, TOKENS_FOLLOWING_LLAIZQ_IN_set_1204 )\n if @state.backtracking == 0\n tree_for_LLAIZQ285 = @adaptor.create_with_payload( __LLAIZQ285__ )\n @adaptor.add_child( root_0, tree_for_LLAIZQ285 )\n\n end\n\n __K_VALUE286__ = match( K_VALUE, TOKENS_FOLLOWING_K_VALUE_IN_set_1206 )\n if @state.backtracking == 0\n tree_for_K_VALUE286 = @adaptor.create_with_payload( __K_VALUE286__ )\n @adaptor.add_child( root_0, tree_for_K_VALUE286 )\n\n end\n\n __LLADER287__ = match( LLADER, TOKENS_FOLLOWING_LLADER_IN_set_1208 )\n if @state.backtracking == 0\n tree_for_LLADER287 = @adaptor.create_with_payload( __LLADER287__ )\n @adaptor.add_child( root_0, tree_for_LLADER287 )\n\n end\n\n\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n if @state.backtracking == 0\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\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\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 53 )\n\n\n end\n\n return return_value\n end", "def parse_set\n @current_set = Set.new\n @current_match.add_set @current_set\n end", "def method_missing(sym, *args, &block)\n if sym[-1] != \"=\"\n sym_set = (sym.to_s + \"=\").to_sym\n return send(sym_set, *args, &block) if respond_to?(sym_set)\n end\n\n super\n end", "def raw=(_); end", "def set(value)\n mutate build_map(value)\n end", "def set k,v\n key = k.to_s.to_sym\n v = (v.is_a?(ASObj) ? v.finish : v) unless v == nil\n @_[key] = v unless v == nil\n @_.delete key if v == nil\n end", "def old_value=(_arg0); end", "def test_set_values\n ogg = dummy()\n\n assert !ogg.has_tag?(\"A\")\n\n ogg.set_values(\"A\", \"B\")\n assert_equal Set[\"B\"], ogg['A']\n\n ogg.set_values(\"A\", \"C\", \"D\")\n assert_equal Set[\"C\", \"D\"], ogg['A']\n\n # This will remove the tag\n ogg.set_values(\"A\", *[])\n assert !ogg.has_tag?(\"A\")\n end", "def to_set(klass = Set, *args, &block)\n return self if instance_of?(Set) && klass == Set && block.nil? && args.empty?\n klass.new(self, *args, &block)\n end", "def setter\n @setter ||= :\"#{@name}=\"\n end", "def getset(key); end", "def aset(index, value)\n end", "def set(key, value); end", "def set(key, value); end", "def set!(x, y=self.x, z=self.y)\n end", "def tag_set(p_tag_sym, p_val) tag.send(\"#{p_tag_sym.to_s}=\", p_val) end", "def x=(_); end", "def x=(_); end", "def on_assign(node)\n reset_assignment_value\n value_stack.add_stack\n end", "def setter\n @setter ||= \"#{name}=\"\n end", "def mess_with_vars(one, two, three)\n one = two\n two = three\n three = one\nend", "def mess_with_vars(one, two, three)\n one = two\n two = three\n three = one\nend", "def mess_with_vars(one, two, three)\n one = two\n two = three\n three = one\nend", "def mess_with_vars(one, two, three)\n one = two\n two = three\n three = one\nend" ]
[ "0.66755444", "0.6134457", "0.6090639", "0.6019862", "0.5904584", "0.5904584", "0.588307", "0.5705421", "0.56710213", "0.55703163", "0.5561224", "0.55544937", "0.55494976", "0.55375004", "0.55122155", "0.54984313", "0.5463807", "0.5462546", "0.5444475", "0.5432947", "0.5430546", "0.542359", "0.5419467", "0.5407758", "0.54052997", "0.54029197", "0.54008", "0.53950834", "0.53887093", "0.53743994", "0.5373793", "0.5365727", "0.5362273", "0.5350888", "0.5347051", "0.5323631", "0.5320954", "0.5319769", "0.53116", "0.5303631", "0.5300591", "0.5296353", "0.5296353", "0.5295851", "0.52881426", "0.5286393", "0.5286393", "0.5280307", "0.5280244", "0.5274612", "0.52665406", "0.5263938", "0.5263151", "0.525616", "0.5237954", "0.5237954", "0.5237041", "0.522783", "0.52272785", "0.51885515", "0.51885515", "0.5170446", "0.5167", "0.5165731", "0.51575655", "0.51442796", "0.51440156", "0.5132402", "0.51151127", "0.51088864", "0.51088864", "0.5107657", "0.51024413", "0.509921", "0.5097796", "0.5097072", "0.5078769", "0.50772554", "0.5076895", "0.5068248", "0.5067568", "0.5059067", "0.5042117", "0.5039677", "0.5039048", "0.50389874", "0.5033138", "0.50294524", "0.50292665", "0.50292665", "0.5024204", "0.5015263", "0.50105995", "0.50105995", "0.5009916", "0.50088805", "0.5003575", "0.5003575", "0.5003575", "0.5003575" ]
0.55494875
13
attach_function :make_cudaExtent, [:size_t, :size_t, :size_t], CudaExtent attach_function :make_cudaPitchedPtr, [:pointer, :size_t, :size_t, :size_t], CudaPitchedPtr attach_function :make_cudaPos, [:size_t, :size_t, :size_t], CudaPos
def make_cudaExtent(w, h, d) e = CudaExtent.new e[:width], e[:height], e[:depth] = w, h, d e end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def matrix_multiplication_gpu_transposed_a(a, b, size)\n # Matrix A is transposed\n\n return PArray.new(size * size) do |index|\n x = index % size\n y = index / size\n\n # TODO(4): Implement\n # Try with GPU_T_A 150\n # If correct, run with GPU_T_A 3000 and compare runtime with GPU 3000\n\n 123.4\n end\nend", "def matrix_multiplication_gpu_transposed_b(a, b, size)\n # Matrix B is transposed\n\n return PArray.new(size * size) do |index|\n x = index % size\n y = index / size\n\n # TODO(5): Implement\n # Try with GPU_T_B 150\n # If correct, run with GPU_T_B 3000 and compare runtime with GPU 3000\n\n 123.4\n end\nend", "def use\n Cumo::CUDA::Runtime.cudaSetDevice(@id)\n end", "def create_nvidia_container(tag_name, image, volume_driver)\n puts \"-- Creating Docker Container\"\n container = Docker::Container.create(\n 'name' => tag_name,\n 'Image' => image,\n 'ExposedPorts' => { '9999/tcp' => {} },\n 'HostConfig' => {\n 'PortBindings' => {\n '8888/tcp' => [{ 'HostPort' => '9999', 'HostIP' => '0.0.0.0'}]\n },\n 'Devices' => [\n { 'PathOnHost' => '/dev/nvidiactl', 'PathInContainer' => '/dev/nvidiactl', 'CgroupPermissions' => 'rwm' },\n { 'PathOnHost' => '/dev/nvidia-uvm', 'PathInContainer' => '/dev/nvidia-uvm', 'CgroupPermissions' => 'rwm'},\n # { 'PathOnHost' => '/dev/nvidia-uvm-tools', 'PathInContainer' => '/dev/nvidia-uvm-tools', 'CgroupPermissions' => 'rwm' },\n { 'PathOnHost' => '/dev/nvidia0', 'PathInContainer' => '/dev/nvidia0', 'CgroupPermissions' => 'rwm' }\n ],\n 'VolumeDriver' => 'nvidia-docker',\n 'Mounts' => [\n { 'Target' => '/usr/local/nvidia', 'Source' => volume_driver, 'Type' => 'bind'}\n ]\n }\n )\n container.start\nend", "def matrix_multiplication_gpu_blocked(a, b, size)\n block_size_x = 15\n block_size_y = 15\n\n # Get it running with GPU_BLOCK 150 first\n # Then measure runtime with GPU_BLOCK 3000\n \n # Create blocked indices\n # For example (2x2): [0, 1, 4, 5, 2, 3, 6, 7 , ...]\n indices = Array.new(size * size)\n\n # TODO (Step 6.1): Generate block indices\n\n unordered_result = indices.to_pa.map do |index|\n x = index % size\n y = index / size\n\n # TODO (Step 6.2): Implement (same as Step 3)\n\n 123.4\n end\n\n correct_order_result = Array.new(size*size)\n\n # TODO (Step 6.3): Restore correct order\n\n return correct_order_result\nend", "def create_device()\n # Identify a platform\n platforms_buf = ' ' * 4 * 32\n err = clGetPlatformIDs(1, platforms_buf, nil)\n platform = platforms_buf.unpack(\"L\")[0]\n abort(\"Couldn't identify a platform\") if err < 0\n\n # Access a device\n dev_buf = ' ' * 4 * 32\n err = clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, 1, dev_buf, nil)\n if err == CL_DEVICE_NOT_FOUND\n err = clGetDeviceIDs(platform, CL_DEVICE_TYPE_CPU, 1, dev_buf, nil)\n end\n abort(\"Couldn't access any devices\") if err < 0\n\n return dev_buf.unpack(\"Q\")[0]\nend", "def transformation_device(*eras); end", "def build_pointers(cc, dp)\n cc_operand = build_operand(cc)\n @variables[cc] = NamedTemporaryVariable.new cc_operand.offset, '%cc'\n dp_operand = build_operand(dp)\n @variables[dp] = NamedTemporaryVariable.new dp_operand.offset, '%dp'\n end", "def pointer_inputs; end", "def make_vectors_pointer(vectors)\n\t\tptr = Pointer.new(\"{_vector_float2=ff}\", vectors.length)\n\t\tvectors.each_with_index { |e, i| ptr[i] = e }\n\t\tptr\n\tend", "def eth_gpu_en; eth_ctrl_bit(1); end", "def function(function, opt={})\n #axis = opt[:axis] || opt[:a] || :off\n pixels = []\n \n @width.times do |x|\n row = Array.new(@height, nil)\n \n @height.times do |y|\n pixel = 0\n @density.times do |i|\n xx = (x + i.to_f/@density) - @x_offset\n yy = function.call(xx) + @y_offset\n if yy >= y && yy < y + 1\n pixel = 1\n break\n else\n next\n end\n end\n row[y] = pixel\n end\n pixels << row\n end\n \n PNM.create(pixels.transpose.reverse!, {:type => :pbm})\n end", "def make_targets\n @targets = Array.new(8) { Vec2D.new(rand(width), rand(height)) }\nend", "def forward(tgt, memory, tgt_mask: nil, memory_mask: nil,\n tgt_key_padding_mask: nil, memory_key_padding_mask: nil)\n\n tgt2 = @self_attn.call(tgt, tgt, tgt, attn_mask: tgt_mask,\n key_padding_mask: tgt_key_padding_mask)[0]\n tgt = tgt + @dropout1.call(tgt2)\n tgt = @norm1.call(tgt)\n tgt2 = @multihead_attn.call(tgt, memory, memory, attn_mask: memory_mask,\n key_padding_mask: memory_key_padding_mask)[0]\n tgt = tgt + @dropout2.call(tgt2)\n tgt = @norm2.call(tgt)\n tgt2 = @linear2.call(@dropout.call(@activation.call(@linear1.call(tgt))))\n tgt = tgt + @dropout3.call(tgt2)\n tgt = @norm3.call(tgt)\n return tgt\n end", "def set_svm_ptrs( ptrs )\n error_check(INVALID_OPERATION) if self.context.platform.version_number < 2.0\n pointers = [ptrs].flatten\n pt = FFI::MemoryPointer::new( :pointer, pointers.length )\n pointers.each_with_index { |p, i|\n pt[i].write_pointer(p)\n }\n error = OpenCL.clSetKernelExecInfo( self, EXEC_INFO_SVM_PTRS, pt.size, pt)\n error_check(error)\n return self\n end", "def host_Translation_ATS_PRI_test(test_kysyWrapper_Inst, dGPU_Tonga_Inst)\n\t### examples for accessing DGPU class, and DGPU_MMIO/DGPU_CFG_Space\n\tresult = false\n\tdGPU_Tonga_Inst.dGPU_SetUp\n\tv_sdma0_rb_base_gfx = dGPU_Tonga_Inst.dGPU_FB_LOCATION_BASE.to_i\n\tv_sdma0_rb_base_cpu = dGPU_Tonga_Inst.dGPU_FrameBufferBAR.to_i\n\t\n\tv_sdma_destination = 0x1000\n\t\n\t### ATC Aperture should cover the minimum virtual address range for traffic\n\t### DO NOT OVERLAP with MMIO and other apertures\n\tdGPU_Tonga_Inst.dGPU_Set_ATC_Aperture(v_sdma_destination, v_sdma_destination + 0x1000_0000)\n\tdGPU_Tonga_Inst.dGPU_Enable_ATS\n\tdGPU_Tonga_Inst.dGPU_Enable_PRI\n\t#dGPU_Tonga_Inst.dGPU_Enable_Guest(0x1, 0x123)\n\tdGPU_Tonga_Inst.dGPU_Setup_SDMA_Linear_Copy_Wrapper(v_sdma0_rb_base_cpu, 16, v_sdma0_rb_base_gfx, v_sdma_destination)\n\t#dGPU_Tonga_Inst.dGPU_Setup_SDMA_Linear_Copy_Wrapper(v_sdma0_rb_base_cpu + dGPU_Tonga_Inst.dGPU_OSS_SDMA_Total_Number_Of_Bytes, 16, v_sdma0_rb_base_gfx, v_sdma_destination+0x1000)\n\n\t### Test loop (Remove later)\n\tfor i in 1..128\n\t\tdGPU_Tonga_Inst.dGPU_Setup_SDMA_Linear_Copy_Wrapper(v_sdma0_rb_base_cpu + dGPU_Tonga_Inst.dGPU_OSS_SDMA_Total_Number_Of_Bytes, 16, v_sdma0_rb_base_gfx, v_sdma_destination+(0x1000*i))\n\tend\n\tdGPU_Tonga_Inst.dGPU_OSS_SDMA_Enable\n\t\t\n\tdGPU_Tonga_Inst.dGPU_OSS_SDMA_Initiate\n\tresult = dGPU_Tonga_Inst.dGPU_OSS_SDMA_Check_Finish\n\tdGPU_Tonga_Inst.dGPU_OSS_SDMA_Reset\n\treturn result\n\t# may need dGPU_Tonga_Inst.dGPU_OSS_SDMA_Reset\nend", "def source_pts=(_arg0); end", "def elastic_gpu_associations\n data[:elastic_gpu_associations]\n end", "def forward(tgt, memory, tgt_mask: nil,\n memory_mask: nil, tgt_key_padding_mask: nil,\n memory_key_padding_mask: nil)\n\n output = @embedding.call(tgt) * Math.sqrt(@d_model)\n puts \"tgt3_\", tgt.inspect\n output = @pos_encoder.call(output)\n puts \"tgt4\", tgt.inspect\n @layers.each { |mod|\n output = mod.call(output, memory, tgt_mask: tgt_mask,\n memory_mask: memory_mask,\n tgt_key_padding_mask: tgt_key_padding_mask,\n memory_key_padding_mask: memory_key_padding_mask)\n }\n puts \"tgt5\", tgt.inspect\n\n if @norm\n output = @norm.call(output)\n end\n\n return output\n end", "def cheap_broadcast; end", "def gcdlcm(p0) end", "def attach; end", "def create(pointer)\n allocate.tap { |i| i.send(:initialize, FFI::AutoPointer.new(pointer, ::Libuv::Ext.method(:loop_delete))) }\n end", "def parent_device_ext\n ptr = MemoryPointer::new( Device )\n error = OpenCL.clGetDeviceInfo(self, PARENT_DEVICE_EXT, Device.size, ptr, nil)\n error_check(error)\n return nil if ptr.null?\n return Device::new(ptr.read_pointer)\n end", "def create_picture_viewport\n @viewport2 = Viewport.new(0, 0, Graphics.width, Graphics.height)\n @viewport2.z = 99\n end", "def pointer_up(button = T.unsafe(nil), device: T.unsafe(nil), **opts); end", "def screen_points(dc, data, target)\n [[0, 0]]\n end", "def broadcasting; end", "def t(a, b); @tape[a, b]; end", "def update_memory!(mem)\n map = @game.map\n \n x_s = @x-@vision\n y_s = @y-@vision\n @fov = linecast(map.tiles.get_values(x_s,y_s,2*@vision,2*@vision))\n mem.ins_values(x_s, y_s, @fov, false)\n end", "def mem(*) end", "def memory_view(cols = nil,start_at = 8,end_at = 43808,skip_empties = false)\n cols = @memory_view_width\n str = \"\"\n puts Benchmark.measure {\n tag_open = \"\"\n bytes_left = -1\n empty_row = Array.new(cols,0)\n mem_address = start_at\n row_index = 0\n while mem_address <= end_at\n #row = @vm.memory[mem_address..(mem_address+cols)]\n row = @vm.memory.raw_read(mem_address...(mem_address+cols))\n next if skip_empties && row == empty_row\n row_address = start_at + (row_index * cols)\n mem_hex = \"\"\n str << %(<tr class=\"memory_row_address_#{row_address}\"><td class=\"address\">#{row_address}</td><td>)\n row.bytes.each_with_index{ |b,i|\n address = row_address + i\n\n if @vm.allocations[address]\n #bytes_left = Vm::TYPE_SIZES[ @vm.allocations[address][0] ]\n bytes_left = 4 # vars in memory are always 32-bit ints/floats?\n classes = \"allocated hl_address hl_address_#{address} data_type_#{@vm.allocations[address][0]} allocation_id_#{@vm.allocations[address][1]}\"\n bytes = @vm.read(address,bytes_left)\n native = @vm.arg_to_native(@vm.allocations[address][0],bytes)\n tag_open = %(<a class=\"#{classes}\" href=\"#\" data-native=\"#{native}\" data-bytes=\"#{hex(bytes)}\" data-data_type=\"#{@vm.allocations[address][0]}\" data-allocation_id=\"#{@vm.allocations[address][1]}\" data-address=\"#{address}\">)\n str << tag_open\n elsif i == 0 && bytes_left > 0\n str << tag_open\n end\n\n bytes_left -= 1\n str << %(<span class=\"address_#{address} hl_address hl_address_#{address}\">) << hex(b) << %(</span>)\n\n if bytes_left == 0 || bytes_left > 0 && i == cols-1\n str << \"</a>\"\n end\n\n str << \" \"\n }\n str << %(</td></tr>\\n)\n mem_address += cols\n row_index += 1\n end\n }\n str\n end", "def attach(source); end", "def generate_points(u_count, v_count)\n points = []\n v_count.times do |iv|\n row = []\n u_count.times do |iu|\n u = map1d(iu, (0..u_count), U_RANGE)\n v = map1d(iv, (0..v_count), V_RANGE)\n # default scale: 50, param: Array.new(12, 1) and mesh_distortion: 0\n row << superformula(u: u, v: v)\n end\n points << row\n end\n points\nend", "def forward(src, tgt, src_mask: nil, tgt_mask: nil,\n memory_mask: nil, src_key_padding_mask: nil,\n tgt_key_padding_mask: nil, memory_key_padding_mask: nil)\n if src.size(1) != tgt.size(1)\n raise RuntimeError, \"the batch number of src and tgt must be equal\"\n end\n\n puts \"tgt1\", tgt.inspect\n\n memory = @encoder.call(src, mask: src_mask, src_key_padding_mask: src_key_padding_mask)\n output = @decoder.call(tgt, memory, tgt_mask: tgt_mask, memory_mask: memory_mask,\n tgt_key_padding_mask: tgt_key_padding_mask,\n memory_key_padding_mask: memory_key_padding_mask)\n puts \"tgt2\", tgt.inspect\n output = @linear.call(output)\n output = @softmax.call(output)\n\n return output\n end", "def set_gpu_conf\n @gpu_conf = GpuConf.find(params[:id])\n end", "def scroll_by(delta_x, delta_y, device: T.unsafe(nil)); end", "def book_execution(fill)\n# allocate(fill)\n end", "def update!(**args)\n @device_id = args[:device_id] if args.key?(:device_id)\n @device_targeting_features = args[:device_targeting_features] if args.key?(:device_targeting_features)\n @device_targeting_labels = args[:device_targeting_labels] if args.key?(:device_targeting_labels)\n @surface_identity = args[:surface_identity] if args.key?(:surface_identity)\n end", "def setupDevice(devtype,param) \n case devtype\n when 'gtk', :gtk\n @device = MyCanvasGtk.new(param) ;\n## when 'gtk2'\n## @device = MyCanvasGtk2.new(param) ;\n when 'tgif', :tgif\n @device = MyCanvasTgif.new(param) ;\n when 'tk', :tk\n @device = MyCanvasTk.new(param) ;\n else\n $stderr.printf(\"Error:unknown device type : %s\\n\",devtype.to_s) ;\n fail ;\n end\n end", "def source_pts; end", "def generate_serial_number_mac_address_mappings(pool)\n start_serial_number = pool.starting_serial_number\n start_mac_address = pool.starting_mac_address\n \n #generate array (serial_numbers), one serial number per row based on size of pool\n serial_numbers = []\n last_serial_number = get_last_serial_number(pool) + 1 \n (0..pool.size-1).each do |i| \n num = i + last_serial_number\n serial_numbers << get_serial_number(pool, num)\n end\n \n #generate array (mac_addresses), one mac address per row based on size of pool\n mac_addresses = []\n last_mac_address = 0\n if is_zigbee?(pool) || is_gateway?(pool) #checks device_type.mac_address_type (zigbee = 0, gateway = 1)\n last_mac_address = get_last_mac_address(pool) + 1\n end\n \n (0..pool.size-1).each do |i|\n num = i + last_mac_address\n if is_zigbee?(pool) || is_gateway?(pool)\n mac_addresses << get_mac_address(pool, num)\n else\n mac_addresses << ''\n end\n end\n \n #add a new device for each row in the pool and save the pool\n Device.transaction do\n (0..pool.size-1).each do |i|\n device = Device.new(:active => false, :pool_id => pool.id, :serial_number => serial_numbers[i], :mac_address => mac_addresses[i])\n device.save!\n end\n pool.ending_serial_number = serial_numbers[pool.size - 1]\n pool.ending_mac_address = mac_addresses[pool.size - 1]\n pool.save!\n end\n end", "def prepare_device_change(network_info, vsphere_env,\n provider_config, template)\n vm_nics = \\\n template.config.hardware.device.grep(VIM::VirtualEthernetCard)\n\n # NICs have :index values starting with 1, not 0. So we\n # subtract 1 to get to the 0-based indexing logic.\n config_nics = \\\n Hash[ provider_config.nics.map { |index, n| [index - 1, n] } ]\n\n deviceChange = []\n\n vm_nics.map.with_index { |vm_nic, index|\n edit_network_card(network_info, vm_nic, config_nics[index])\n }.compact.each do |edit_spec|\n deviceChange << edit_spec\n end\n\n # If there are more nics configured than there are actual nics\n # add the missing ones.\n\n max_index = provider_config.nics.keys.max\n add_last_index = max_index.nil? ? 0 : max_index - 1\n\n (vm_nics.length .. add_last_index).map { |index|\n add_network_card(network_info, vsphere_env, config_nics[index])\n }.compact.each do |add_spec|\n deviceChange << add_spec\n end\n\n deviceChange\n end", "def devices(type = Device::Type::ALL)\n ptr1 = MemoryPointer::new(:cl_uint , 1)\n error = OpenCL.clGetDeviceIDs(self, type, 0, nil, ptr1)\n error_check(error)\n ptr2 = MemoryPointer::new(:pointer, ptr1.read_uint)\n error = OpenCL.clGetDeviceIDs(self, type, ptr1.read_uint(), ptr2, nil)\n error_check(error)\n return ptr2.get_array_of_pointer(0, ptr1.read_uint()).collect { |device_ptr|\n Device::new(device_ptr, false)\n }\n end", "def add_pointer_input(kind, name); end", "def createEntryBlockAlloca(theFunction, varName)\n# IRBuilder<> TmpB(TheFunction.getEntryBlock, TheFunction.getEntryBlock.begin )\n# return TmpB.CreateAlloca(Type::getDoubleTy(getGlobalContext()), 0, VarName)\n end", "def eth_gpu_rst; eth_ctrl_bit(5); end", "def GenPad(x1, y1, x2, y2, name, number, flags)\n if x1 > x2\n x1, x2 = x2, x1\n end\n if y1 > y2\n y1, y2 = y2, y1\n end\n if (x2 - x1) > (y2 - y1)\n thickness = (y2 - y1)\n y1 = y2 = (y1 + y2) / 2.0 # same value, no eps\n x1 += thickness / 2.0\n x2 -= thickness / 2.0\n else\n thickness = (x2 - x1)\n x1 = x2 = (x1 + x2) / 2.0\n y1 += thickness / 2.0\n y2 -= thickness / 2.0\n end\n PcbSmartPad(x1, y1, x2, y2, thickness, name, number, flags)\nend", "def ptr\r\n if embedded?\r\n @arr.as.ary\r\n else\r\n @arr.as.heap.ptr\r\n end\r\n end", "def make(input = T.unsafe(nil), opts = T.unsafe(nil), &blk); end", "def make(input = T.unsafe(nil), opts = T.unsafe(nil), &blk); end", "def createArgumentAllocas(function , builder)\n function.params.each do |param|\n alloc = builder.alloca param\n builder.store param , alloc\n # Add arguments to variable symbol table.\n ExprAST.named_values[param.name] = alloc\n #puts \"Alloca #{param.name} = #{alloc}\"\n end\n end", "def profilerMallocRamBuffer(size=ProfilerControl::DEFAULT_BUFFER_SIZE, connection=$CURRENTCONNECTION)\n\n CRVERBOSE(\"Malloc Profiling Ram Buffer\", 2)\n\n myCon = CHEmptyConnection.new()\n sxsConnection = CHEmptyConnection.new()\n\n if (ProfilerControl::bufferAddress != 0)\n # Buffer already allocated.\n raise MultiProfilerExceptionBufferAlreadyAllocated, \"Ram buffer already allocated at:%0x8\" % [ProfilerControl::bufferAddress]\n end\n\n # Duplicate connection.\n myCon = connection.copyConnection()\n myCon.open(false)\n\n \tsxsConnection = CHBPConnection.new(myCon, [SXS_RPC_RMC, SXS_RPC_RSP_RMC])\n \tsxsConnection.open(false)\n \n\n if (codeIsNotCrashed(myCon))\n # Get and check malloc function.\n mallocFunctionAddress = $map_table.>(myCon).hal_access.>(myCon).profileControl.mallocRamBuffer.read(myCon)\n if (mallocFunctionAddress == 0)\n raise MultiProfilerExceptionUnsupportedEmbeddedCode, \"Embedded Code not compiled with the necessary flags. See http://atlas/twiki/bin/view/CoolWiki/MultiProfilerPlugin#Usage\"\n end\n\n # Allocate buffer remotely.\n sxsExecute(sxsConnection,\n \t\t\t\tmallocFunctionAddress,\n \t\t\t\tSXS_RPC_RETURN_VALUE,\n \t\t\t\t[SXS_RPC_VALUE_PARAM,SXS_RPC_NO_PARAM,SXS_RPC_NO_PARAM,SXS_RPC_NO_PARAM],\n \t\t\t\t[size].from32to8bits)\n else\n raise MultiProfilerExceptionSystemCrashed, \"Embedded System Crashed, cannot profile it.\"\n end\n \n # Hypothesis: Malloc succeeded\n ProfilerControl::bufferAddress = sxsWaitExecuteResult(sxsConnection, 8.0)\n ProfilerControl::bufferSize = size if (ProfilerControl::bufferAddress() != 0)\n\n\nensure\n sxsConnection.close()\n myCon.close()\nend", "def viewport\n viewport_offset.merge(viewport_size)\n end", "def addbinding(ctx, x, bind)\n [[x, bind]] + ctx\nend", "def pointer_size\n is_64bit ? 8 : 4\n end", "def set_bitmap_position\n end", "def assoc(p0) nil end", "def set(value, size = nil)\n if value.class == SVMPointer and @kernel.context.platform.version_number >= 2.0 then\n OpenCL.set_kernel_arg_svm_pointer( @kernel, @index, value )\n else\n OpenCL.set_kernel_arg(@kernel, @index, value, size)\n end\n end", "def set(value, size = nil)\n if value.class == SVMPointer and @kernel.context.platform.version_number >= 2.0 then\n OpenCL.set_kernel_arg_svm_pointer( @kernel, @index, value )\n else\n OpenCL.set_kernel_arg(@kernel, @index, value, size)\n end\n end", "def allow_gpu_acceleration\n\n # Turn off X\n execute \"Turn off X\" do\n command \"systemctl set-default multi-user.target\"\n end\n\n # Update the xorg.conf to set up NVIDIA drivers.\n # NOTE: --enable-all-gpus parameter is needed to support servers with more than one NVIDIA GPU.\n execute \"Set up Nvidia drivers for X configuration\" do\n user 'root'\n command \"nvidia-xconfig --preserve-busid --enable-all-gpus\"\n end\n\n # dcvgl package must be installed after NVIDIA and before starting up X\n dcv_gl = \"#{node['cfncluster']['sources_dir']}/#{node['cfncluster']['dcv']['package']}/#{node['cfncluster']['dcv']['gl']}\"\n package dcv_gl do\n action :install\n source dcv_gl\n end\n\n # Configure the X server to start automatically when the Linux server boots and start the X server in background\n bash 'Launch X' do\n user 'root'\n code <<-SETUPX\n systemctl set-default graphical.target\n systemctl isolate graphical.target &\n SETUPX\n end\n\n # Verify that the X server is running\n execute 'Wait for X to start' do\n user 'root'\n command \"pidof X || pidof Xorg\"\n retries 5\n retry_delay 5\n end\nend", "def set_custom_functions(input_funcs)\n @funcs_ptr = FFI::MemoryPointer.new(SassC::Lib::SassCFunctionDescriptor, input_funcs.count)\n @gc_staph = []\n\n input_funcs.each.with_index do |(signature, block), i|\n fn = SassC::Lib::SassCFunctionDescriptor.new(@funcs_ptr + i * SassC::Lib::SassCFunctionDescriptor.size)\n\n str = FFI::MemoryPointer.from_string(signature)\n fn[:signature] = str\n \n func = FFI::Function.new(SassC::Lib::SassValue.by_value, [SassC::Lib::SassValue.by_value, :pointer]) do |arg, cookie|\n ruby_arg = arg.to_ruby \n ruby_result = block.call(ruby_arg)\n SassC::Lib::SassValue.new.from_ruby(ruby_result) \n end\n fn[:function] = func\n\n @gc_staph << func\n @gc_staph << str\n end\n\n self[:c_functions] = @funcs_ptr\n self[:num_c_functions] = input_funcs.size \n end", "def mem=(p0) end", "def generate_block_devices(instance_type, environment, application, clone_host = nil)\n block_device_mappings = {}\n\n build_ephemeral_drives(block_device_mappings, instance_type)\n build_ebs_volumes(block_device_mappings, application.block_devices)\n clone_volumes(block_device_mappings, application, clone_host)\n\n block_device_mappings\n end", "def syscall_alloc(sz); ptr(Ragweed::Wrap32::virtual_alloc_ex(@h, sz)); end", "def adjust(begin_pos: T.unsafe(nil), end_pos: T.unsafe(nil)); end", "def adjust(begin_pos: T.unsafe(nil), end_pos: T.unsafe(nil)); end", "def adjust(begin_pos: T.unsafe(nil), end_pos: T.unsafe(nil)); end", "def attach_volumes(node, disk_sizes)\n if $provider == :virtualbox\n node.vm.provider :virtualbox do |v, override|\n disk_num = 0\n disk_sizes.each do |disk_size|\n disk_num += 1\n diskname = File.join(File.dirname(File.expand_path(__FILE__)), \".virtualbox\", \"#{node.vm.hostname}-#{disk_num}.vdi\")\n unless File.exist?(diskname)\n v.customize ['createhd', '--filename', diskname, '--size', disk_size * 1024]\n end\n v.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', disk_num, '--device', 0, '--type', 'hdd', '--medium', diskname]\n end\n end\n end\n\n if $provider == :vmware_fusion\n node.vm.provider :vmware_fusion do |v, override|\n vdiskmanager = '/Applications/VMware\\ Fusion.app/Contents/Library/vmware-vdiskmanager'\n unless File.exist?(vdiskmanager)\n dir = File.join(File.dirname(File.expand_path(__FILE__)), \".vmware\")\n unless File.directory?( dir )\n Dir.mkdir dir\n end\n\n disk_num = 0\n disk_sizes.each do |disk_size|\n disk_num += 1\n diskname = File.join(dir, \"#{node.vm.hostname}-#{disk_num}.vmdk\")\n unless File.exist?(diskname)\n `#{vdiskmanager} -c -s #{disk_size}GB -a lsilogic -t 1 #{diskname}`\n end\n\n v.vmx[\"scsi0:#{disk_num}.filename\"] = diskname\n v.vmx[\"scsi0:#{disk_num}.present\"] = 'TRUE'\n v.vmx[\"scsi0:#{disk_num}.redo\"] = ''\n end\n end\n end\n end\n\n if $provider == :parallels\n node.vm.provider :parallels do |v, override|\n disk_sizes.each do |disk_size|\n v.customize ['set', :id, '--device-add', 'hdd', '--size', disk_size * 1024]\n end\n end\n end\n\nend", "def pointers_to(src, dst, opts={})\r\n refresh opts\r\n ret = {}\r\n range = ((opts[:range_start] || @memlist[dst][0])..(opts[:range_stop] || @memlist[dst][0]+@memlist[dst][1]))\r\n scan(src, opts) do |block, soff|\r\n 0.stepwith(block.size, 4) do |off, len|\r\n if len == 4\r\n if range.member? block[off,4].to_l32\r\n ret[soff + off] = block[off,4].to_l32\r\n end\r\n end\r\n end\r\n end\r\n return ret\r\n end", "def print_pointer_location(ptr, t)\n if t.respond_to? :get_area_memlocation\n page_number = (ptr.size.to_f / $page_size).ceil\n base_address = ptr.address - ( ptr.address % $page_size )\n ptrs = page_number.times.collect { |i|\n FFI::Pointer::new(base_address + i*$page_size).slice(0, $page_size)\n }\n ptrs.each { |ptr|\n p t.get_area_memlocation(ptr, :MEMBIND_BYNODESET)\n }\n else\n puts \"pagemap #{Process::pid} -n #{ptr.address.to_s(16)}-#{(ptr.address+ptr.size-1).to_s(16)}\"\n puts `pagemap #{Process::pid} -n #{ptr.address.to_s(16)}-#{(ptr.address+ptr.size-1).to_s(16)}`\n end\nend", "def create_graphics\n create_viewport\n end", "def attach\n exec \"#{Tmux::BINARY} attach -t #{identifier}\"\n end", "def warmup(prc = T.unsafe(nil), &block); end", "def mda(width, height) \n return Array.new(width){ Array.new(height) }\nend", "def setup\n size 200, 200\n @a = load_image 'construct.jpg'\n @b = load_image 'wash.jpg'\n @offset = 0.0\nend", "def create_main_viewport\n @viewport1 = Viewport.new(0, 0, Graphics.width, Graphics.height)\n @viewport1.z = 1\n end", "def postproc; end", "def gen_get_block_ptr(recklass, info, blk, b, context)\r\n blab = (info[1].to_s + '+blk+' + blk[1].to_s).to_sym\r\n minfo = MethodDefinition::RubyMethod[blab][recklass]\r\n\r\n func2 = minfo[:func]\r\n if func2 == nil then\r\n argtype = minfo[:argtype].map {|ele|\r\n ele.type.llvm\r\n }\r\n rett = minfo[:rettype]\r\n rettllvm = rett.type\r\n if rettllvm == nil then\r\n rettllvm = VALUE\r\n else\r\n rettllvm = rettllvm.llvm\r\n end\r\n ftype = Type.function(rettllvm, argtype)\r\n func2 = context.builder.get_or_insert_function(recklass, blab.to_s, ftype)\r\n end\r\n context.rc = b.ptr_to_int(func2, MACHINE_WORD)\r\n context\r\n end", "def dot(a, b)\n a = NArray.asarray(a)\n b = NArray.asarray(b)\n case a.ndim\n when 1\n case b.ndim\n when 1\n func = blas_char(a, b) =~ /c|z/ ? :dotu : :dot\n Blas.call(func, a, b)\n else\n if b.contiguous?\n trans = 't'\n else\n if b.fortran_contiguous?\n trans = 'n'\n b = b.transpose\n else\n trans = 't'\n b = b.dup\n end\n end\n Blas.call(:gemv, b, a, trans:trans)\n end\n else\n case b.ndim\n when 1\n if a.contiguous?\n trans = 'n'\n else\n if a.fortran_contiguous?\n trans = 't'\n a = a.transpose\n else\n trans = 'n'\n a = a.dup\n end\n end\n Blas.call(:gemv, a, b, trans:trans)\n else\n if a.contiguous?\n transa = 'n'\n else\n if a.fortran_contiguous?\n transa = 't'\n a = a.transpose\n else\n transa = 'n'\n a = a.dup\n end\n end\n if b.contiguous?\n transb = 'n'\n else\n if b.fortran_contiguous?\n transb='t'\n b = b.transpose\n else\n transb='n'\n b = b.dup\n end\n end\n Blas.call(:gemm, a, b, transa:transa, transb:transb)\n end\n end\n end", "def points_in_one_dim(&block)\n @tables.map do |table|\n table.map do |point|\n yield point\n end\n end\n end", "def allocate(parts); end", "def vm_allocate(task, address, size, anywhere)\n addr = int_to_intptr(address)\n anywhere = anywhere ? 1 : 0\n r = CALLS[\"libc!vm_allocate:IPII=I\"].call(task,addr,size,anywhere).first\n raise KernelCallError.new(r) if r != 0\n addr.ptr\n end", "def PcbSmartPad(x1, y1, x2, y2, thickness, name, number, flags)\n clearance = GetDim('clearance') * 2\n mask = GetDim('mask') * 2 + thickness\n PcbPad(x1, y1, x2, y2, thickness, clearance, mask, name, number, flags)\nend", "def nn\n end", "def setup_forwarded_ports(config, forwarded_ports)\n forwarded_ports.each do |forward_port|\n config.vm.network :forwarded_port, host: forward_port, guest: forward_port\n end\nend", "def gep2(type, ptr, indices, name)\n must_be_value!(ptr)\n\n type ||= must_infer_type!(ptr)\n must_be_type!(type)\n\n indices = Array(indices)\n FFI::MemoryPointer.new(FFI.type_size(:pointer) * indices.size) do |indices_ptr|\n indices_ptr.write_array_of_pointer(indices)\n ins = C.build_gep2(self, type, ptr, indices_ptr, indices.size, name)\n return Instruction.from_ptr(ins)\n end\n end", "def attachTo _obj, _args\n \"_obj attachTo _args;\" \n end", "def broadcasting_for(model); end", "def create_viewport\n @viewport = Viewport.create(:main, @message_window.z - 1)\n @viewport.extend(Viewport::WithToneAndColors)\n @viewport.shader = Shader.create(:map_shader)\n end", "def initialize(data=[], shape:nil, dtype: nil, device:Device.new(:numo)) # TODO: Refactor this method.\n shape ||= Shape.new()\n if data\n if data.is_a?(Array)\n data_arr = Numo::NArray[*data]\n predicted_type = DataTypes::Float64\n if data.flatten[0].is_a?(Integer)\n predicted_type = DataTypes::Int64\n elsif data.flatten[0].is_a?(Float)\n predicted_type = DataTypes::Float64\n elsif data.flatten[0].is_a?(Complex)\n predicted_type = DataTypes::Complex128\n else\n predicted_type = DataTypes::RObject\n end\n @dtype ||= predicted_type\n data = @dtype.get_dtype_on_device(device).cast(data_arr)\n @shape = shape || Shape.new(*data.shape)\n elsif data.is_a?(Numeric)\n predicted_type = DataTypes::RObject\n if data.is_a?(Integer)\n predicted_type = DataTypes::Int64\n elsif data.is_a?(Float)\n predicted_type = DataTypes::Float64\n elsif data.is_a?(Complex)\n predicted_type = DataTypes::Complex128\n end\n xmo_type = predicted_type.get_dtype_on_device(device)\n data = xmo_type[data]\n device = device\n elsif data.is_a?(Numo::NArray)\n @dtype ||= DataTypes::from_numo_dtype(data.class)\n elsif data.is_a?(Tensor)\n data = data.data\n else\n raise TypeError, \"#{data.class} is cannot convert to tensor. data must be Array or Numo::NArray.\"\n end\n @device = device\n @data = data\n @shape ||= Shape.new(*data.shape.to_a)\n @dtype ||= DataTypes::from_numo_dtype(data.class)\n else\n @device = device\n @shape = shape\n @dtype ||= DataTypes::RObject\n @data = @dtype.get_dtype_on_device(@device).zeros(*@shape.to_a)\n end\n @grad_function = nil\n @grad_tensor = nil\n @requires_grad = false\n return Functions::Constant.new.call(self)\n end", "def install\n args = std_cmake_args + %w[\n -DRTK_USE_CUDA=OFF\n -DRTK_USE_OPENCL=ON\n ]\n\n args.delete '-DCMAKE_BUILD_TYPE=None'\n args << '-DCMAKE_BUILD_TYPE=Release'\n\n mkdir 'build' do\n system \"cmake\", \"..\", *args\n system \"make install\"\n end\n end", "def attach(pid)\n MemoryIO::Process.new(pid)\n end", "def allocate_handles()\n #This is a stub, used for indexing\n end", "def jit(pointer, pmodes)\n args = get_parameters(pointer, pmodes)\n return args[1] unless args[0].zero?\n\n pointer + 3\n end", "def gep(ptr, *indices)\n ptr = Convert(ptr, :pointer)\n type = ptr.type.element_type\n type = type.element_type while type == :pointer\n struct = LLVM::Script::Struct[type]\n indices.flatten!\n indices.unshift(0) if indices[0].is_a?(String) || indices[0].is_a?(Symbol) \n indices = indices.map{ |idx| idx.is_a?(String) || idx.is_a?(Symbol) ? struct.index(idx) : idx }\n @builder.gep(ptr, indices.flatten.map{|idx| Convert(idx, :integer)})\n end", "def devices; end", "def initialize(bridge, devices: T.unsafe(nil), async: T.unsafe(nil), duration: T.unsafe(nil)); end", "def to_megapixel(**options) = convert_to('megapixel', **options)", "def scroll_to(element, device: T.unsafe(nil)); end" ]
[ "0.5572456", "0.5295591", "0.52067196", "0.5107961", "0.48958468", "0.47258863", "0.46983442", "0.46916234", "0.46669888", "0.45319483", "0.4461606", "0.4417411", "0.4414394", "0.4403324", "0.4380201", "0.43618035", "0.43106952", "0.42903173", "0.42824343", "0.42774197", "0.4191477", "0.41908342", "0.41754025", "0.41385415", "0.41078317", "0.40986854", "0.4093225", "0.40829125", "0.40702155", "0.40616426", "0.40280485", "0.40229997", "0.40135017", "0.4011789", "0.40055397", "0.40048528", "0.39987615", "0.39970076", "0.39889404", "0.39882532", "0.39870736", "0.3979301", "0.3972659", "0.39709547", "0.39687717", "0.39640704", "0.39602685", "0.39452326", "0.39211667", "0.3912251", "0.3912251", "0.38882682", "0.38823918", "0.38762012", "0.387422", "0.38735783", "0.38641447", "0.3858066", "0.38555694", "0.38555694", "0.38463214", "0.38439158", "0.38428533", "0.38398957", "0.38284245", "0.38278192", "0.38278192", "0.38278192", "0.38008174", "0.3799889", "0.3785219", "0.3781582", "0.377269", "0.37712824", "0.3769939", "0.37660772", "0.37635222", "0.37632537", "0.37631035", "0.376289", "0.37607983", "0.37518957", "0.37473798", "0.3745962", "0.37457895", "0.37418514", "0.37306052", "0.37236086", "0.3723235", "0.3722859", "0.3711952", "0.37091637", "0.3703509", "0.37025917", "0.3700999", "0.369934", "0.3698508", "0.36932507", "0.36893955", "0.36867395" ]
0.65973806
0
Pop whatever is on queue
def pop_from_queue(queue) prioritized?(queue) ? z_pop_from_queue(queue) : super end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pop()\n @queue.shift\n end", "def dequeue; @queue.pop end", "def pop()\n res = @pop_queue.shift()\n return res\n end", "def pop\n @lock.synchronize do\n @queue.pop\n end\n end", "def pop()\n @size -= 1 \n @queue.shift\n end", "def pop()\n @q.shift\n end", "def remove\n @queue.shift\n end", "def remove\n @queue.pop\n end", "def remove\n @queue.shift\n end", "def remove\n @queue.shift\n end", "def pop\n if @queue.empty?\n nil\n else\n tempArr = []\n while @queue.size > 1\n tempArr.push(@queue.remove)\n end\n tempItem = @queue.remove\n while !tempArr.empty?\n @queue.insert(tempArr.pop)\n end\n tempItem\n end\n end", "def pop()\n new_queue = Queue.new\n until @queue.size == 1\n new_queue << @queue.pop\n end\n last = @queue.pop\n @queue = new_queue\n last\n end", "def dequeue\n @queue.shift\n end", "def dequeue\n\t\[email protected]\n\tend", "def pop() end", "def pop\n if @q.empty?\n raise QueueEmptyError, \"tried to pop empty queue in #{@component.inspect}\"\n end\n obj = @q.shift\n @component.dec_queue_ready_count if @q.empty?\n obj\n end", "def pop\n if empty?\n nil\n else\n @q.remove\n @stack.shift\n end\n end", "def dequeue\n @q.shift\n end", "def dequeue\n\t\t\tself.pop\n\t\tend", "def pop\n @mutex.synchronize do\n loop do\n if @queue.empty?\n @waiting.push Thread.current\n @mutex.sleep\n else\n return @queue.shift\n end\n end\n end\n end", "def pop()\n if @queue_out.size == 0 \n if @queue_in.size == 0 \n return \n end\n \n while @queue_in.size > 0 \n @queue_out.push(@queue_in.pop)\n end\n end\n \n @size -= 1\n return @queue_out.pop\n end", "def pop\n entry = queue.pop[:payload]\n if (entry != :queue_empty)\n Marshal.load(entry)\n else\n nil\n end\n end", "def pop &use\n #Thread.pass while self.empty?\n sleep 0.01 while self.empty?\n self.pop! &use\n end", "def pop()\n if @queue_out.size == 0\n if @queue_in.size == 0\n return\n end\n\n while @queue_in.size > 0\n @queue_out.push(@queue_in.pop)\n end\n end\n\n @size -= 1\n return @queue_out.pop\n end", "def pop\n _exchange\n end", "def pop\n return nil if empty?\n @que.pop\n end", "def pop\n raise \"Abstract queue cannot return objects\"\n end", "def dequeue\n remove_elements_to_stack if @out.empty?\n @out.pop\n end", "def pop!\n @mutex.synchronize do\n loop do\n if @queue.empty?\n raise ThreadError, \"Empty Channel\"\n @waiting.push Thread.current\n @mutex.sleep\n else\n return @queue.shift\n end\n end\n end\n end", "def peek; @queue[-1] end", "def remove\n if empty?\n raise \"Can't remove if queue is empty\"\n else\n @info.shift\n end\n end", "def remove\n if empty?\n raise \"Can't remove if queue is empty\"\n else\n @info.shift\n end\n end", "def remove\n if empty?\n raise \"Can't remove if queue is empty\"\n else\n @info.shift\n end\n end", "def pull_queue_pull\n return nil if self.pull_queue_names.length == 0\n \n puts \"pulling from queues #{self.pull_queue_names.join ', '}\"\n \n elt = nil\n elt = @redis.brpop(self.pull_queue_names, self.queue_wait_seconds) while elt == nil\n \n key = elt[0]\n val = elt[1]\n self.debug_out \"got data from pull queue #{key}\"\n Marshal.load val\n end", "def pop\n val = []\n @queue_mutex.synchronize do\n val = @memory_queue.pop\n end\n val\n end", "def pop\n\t\treturn nil if @q1.empty?\n\t\[email protected] # Dequeue element from queue and return the same \n\tend", "def dequeue\n @store.pop\n end", "def pop_notification\n notification_queue.shift\n end", "def dequeue\n last_el = self.queue_var[-1]\n self.queue_var = self.queue_var[0...-1]\n last_el \n end", "def pop; end", "def pop; end", "def pop; end", "def pop; end", "def pop; end", "def unpop obj\n was_empty = @q.empty?\n case obj\n when SimultaneousQueueEntries\n case obj.size\n when 0\n was_empty = false # just to prevent the inc\n when 1\n @q.unshift obj.first\n else\n @q.unshift obj\n end\n else\n @q.unshift obj\n end\n @component.inc_queue_ready_count if was_empty\n end", "def pop\n while true\n message = @queue.pop\n return YAML::load(message.to_s) unless message.nil?\n sleep 5\n end\n end", "def pop\n until @queue_1.size == 1\n @queue_2 << @queue_1.shift\n end\n\n # popped_element = @queue_1.shift\n # @queue_1 = @queue_2\n # @queue_2 = []\n # popped_element\n\n # ..is the same as..\n\n # q1 has 1 el, q2 has the rest. we want q2 empty, q1 full - last\n @queue_1, @queue_2 = @queue_2, @queue_1\n @queue_2.shift\n end", "def dequeue\n @items.shift\n end", "def dequeue\n @data.shift\n end", "def pop_from_restriction_queue(tracking_key, queue)\n queue_key = restriction_queue_key(tracking_key, queue)\n str = Resque.redis.lpop(queue_key)\n post_pop_size = Resque.redis.llen(queue_key)\n\n if post_pop_size == 0\n update_queues_available(tracking_key, queue, :remove)\n clear_runnable(tracking_key, queue)\n end\n\n decrement_queue_count(queue)\n\n # increment by one to indicate that we are running\n increment_running_count(tracking_key) if str\n\n decode(str)\n end", "def dequeue\n if @push_ptr\n if @pop_ptr\n object_ = @buffer[@pop_ptr]\n @buffer[@pop_ptr] = nil\n @pop_ptr += 1\n @pop_ptr = 0 if @pop_ptr == @buffer.size\n @pop_ptr = nil if @pop_ptr == @push_ptr\n object_\n else\n nil\n end\n else\n @buffer.shift\n end\n end", "def dequeue\n @store.shift\n end", "def pop\n @queue.pop(true)\n rescue ThreadError\n if closed?\n raise ClosedQueue if @raise_exception.true?\n return nil\n else\n sleep\n retry\n end\n end", "def pop\r\n ret = peek\r\n @buffer = nil\r\n ret\r\n end", "def pop\n peek\n\n @out.pop\n end", "def pop()\n \n end", "def pop()\n \n end", "def pop()\n \n end", "def remove\n raise QueueUnderflow if empty?\n result = @info.shift\n changed\n notify_observers(self, :remove, result)\n result\n end", "def pop()\n @stack.pop \n end", "def peek \n self.queue_var[-1]\n end", "def pop(options = {})\n @api_adapter.pop_from_queue(self.name, options)\n end", "def peek()\n if @queue_out.size == 0 \n if @queue_in.size == 0 \n return \n end\n \n while @queue_in.size > 0 \n @queue_out.push(@queue_in.pop)\n end\n end\n \n return @queue_out.last\n end", "def pop\n end", "def remove_from_queue\n if in_queue?\n decrement_queue_positions_on_lower_items\n update_attribute queue_position_column, nil\n end\n end", "def dequeue\n end", "def pop\r\n # IMPLEMENT ME\r\n end", "def pop()\n\t\[email protected]\n\tend", "def pop()\n @stack.pop\n end", "def pop()\n @stack.pop\n end", "def pop(*args)\n retval = super\n @mutex.synchronize {\n if @que.length < @max\n begin\n t = @queue_wait.shift\n t.wakeup if t\n rescue ThreadError\n retry\n end\n end\n }\n retval\n end", "def pop(*args)\n retval = super\n @mutex.synchronize {\n if @que.length < @max\n begin\n t = @queue_wait.shift\n t.wakeup if t\n rescue ThreadError\n retry\n end\n end\n }\n retval\n end", "def deq\n @queued = false\n nil\n end", "def pop(non_block=false)\n @mutex.synchronize{\n while true\n if @que.empty?\n raise ThreadError, \"queue empty\" if non_block\n @waiting.push Thread.current\n @mutex.sleep\n else\n return @que.shift\n end\n end\n }\n end", "def pop()\n @stack.pop\n end", "def dequeue\n # check if queue is empty \n raise ArgumentError, \"Queue is empty\" if self.empty? \n \n element = @store[@front]\n \n # check last element removed\n if (@front == @back)\n @front = @back = -1 \n elsif @front + 1 == MAX_BUFFER\n @front = 0\n # nominal case\n else\n @front += 1\n end\n\n return element\n end", "def dequeue\n\t\treturn nil if @s1.empty?\n\t\[email protected] # Pop element from stack and return the same\n\tend", "def next_event\n @queue.pop\n end", "def last_pop\n @api_adapter.last_pop_from_queue(self.name)\n end", "def pop()\n @stack.shift\n end", "def dequeue\n @items.delete_at(0)\n end", "def pop()\n @data.pop\n end", "def pop\n\t\[email protected] do\n\t\t\[email protected]\n\t\tend\n\tend", "def pour_out\n @queue.deq\n end", "def pop\n delete_at(0)\n end", "def pop()\n head_index = get_document(@head_index_key)\n tail_index = get_document(@tail_index_key)\n if tail_index > head_index # if there is an item in the queue\n increase_atomic_count(@head_index_key) #incremented new_head_index is ignored, but we are incrementing and popping value\n return get_document(\"#{@key}::#{head_index + 1}\")\n else # \n nil\n end\n end", "def pop()\n last = nil\n @q1.size.times do\n last = @q1.shift\n @q2.push last\n end\n (@q2.size-1).times do \n @q1.push(@q2.shift)\n end\n @q2.shift\n last\n end", "def pop\n @stack.pop\n end", "def pop\n @stack.pop\n end", "def pop()\n stack.stack.pop if !empty?\n end", "def dequeue\n return nil if self.empty?\n return @dequeue_stack.pop if !@dequeue_stack.empty?\n until @enqueue_stack.empty?\n @dequeue_stack.push(@enqueue_stack.pop)\n end\n @dequeue_stack.pop\n end", "def dequeue\n return nil if self.empty?\n return @dequeue_stack.pop if !@dequeue_stack.empty?\n until @enqueue_stack.empty?\n @dequeue_stack.push(@enqueue_stack.pop)\n end\n @dequeue_stack.pop\n end", "def pop\n stack.pop\n end", "def pop\n stack.pop\n end", "def receive(id)\n @queues[id].pop\n end", "def pop(non_block=false)\n @mutex.synchronize{\n while true\n if @que.empty?\n raise ThreadError, \"queue empty\" if non_block\n @waiting.push Thread.current\n @mutex.sleep\n else\n return @que.pop[0]\n end\n end\n }\n end", "def pop(queue)\n job = Resque.reserve(queue)\n [job.payload_class, job.args] if job \n end", "def pop(queue)\n job = Resque.reserve(queue)\n [job.payload_class, job.args] if job \n end", "def pop\n @stack.pop\n end", "def pop\n @a.pop\n end" ]
[ "0.8933662", "0.89276385", "0.8645964", "0.8628593", "0.84859085", "0.838032", "0.83730185", "0.83674884", "0.83536345", "0.8337667", "0.8333567", "0.8318516", "0.8231321", "0.82159853", "0.81657517", "0.813559", "0.8089793", "0.8015996", "0.8014671", "0.8012965", "0.8000831", "0.79921836", "0.7962008", "0.79494804", "0.78872377", "0.7876421", "0.78342557", "0.78332525", "0.782092", "0.7818607", "0.7814428", "0.7814428", "0.7814428", "0.78060573", "0.77879524", "0.77810186", "0.77756673", "0.776455", "0.77585304", "0.7739225", "0.7739225", "0.7739225", "0.7739225", "0.7739225", "0.773822", "0.7708748", "0.76855564", "0.76668036", "0.7645907", "0.7535425", "0.7525289", "0.75076175", "0.74957705", "0.7486499", "0.7477828", "0.7469645", "0.7469645", "0.7469645", "0.74270946", "0.7407292", "0.7392987", "0.736986", "0.7349504", "0.7347559", "0.7343681", "0.73412836", "0.7336302", "0.73299634", "0.7327513", "0.7323063", "0.73087865", "0.73087865", "0.7307855", "0.7301983", "0.7301229", "0.72872466", "0.72819054", "0.72814417", "0.72757006", "0.72697896", "0.72650015", "0.72596574", "0.7250217", "0.72417986", "0.72191167", "0.7210115", "0.7205471", "0.71970373", "0.71970373", "0.71944696", "0.7185371", "0.7185371", "0.71794087", "0.71794087", "0.71631795", "0.7163121", "0.7152406", "0.7152406", "0.71423084", "0.71350527" ]
0.7772736
37
Get the number of items in the queue
def queue_size(queue) prioritized?(queue) ? z_queue_size(queue) : super end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def queue_count()\n @queue.length\n end", "def count\n\t\[email protected]\n\tend", "def queue_count\n @queues.length\n end", "def size\n\n @queue.size\n end", "def length\n @queue.length\n end", "def length\n @queue.length\n end", "def size\n @queue.size\n end", "def size\n @queue.size\n end", "def size\n @queue.size\n end", "def queue_length\n @queues.inject(0) do |length, (_, queue)|\n length + queue.length\n end\n end", "def size\n @mutex.synchronize { @queue.size }\n end", "def queued_messages\n @queue.length\n end", "def size\n @queue.size\n end", "def sub_queue_count\n sub_queue_obj.count\n end", "def queue_count()\n cnt = 0\n @flows.each_value { |f| cnt += f.queue_count() }\n cnt\n end", "def queue_count()\n cnt = 0\n @tasks.each_value { |task| cnt += task.queue_count() }\n cnt\n end", "def size\n self.queued.inject(0) { |result, data| result + data.last.size }\n end", "def queued_messages\n @queue.length\n end", "def queue_length\n mutex.synchronize { running? ? @queue.length : 666 }\n end", "def size\n\t\t\[email protected] + @queue.size\n\t\tend", "def count\r\n items.size\r\n end", "def queue_size\n @redis.llen(\"xque:queue:#{@queue_name}\")\n end", "def message_count\n get_queue_message_count(address)\n end", "def queue_count()\n @work_queue.size + super()\n end", "def queue_length\n request_queue.length\n end", "def queue_length\n @executor.getQueue.size\n end", "def total_count(queue)\n collection.find(conditions(queue)).count\n end", "def waitlist_size\n @queue.size\n end", "def count_items\n @items.size\n end", "def queue_size(queue)\n Resque.size(queue)\n end", "def z_queue_size(queue)\n handle_pipeline(@redis.zcount(redis_key_for_queue(queue), 0, Float::INFINITY), &:to_i)\n end", "def queue_length\n @job_queue.length\n end", "def size\n @items.count\n end", "def size\n @items.count\n end", "def item_count\n @items.length\n end", "def message_count(queue)\n connect do |bunny|\n return bunny.queue(queue, :durable => true, :auto_delete => false).message_count\n end\n end", "def size\n return @items.size\n end", "def size\n return @items.length\n end", "def size\n return @items.length\n end", "def size\n return @items.length\n end", "def size\n return @items.length\n end", "def size\n return @items.length\n end", "def size\n return @items.length\n end", "def size\n return @items.length\n end", "def size\n @que.size\n end", "def size\n @q.size\n end", "def work_queue_size()\n @work_queue.size\n end", "def queue_length\n if system.empty?\n 0\n else\n system.length - 1\n end\n end", "def size\n return @items.size\n end", "def size\n return @items.length\n end", "def item_count\n @items.length \n end", "def item_count\n @collection.size\n end", "def count\n @item_list.size\n end", "def size\n @count\n end", "def size\n @count\n end", "def item_count\n collection.length\n end", "def size\n\t\treturn @items.size\n end", "def pending_size\n @redis.zcard(\"xque:pending:#{@queue_name}\")\n end", "def size\n items.size\n end", "def size\n items.size\n end", "def size\n # This is a a bit racy - we don't update these two queues atomically\n @queue.size + @active.size\n end", "def size\n @items.length\n end", "def num_waiting\n @waiting.size + @queue_wait.size\n end", "def num_waiting\n @waiting.size + @queue_wait.size\n end", "def item_count\n @collection.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end" ]
[ "0.8580045", "0.85783106", "0.83036584", "0.82349086", "0.82245785", "0.81955695", "0.8187706", "0.8167576", "0.812935", "0.81070226", "0.8098918", "0.8021362", "0.8017036", "0.7968305", "0.79549927", "0.7953664", "0.78912073", "0.78033257", "0.77628225", "0.7707948", "0.7664117", "0.7651426", "0.7585749", "0.7585682", "0.7572326", "0.756166", "0.75570655", "0.751883", "0.74937856", "0.74633664", "0.74530905", "0.74443024", "0.7436367", "0.7436367", "0.7435185", "0.74063575", "0.73694444", "0.7366351", "0.7366351", "0.7366351", "0.7366351", "0.7366351", "0.7366351", "0.7366351", "0.7365599", "0.73600984", "0.7349813", "0.7340039", "0.7338814", "0.7317803", "0.73167515", "0.73011637", "0.7298472", "0.7278347", "0.7278347", "0.7268228", "0.72624683", "0.7259439", "0.72589964", "0.72589964", "0.7251874", "0.72406137", "0.72393966", "0.72393966", "0.7237946", "0.72078323", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694" ]
0.0
-1
Remove data from the queue, if it's there, returning the number of removed elements
def remove_from_queue(queue, data) prioritized?(queue) ? z_remove_from_queue(queue, data) : super end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove\n if empty?\n raise \"Can't remove if queue is empty\"\n else\n @info.shift\n end\n end", "def remove\n if empty?\n raise \"Can't remove if queue is empty\"\n else\n @info.shift\n end\n end", "def remove\n if empty?\n raise \"Can't remove if queue is empty\"\n else\n @info.shift\n end\n end", "def remove\n raise QueueUnderflow if empty?\n result = @info.shift\n changed\n notify_observers(self, :remove, result)\n result\n end", "def remove\n @queue.shift\n end", "def remove\n @queue.pop\n end", "def remove\n @queue.shift\n end", "def remove\n @queue.shift\n end", "def remove_from_queue\n if in_queue?\n decrement_queue_positions_on_lower_items\n update_attribute queue_position_column, nil\n end\n end", "def can_remove_no_wait?\n @queue.size > @num_waiting\n end", "def de_queue\n unless is_empty\n @q[@tail] = nil\n @tail = (@tail + 1) % @size\n @openings += 1\n true\n else\n false\n end\n end", "def can_remove_no_wait?\n @queue.size > @num_waiting\n end", "def de_queue()\n return false if self.is_empty\n\n @queue[@front] = nil\n if @front == @queue.size - 1\n @front = 0\n else\n @front += 1\n end\n true\n end", "def can_remove_no_wait?\n @queue.size > @num_waiting\n end", "def pop()\n @size -= 1 \n @queue.shift\n end", "def de_queue()\n if is_empty() == true\n return false\n end\n\n @front = (@front + 1) % (@q.length)\n @length -= 1\n return true\n end", "def z_remove_from_queue(queue, data)\n raise PipelineNotSupported if @redis.client.is_a?(Redis::Pipeline)\n\n priority = extract_priority(data)\n z_item = @redis.zrevrange(redis_key_for_queue(queue), 0, -1).find do |item|\n (priority && item.include?(data)) || \\\n (item.include?(data[/\"class\":\"[^ \"]+/]) && item.include?(data[/\"args\":.+/]))\n end or return\n @redis.zrem(redis_key_for_queue(queue), z_item)\n end", "def dequeue\n # check if queue is empty \n raise ArgumentError, \"Queue is empty\" if self.empty? \n \n element = @store[@front]\n \n # check last element removed\n if (@front == @back)\n @front = @back = -1 \n elsif @front + 1 == MAX_BUFFER\n @front = 0\n # nominal case\n else\n @front += 1\n end\n\n return element\n end", "def delete_last()\n if @queue.size > 0\n @queue.pop\n return true\n end\n false\n end", "def pop()\n if @queue_out.size == 0\n if @queue_in.size == 0\n return\n end\n\n while @queue_in.size > 0\n @queue_out.push(@queue_in.pop)\n end\n end\n\n @size -= 1\n return @queue_out.pop\n end", "def dequeue; @queue.pop end", "def remove()\n if @head == nil\n puts \"There is nothing to remove.\"\n elsif @head.next == nil\n puts \"#{@tail.data} has been removed from the Queue.\"\n @head = nil\n @tail = nil\n else\n current = @head\n prev = current\n while current.next != nil\n prev = current\n current = current.next\n end\n puts \"#{@tail.data} has been removed from the Queue.\"\n current = prev\n current.next = nil\n @tail = current\n end\n end", "def delete_front()\n if @queue.size > 0\n @queue.shift\n return true\n end\n false\n end", "def pop\n if @queue.empty?\n nil\n else\n tempArr = []\n while @queue.size > 1\n tempArr.push(@queue.remove)\n end\n tempItem = @queue.remove\n while !tempArr.empty?\n @queue.insert(tempArr.pop)\n end\n tempItem\n end\n end", "def pop\n @lock.synchronize do\n @queue.pop\n end\n end", "def pop()\n @queue.shift\n end", "def pop()\n if @queue_out.size == 0 \n if @queue_in.size == 0 \n return \n end\n \n while @queue_in.size > 0 \n @queue_out.push(@queue_in.pop)\n end\n end\n \n @size -= 1\n return @queue_out.pop\n end", "def remove()\n removed = @store[0].value\n swap(0, @store.length - 1)\n @store.pop\n heap_down(0)\n return removed\n end", "def dequeue\n @data.shift\n end", "def remove()\n return nil if !@store\n\n swap(0, @store.length - 1)\n nope = @store.pop\n\n heap_down(0)\n return nope.value\n end", "def size\n @mutex.synchronize { @queue.size }\n end", "def length\n @queue.length\n end", "def pop()\n head_index = get_document(@head_index_key)\n tail_index = get_document(@tail_index_key)\n if tail_index > head_index # if there is an item in the queue\n increase_atomic_count(@head_index_key) #incremented new_head_index is ignored, but we are incrementing and popping value\n return get_document(\"#{@key}::#{head_index + 1}\")\n else # \n nil\n end\n end", "def size\n self.queued.inject(0) { |result, data| result + data.last.size }\n end", "def length\n @queue.length\n end", "def count\n\t\[email protected]\n\tend", "def remove()\n \n swap(0, @store.length - 1)\n removed = @store.pop()\n \n heap_down(0) unless @store.empty?\n \n return removed.value\n end", "def pop\n if @q.empty?\n raise QueueEmptyError, \"tried to pop empty queue in #{@component.inspect}\"\n end\n obj = @q.shift\n @component.dec_queue_ready_count if @q.empty?\n obj\n end", "def size\n @queue.size\n end", "def size\n @queue.size\n end", "def dequeue\n @items.delete_at(0)\n end", "def size\n @queue.size\n end", "def remove!(item)\n @queue.delete(item)\n end", "def unpop obj\n was_empty = @q.empty?\n case obj\n when SimultaneousQueueEntries\n case obj.size\n when 0\n was_empty = false # just to prevent the inc\n when 1\n @q.unshift obj.first\n else\n @q.unshift obj\n end\n else\n @q.unshift obj\n end\n @component.inc_queue_ready_count if was_empty\n end", "def remove()\n return if @store.empty?\n\n swap(0, @store.length - 1)\n banished = @store.pop\n heap_down(0)\n\n return banished.value\n end", "def clean_queue!\n # Go through the song queue from start to end\n queued_songs.each_with_index do |song, index|\n if song['playAt'] + song['duration'] > Time.now.to_i\n # This song is still ok to have, trim of all the ones to the left\n $redis.ltrim(queue_key, index, -1)\n return\n end\n end\n\n # Okay, every song has played already, nuke it\n $redis.del(queue_key)\n end", "def queue_count()\n @queue.length\n end", "def pop\n return nil if empty?\n @que.pop\n end", "def pop\n if empty?\n nil\n else\n @q.remove\n @stack.shift\n end\n end", "def removed(node)\n\t\t\t@size -= 1\n\t\t\treturn node\n\t\tend", "def remove()\n return nil if @store.empty? \n swap(0, @store.length - 1)\n result = @store.pop.value\n \n heap_down(0) unless @store.empty?\n return result \n end", "def dequeue\n # if queue is empty, cannot remove anything\n if empty?\n nil\n else\n # +1 added to @tail because the queue is going to be one item shorter now\n @tail = @tail.succ\n # dequeued is set equal to the item at the front of the queue\n dequeued = @store[@head]\n # adds a nil to the \"front\" of @store (but this is actually the back of the queue)\n @store.unshift(nil)\n # removes the last item from @store (first item in the queue)\n @store.pop\n # returns the item removed from the queue\n dequeued\n end\n end", "def dequeue\n synchronize do\n @cond.wait_until{ @array.size > 0 }\n @array.shift\n end\n end", "def dequeue\n\t\[email protected]\n\tend", "def size\n @queue.size\n end", "def pop()\n min_dist = 1.0/0.0\n min_tuple = nil\n @queue.each{ |tuple|\n if(tuple.distance < min_dist)\n min_dist = tuple.distance\n min_tuple = tuple\n end\n }\n return @queue.delete(min_tuple)\n end", "def dequeue\n @queue.shift\n end", "def remove()\n return if @store.empty?\n last = @store.length - 1\n curr = 0\n swap(last, curr)\n removed = @store.pop\n heap_down(curr)\n return removed.value\n end", "def dequeue\n #if the queue is already empty, does nothing\n if empty?\n nil\n\n else\n #adds 1 to @tail\n @tail = @tail.succ\n #sets a local variable to the value at the top of the array\n dequeued = @store[@head]\n #adds nil to the tail of the array\n @store.unshift(nil)\n #takes off the element at the top of the array\n @store.pop\n #returns the value that was at the top of the array that has just been removed\n dequeued\n end\n end", "def queued_messages\n @queue.length\n end", "def size?\n @queue.length\n end", "def size\n\n @queue.size\n end", "def take_msg(queue)\n msg = queue.reserve\n #by calling ybody we get the content of the message and convert it from yml\n count = msg.ybody.count\n msg.delete\n return count\n end", "def pop\n entry = queue.pop[:payload]\n if (entry != :queue_empty)\n Marshal.load(entry)\n else\n nil\n end\n end", "def pop\n @mutex.synchronize do\n loop do\n if @queue.empty?\n @waiting.push Thread.current\n @mutex.sleep\n else\n return @queue.shift\n end\n end\n end\n end", "def size\n @que.size\n end", "def dequeue\n @mutex.synchronize do\n # Check if the queue is empty.\n if @head == @tail # not using empty? to avoid extra synchronize block\n return nil\n end\n\n # Remove next object.\n object = @queue[@head]\n @queue[@head] = nil\n\n @head = (@head + 1) & @max_mask\n return object\n end\n end", "def remove\n unless self.empty?\n swap(0, @store.length - 1)\n removed_node = @store.pop\n\n heap_down(0)\n\n return removed_node.value\n end\n end", "def empty()\n @queue.empty?\n end", "def rear()\n self.is_empty ? -1 : @queue[@rear - 1]\n end", "def pop\n @data.delete_at @data.length - 1 if @data.length > 0\n end", "def is_empty()\n @queue.count { _1 } == 0\n end", "def pop(*args)\n retval = super\n @mutex.synchronize {\n if @que.length < @max\n begin\n t = @queue_wait.shift\n t.wakeup if t\n rescue ThreadError\n retry\n end\n end\n }\n retval\n end", "def pop(*args)\n retval = super\n @mutex.synchronize {\n if @que.length < @max\n begin\n t = @queue_wait.shift\n t.wakeup if t\n rescue ThreadError\n retry\n end\n end\n }\n retval\n end", "def queued_messages\n @queue.length\n end", "def pop()\n res = @pop_queue.shift()\n return res\n end", "def dequeue\n raise 'Queue is empty' if self.empty?\n\n el = @queue[@head]\n\n if @head == @length - 1\n @head = 0\n else\n @head += 1\n end\n\n if @head == @tail\n self.reset\n end\n\n return el\n end", "def n_removed\n return 0 unless acknowledged?\n @replies.reduce(0) do |n, reply|\n n += reply.documents.first[N]\n end\n end", "def n_removed\n return 0 unless acknowledged?\n @replies.reduce(0) do |n, reply|\n n += reply.documents.first[N]\n end\n end", "def delete\n raise \"Bad things happen\" if @size == 0\n @size -= 1\n end", "def fish_removed()\n @fish_count.pop()\n end", "def dequeue\n @q.shift\n end", "def pop()\n new_queue = Queue.new\n until @queue.size == 1\n new_queue << @queue.pop\n end\n last = @queue.pop\n @queue = new_queue\n last\n end", "def pop;\n\t\[email protected]? and\n\t\t\treturn;\n\t\t_remove 0;\n\tend", "def _put_back_on_queue(message)\n future = nil\n _redis.multi do\n _redis.rpush(@queue, message)\n future = _redis.lrem(@in_progress_queue, 1, message)\n end\n removed = future.value\n if removed !=1\n RailsPipeline.logger.error \"ERROR: Didn't remove message from in_progress queue?!!!\"\n end\n end", "def pop()\n @q.shift\n end", "def empty?\n self.queue_size == 0\n end", "def dequeue\n # raise NotImplementedError, \"Not yet implemented\"\n #check if front is empty, if yes, return nil\n if @front == -1\n return nil\n #otherwise if front IS the rear, then the queue is full\n elsif @front == @rear\n raise Error, \"Full up here\"\n #not empty\n else \n #do same thing as the enqueue\n new_front = (@front + 1) % queue_size\n temp = @store[@front]\n @store[@front] = nil\n @front = new_front\n end\n return temp\n end", "def queue_length\n mutex.synchronize { running? ? @queue.length : 666 }\n end", "def pop_from_restriction_queue(tracking_key, queue)\n queue_key = restriction_queue_key(tracking_key, queue)\n str = Resque.redis.lpop(queue_key)\n post_pop_size = Resque.redis.llen(queue_key)\n\n if post_pop_size == 0\n update_queues_available(tracking_key, queue, :remove)\n clear_runnable(tracking_key, queue)\n end\n\n decrement_queue_count(queue)\n\n # increment by one to indicate that we are running\n increment_running_count(tracking_key) if str\n\n decode(str)\n end", "def is_empty()\n @queue.size == 0\n end", "def delete(element)\n synchronize do\n @queue.delete(element)\n end\n end", "def delete(element)\n synchronize do\n @queue.delete(element)\n end\n end", "def flushQueue() \n done=0\n while ([email protected]?) do\n done=done+1\n @sender_plugin.send_data(@data.pop)\n end\n @@log.info \"Flushed \"+done.to_s\n end", "def pop\n val = []\n @queue_mutex.synchronize do\n val = @memory_queue.pop\n end\n val\n end", "def delete(element)\n synchronize do\n @queue.delete(element)\n end\n end", "def clear_data\n self.mutex.synchronize do\n self.seq = 0\n self.beg = 0\n self.cur = 0\n self.queue = Array.new( self.size )\n end\n end", "def empty?\n @queue.empty?\n end", "def sub_queue_count\n sub_queue_obj.count\n end", "def deq\n @queued = false\n nil\n end" ]
[ "0.7422291", "0.7422291", "0.7422291", "0.7303138", "0.71217644", "0.70009404", "0.6995074", "0.69667345", "0.6885083", "0.6810454", "0.6790756", "0.6743725", "0.67210877", "0.6683692", "0.66377836", "0.6607834", "0.6577161", "0.65137124", "0.64157766", "0.63901013", "0.63619256", "0.634931", "0.632286", "0.6314088", "0.63036835", "0.62946445", "0.62887704", "0.6286275", "0.6209374", "0.6197724", "0.6197512", "0.6189798", "0.61885816", "0.61882836", "0.61788714", "0.616367", "0.6157951", "0.6134145", "0.61084914", "0.61060995", "0.61050856", "0.60962945", "0.6077994", "0.6075955", "0.60656357", "0.6061359", "0.6056224", "0.60548127", "0.6050757", "0.60487723", "0.60449225", "0.60321915", "0.60190344", "0.6016256", "0.60126865", "0.6008026", "0.5997943", "0.5993679", "0.5993395", "0.59926414", "0.5982535", "0.59819084", "0.5981388", "0.5970797", "0.59687036", "0.5961888", "0.5950524", "0.5939096", "0.59362674", "0.59194314", "0.5918687", "0.5894718", "0.5885041", "0.5885041", "0.5878841", "0.58589685", "0.585234", "0.5839755", "0.5839755", "0.58369964", "0.58306724", "0.5825076", "0.582385", "0.58186185", "0.58170545", "0.5816492", "0.58135897", "0.5804483", "0.579879", "0.57964605", "0.5775402", "0.57502735", "0.57502735", "0.5744933", "0.5742393", "0.57417303", "0.5734729", "0.5732459", "0.5730051", "0.57256275" ]
0.67974263
10
Get the number of items in the queue
def z_queue_size(queue) handle_pipeline(@redis.zcount(redis_key_for_queue(queue), 0, Float::INFINITY), &:to_i) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def queue_count()\n @queue.length\n end", "def count\n\t\[email protected]\n\tend", "def queue_count\n @queues.length\n end", "def size\n\n @queue.size\n end", "def length\n @queue.length\n end", "def length\n @queue.length\n end", "def size\n @queue.size\n end", "def size\n @queue.size\n end", "def size\n @queue.size\n end", "def queue_length\n @queues.inject(0) do |length, (_, queue)|\n length + queue.length\n end\n end", "def size\n @mutex.synchronize { @queue.size }\n end", "def queued_messages\n @queue.length\n end", "def size\n @queue.size\n end", "def sub_queue_count\n sub_queue_obj.count\n end", "def queue_count()\n cnt = 0\n @flows.each_value { |f| cnt += f.queue_count() }\n cnt\n end", "def queue_count()\n cnt = 0\n @tasks.each_value { |task| cnt += task.queue_count() }\n cnt\n end", "def size\n self.queued.inject(0) { |result, data| result + data.last.size }\n end", "def queued_messages\n @queue.length\n end", "def queue_length\n mutex.synchronize { running? ? @queue.length : 666 }\n end", "def size\n\t\t\[email protected] + @queue.size\n\t\tend", "def count\r\n items.size\r\n end", "def queue_size\n @redis.llen(\"xque:queue:#{@queue_name}\")\n end", "def message_count\n get_queue_message_count(address)\n end", "def queue_count()\n @work_queue.size + super()\n end", "def queue_length\n request_queue.length\n end", "def queue_length\n @executor.getQueue.size\n end", "def total_count(queue)\n collection.find(conditions(queue)).count\n end", "def waitlist_size\n @queue.size\n end", "def count_items\n @items.size\n end", "def queue_size(queue)\n Resque.size(queue)\n end", "def queue_length\n @job_queue.length\n end", "def size\n @items.count\n end", "def size\n @items.count\n end", "def item_count\n @items.length\n end", "def message_count(queue)\n connect do |bunny|\n return bunny.queue(queue, :durable => true, :auto_delete => false).message_count\n end\n end", "def size\n return @items.size\n end", "def size\n return @items.length\n end", "def size\n return @items.length\n end", "def size\n return @items.length\n end", "def size\n return @items.length\n end", "def size\n return @items.length\n end", "def size\n return @items.length\n end", "def size\n return @items.length\n end", "def size\n @que.size\n end", "def size\n @q.size\n end", "def work_queue_size()\n @work_queue.size\n end", "def queue_length\n if system.empty?\n 0\n else\n system.length - 1\n end\n end", "def size\n return @items.size\n end", "def size\n return @items.length\n end", "def item_count\n @items.length \n end", "def item_count\n @collection.size\n end", "def count\n @item_list.size\n end", "def size\n @count\n end", "def size\n @count\n end", "def item_count\n collection.length\n end", "def size\n\t\treturn @items.size\n end", "def pending_size\n @redis.zcard(\"xque:pending:#{@queue_name}\")\n end", "def size\n items.size\n end", "def size\n items.size\n end", "def size\n # This is a a bit racy - we don't update these two queues atomically\n @queue.size + @active.size\n end", "def size\n @items.length\n end", "def num_waiting\n @waiting.size + @queue_wait.size\n end", "def num_waiting\n @waiting.size + @queue_wait.size\n end", "def item_count\n @collection.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end", "def size\n @items.length\n end" ]
[ "0.8580045", "0.85783106", "0.83036584", "0.82349086", "0.82245785", "0.81955695", "0.8187706", "0.8167576", "0.812935", "0.81070226", "0.8098918", "0.8021362", "0.8017036", "0.7968305", "0.79549927", "0.7953664", "0.78912073", "0.78033257", "0.77628225", "0.7707948", "0.7664117", "0.7651426", "0.7585749", "0.7585682", "0.7572326", "0.756166", "0.75570655", "0.751883", "0.74937856", "0.74633664", "0.74443024", "0.7436367", "0.7436367", "0.7435185", "0.74063575", "0.73694444", "0.7366351", "0.7366351", "0.7366351", "0.7366351", "0.7366351", "0.7366351", "0.7366351", "0.7365599", "0.73600984", "0.7349813", "0.7340039", "0.7338814", "0.7317803", "0.73167515", "0.73011637", "0.7298472", "0.7278347", "0.7278347", "0.7268228", "0.72624683", "0.7259439", "0.72589964", "0.72589964", "0.7251874", "0.72406137", "0.72393966", "0.72393966", "0.7237946", "0.72078323", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694", "0.72044694" ]
0.74530905
30
Remove data from the queue, if it's there, returning the number of removed elements Not so very fast method. But because of uuid in the zset items we could not to make it faster. Usaually this method uses manually, so speed not so critical. NOTE: placing uuids into special key not a good idea. We could to remove queue, for example, and we lose symchronize between two lists. So speed increase in this case will break a logic. NOTE: We need at least two requests to redis, so, we could not to make it inside pipeline block
def z_remove_from_queue(queue, data) raise PipelineNotSupported if @redis.client.is_a?(Redis::Pipeline) priority = extract_priority(data) z_item = @redis.zrevrange(redis_key_for_queue(queue), 0, -1).find do |item| (priority && item.include?(data)) || \ (item.include?(data[/"class":"[^ "]+/]) && item.include?(data[/"args":.+/])) end or return @redis.zrem(redis_key_for_queue(queue), z_item) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_from_queue(queue, data)\n prioritized?(queue) ? z_remove_from_queue(queue, data) : super\n end", "def remove\n if empty?\n raise \"Can't remove if queue is empty\"\n else\n @info.shift\n end\n end", "def remove\n if empty?\n raise \"Can't remove if queue is empty\"\n else\n @info.shift\n end\n end", "def remove\n if empty?\n raise \"Can't remove if queue is empty\"\n else\n @info.shift\n end\n end", "def remove_from_queue\n if in_queue?\n decrement_queue_positions_on_lower_items\n update_attribute queue_position_column, nil\n end\n end", "def remove\n @queue.shift\n end", "def remove\n raise QueueUnderflow if empty?\n result = @info.shift\n changed\n notify_observers(self, :remove, result)\n result\n end", "def remove\n @queue.pop\n end", "def remove\n @queue.shift\n end", "def remove\n @queue.shift\n end", "def remove\n @redis.lrem list, -1, @data if exists?\n @redis.srem md5_list, @md5_sum\n end", "def take_msg(queue)\n msg = queue.reserve\n #by calling ybody we get the content of the message and convert it from yml\n count = msg.ybody.count\n msg.delete\n return count\n end", "def purge\n t = Time.now\n expired = []\n @queue.each do |identity,worker|\n expired << identity if t > worker.expiry\n end\n expired.each do |identity|\n @queue.delete identity\n end\n end", "def dequeue\n # check if queue is empty \n raise ArgumentError, \"Queue is empty\" if self.empty? \n \n element = @store[@front]\n \n # check last element removed\n if (@front == @back)\n @front = @back = -1 \n elsif @front + 1 == MAX_BUFFER\n @front = 0\n # nominal case\n else\n @front += 1\n end\n\n return element\n end", "def can_remove_no_wait?\n @queue.size > @num_waiting\n end", "def pop()\n if @queue_out.size == 0\n if @queue_in.size == 0\n return\n end\n\n while @queue_in.size > 0\n @queue_out.push(@queue_in.pop)\n end\n end\n\n @size -= 1\n return @queue_out.pop\n end", "def remove()\n removed = @store[0].value\n swap(0, @store.length - 1)\n @store.pop\n heap_down(0)\n return removed\n end", "def remove_from_queue!(user)\n $redis.lrem(self.class.redis_key_for_user(user), 0, to_redis_object)\n end", "def remove()\n \n swap(0, @store.length - 1)\n removed = @store.pop()\n \n heap_down(0) unless @store.empty?\n \n return removed.value\n end", "def clean_queue!\n # Go through the song queue from start to end\n queued_songs.each_with_index do |song, index|\n if song['playAt'] + song['duration'] > Time.now.to_i\n # This song is still ok to have, trim of all the ones to the left\n $redis.ltrim(queue_key, index, -1)\n return\n end\n end\n\n # Okay, every song has played already, nuke it\n $redis.del(queue_key)\n end", "def dequeue; @queue.pop end", "def can_remove_no_wait?\n @queue.size > @num_waiting\n end", "def de_queue()\n return false if self.is_empty\n\n @queue[@front] = nil\n if @front == @queue.size - 1\n @front = 0\n else\n @front += 1\n end\n true\n end", "def pop()\n @size -= 1 \n @queue.shift\n end", "def dequeue_non_atomically\n redis.zrem(self.class.pending_video_ids.key, self.id)\n redis.zrem(self.class.held_video_ids.key, self.id)\n end", "def take_msg(queue)\n msg = queue.reserve\n #by calling ybody we get the content of the message and convert it from yml\n count = msg.ybody.count\n result = count*count\n msg.delete\n return result\n end", "def pop()\n if @queue_out.size == 0 \n if @queue_in.size == 0 \n return \n end\n \n while @queue_in.size > 0 \n @queue_out.push(@queue_in.pop)\n end\n end\n \n @size -= 1\n return @queue_out.pop\n end", "def de_queue\n unless is_empty\n @q[@tail] = nil\n @tail = (@tail + 1) % @size\n @openings += 1\n true\n else\n false\n end\n end", "def can_remove_no_wait?\n @queue.size > @num_waiting\n end", "def z_queue_size(queue)\n handle_pipeline(@redis.zcount(redis_key_for_queue(queue), 0, Float::INFINITY), &:to_i)\n end", "def de_queue()\n if is_empty() == true\n return false\n end\n\n @front = (@front + 1) % (@q.length)\n @length -= 1\n return true\n end", "def remove()\n return if @store.empty?\n\n swap(0, @store.length - 1)\n banished = @store.pop\n heap_down(0)\n\n return banished.value\n end", "def remove()\n return nil if !@store\n\n swap(0, @store.length - 1)\n nope = @store.pop\n\n heap_down(0)\n return nope.value\n end", "def pop\n @lock.synchronize do\n @queue.pop\n end\n end", "def pop()\n head_index = get_document(@head_index_key)\n tail_index = get_document(@tail_index_key)\n if tail_index > head_index # if there is an item in the queue\n increase_atomic_count(@head_index_key) #incremented new_head_index is ignored, but we are incrementing and popping value\n return get_document(\"#{@key}::#{head_index + 1}\")\n else # \n nil\n end\n end", "def size\n self.queued.inject(0) { |result, data| result + data.last.size }\n end", "def remove()\n return nil if @store.empty? \n swap(0, @store.length - 1)\n result = @store.pop.value\n \n heap_down(0) unless @store.empty?\n return result \n end", "def delete_game_id_in_queue game_id, queue = nil\n current_queue = queue || craft_firebase_command(\"minesweeper/queue.json\")\n\n # getting new queue to update\n new_queue = current_queue&.reject { |queue_game_id|\n # reject chosen game\n game_id == queue_game_id\n }\n\n # update queue on server\n update_current_queue(new_queue)\nend", "def remove()\n return if @store.empty?\n last = @store.length - 1\n curr = 0\n swap(last, curr)\n removed = @store.pop\n heap_down(curr)\n return removed.value\n end", "def dequeue\n @mutex.synchronize do\n # Check if the queue is empty.\n if @head == @tail # not using empty? to avoid extra synchronize block\n return nil\n end\n\n # Remove next object.\n object = @queue[@head]\n @queue[@head] = nil\n\n @head = (@head + 1) & @max_mask\n return object\n end\n end", "def pop(n = 1)\n # A recap: pop should remove oldest N messages and return to the caller.\n #\n # Let's see how this queue is implemented.\n # In redis, messages are LPUSH-ed:\n #\n # 4 - 3 - 2 - 1 --> REDIS\n # 4 - 3 - 2 --> REDIS\n # 4 - 3 --> REDIS\n # 4 --> REDIS\n #\n # Then, in the fast_dequeue, are RPOP-ped:\n #\n # REDIS --> 1\n # REDIS --> 2 - 1\n # REDIS --> 3 - 2 - 1\n # REDIS --> 4 - 3 - 2 - 1\n #\n # Then, are received in this order:\n # [1] -> TimeUUID(1) = ...\n # [2] -> TimeUUID(1) = ...\n # [3] -> TimeUUID(1) = ...\n # [4] -> TimeUUID(1) = ...\n #\n # As you can see below, are ORDER BY (created_at ASC)... that means\n # \"olders first\". When using 'LIMIT n' in a query, you get the 'n'\n # olders entries.\n #\n # cqlsh> SELECT * FROM polipus_queue_overflow_linkedin.linkedin_overflow ;\n #\n # queue_name | created_at | payload\n # ---------------------------------+--------------------------------------+---------\n # polipus_queue_overflow_linkedin | 4632d49c-1c04-11e5-844b-0b314c777502 | \"1\"\n # polipus_queue_overflow_linkedin | 46339f8a-1c04-11e5-844b-0b314c777502 | \"2\"\n # polipus_queue_overflow_linkedin | 46349962-1c04-11e5-844b-0b314c777502 | \"3\"\n # polipus_queue_overflow_linkedin | 46351860-1c04-11e5-844b-0b314c777502 | \"4\"\n #\n # (4 rows)\n # cqlsh> SELECT * FROM polipus_queue_overflow_linkedin.linkedin_overflow LIMIT 1;\n #\n # queue_name | created_at | payload\n # ---------------------------------+--------------------------------------+---------\n # polipus_queue_overflow_linkedin | 4632d49c-1c04-11e5-844b-0b314c777502 | \"1\"\n #\n # (1 rows)\n #\n table_ = [keyspace, table].compact.join '.'\n results = get(n)\n results.each do |entry|\n statement = \"DELETE FROM #{table_} WHERE queue_name = '#{entry['queue_name']}' AND created_at = #{entry['created_at']} ;\"\n session.execute(statement)\n end\n\n # Let's rispect the API as expected by Polipus.\n # Otherwise the execute returns a Cassandra::Results::Paged\n if !results.nil? && results.respond_to?(:count) && results.count == 1\n return results.first['payload']\n end\n return results\n end", "def unpop obj\n was_empty = @q.empty?\n case obj\n when SimultaneousQueueEntries\n case obj.size\n when 0\n was_empty = false # just to prevent the inc\n when 1\n @q.unshift obj.first\n else\n @q.unshift obj\n end\n else\n @q.unshift obj\n end\n @component.inc_queue_ready_count if was_empty\n end", "def dequeue\n @items.delete_at(0)\n end", "def pop()\n @queue.shift\n end", "def size\n @mutex.synchronize { @queue.size }\n end", "def remove!(item)\n @queue.delete(item)\n end", "def pop\n if @queue.empty?\n nil\n else\n tempArr = []\n while @queue.size > 1\n tempArr.push(@queue.remove)\n end\n tempItem = @queue.remove\n while !tempArr.empty?\n @queue.insert(tempArr.pop)\n end\n tempItem\n end\n end", "def sub_queue_count\n sub_queue_obj.count\n end", "def pop\n entry = queue.pop[:payload]\n if (entry != :queue_empty)\n Marshal.load(entry)\n else\n nil\n end\n end", "def queue_size\n @redis.llen(\"xque:queue:#{@queue_name}\")\n end", "def remove\n unless self.empty?\n swap(0, @store.length - 1)\n removed_node = @store.pop\n\n heap_down(0)\n\n return removed_node.value\n end\n end", "def dequeue\n # if queue is empty, cannot remove anything\n if empty?\n nil\n else\n # +1 added to @tail because the queue is going to be one item shorter now\n @tail = @tail.succ\n # dequeued is set equal to the item at the front of the queue\n dequeued = @store[@head]\n # adds a nil to the \"front\" of @store (but this is actually the back of the queue)\n @store.unshift(nil)\n # removes the last item from @store (first item in the queue)\n @store.pop\n # returns the item removed from the queue\n dequeued\n end\n end", "def delete!\n count = 0\n uniq.bulk_job { |e| count += 1; e.delete! }\n count\n end", "def pending_size\n @redis.zcard(\"xque:pending:#{@queue_name}\")\n end", "def pop\n if @q.empty?\n raise QueueEmptyError, \"tried to pop empty queue in #{@component.inspect}\"\n end\n obj = @q.shift\n @component.dec_queue_ready_count if @q.empty?\n obj\n end", "def size\n @queue.size\n end", "def delete_last()\n if @queue.size > 0\n @queue.pop\n return true\n end\n false\n end", "def queue_count()\n @queue.length\n end", "def count\n\t\[email protected]\n\tend", "def deq\n @queued = false\n nil\n end", "def cleanup\n redis.zremrangebyscore(key, '-inf', time - timespan)\n end", "def length\n @queue.length\n end", "def size\n @queue.size\n end", "def size\n @queue.size\n end", "def queue_length\n mutex.synchronize { running? ? @queue.length : 666 }\n end", "def remove()\n if @head == nil\n puts \"There is nothing to remove.\"\n elsif @head.next == nil\n puts \"#{@tail.data} has been removed from the Queue.\"\n @head = nil\n @tail = nil\n else\n current = @head\n prev = current\n while current.next != nil\n prev = current\n current = current.next\n end\n puts \"#{@tail.data} has been removed from the Queue.\"\n current = prev\n current.next = nil\n @tail = current\n end\n end", "def length\n @queue.length\n end", "def pop_from_restriction_queue(tracking_key, queue)\n queue_key = restriction_queue_key(tracking_key, queue)\n str = Resque.redis.lpop(queue_key)\n post_pop_size = Resque.redis.llen(queue_key)\n\n if post_pop_size == 0\n update_queues_available(tracking_key, queue, :remove)\n clear_runnable(tracking_key, queue)\n end\n\n decrement_queue_count(queue)\n\n # increment by one to indicate that we are running\n increment_running_count(tracking_key) if str\n\n decode(str)\n end", "def dequeue\n #if the queue is already empty, does nothing\n if empty?\n nil\n\n else\n #adds 1 to @tail\n @tail = @tail.succ\n #sets a local variable to the value at the top of the array\n dequeued = @store[@head]\n #adds nil to the tail of the array\n @store.unshift(nil)\n #takes off the element at the top of the array\n @store.pop\n #returns the value that was at the top of the array that has just been removed\n dequeued\n end\n end", "def pop(*args)\n retval = super\n @mutex.synchronize {\n if @que.length < @max\n begin\n t = @queue_wait.shift\n t.wakeup if t\n rescue ThreadError\n retry\n end\n end\n }\n retval\n end", "def pop(*args)\n retval = super\n @mutex.synchronize {\n if @que.length < @max\n begin\n t = @queue_wait.shift\n t.wakeup if t\n rescue ThreadError\n retry\n end\n end\n }\n retval\n end", "def delete_front()\n if @queue.size > 0\n @queue.shift\n return true\n end\n false\n end", "def dequeue\n @queue.shift\n end", "def dequeue\n @store.pop\n end", "def pull_queue_pull\n return nil if self.pull_queue_names.length == 0\n \n puts \"pulling from queues #{self.pull_queue_names.join ', '}\"\n \n elt = nil\n elt = @redis.brpop(self.pull_queue_names, self.queue_wait_seconds) while elt == nil\n \n key = elt[0]\n val = elt[1]\n self.debug_out \"got data from pull queue #{key}\"\n Marshal.load val\n end", "def _put_back_on_queue(message)\n future = nil\n _redis.multi do\n _redis.rpush(@queue, message)\n future = _redis.lrem(@in_progress_queue, 1, message)\n end\n removed = future.value\n if removed !=1\n RailsPipeline.logger.error \"ERROR: Didn't remove message from in_progress queue?!!!\"\n end\n end", "def pop\n while true\n message = @queue.pop\n return YAML::load(message.to_s) unless message.nil?\n sleep 5\n end\n end", "def dequeue\n @data.shift\n end", "def queue_count\n @queues.length\n end", "def remove(data)\n set data, 0\n end", "def size\n\n @queue.size\n end", "def dequeue\n\t\[email protected]\n\tend", "def size\n @queue.size\n end", "def queued_messages\n @queue.length\n end", "def pop\n return nil unless @tail\n value = @tail[:data].pop\n @tail = @tail[:forward] while @tail and @tail[:data].size == 0\n @set.delete(value)\n value\n end", "def receive(id)\n @queues[id].pop\n end", "def pop\n @mutex.synchronize do\n loop do\n if @queue.empty?\n @waiting.push Thread.current\n @mutex.sleep\n else\n return @queue.shift\n end\n end\n end\n end", "def deq\n\t\tremove(0)\n\tend", "def prune_responses_queue\n while !responses_queue.empty?\n message_id = responses_queue.first\n\n if responses[message_id].nil? || Time.now - responses[message_id].timestamp.to_time > 2.minutes\n responses_queue.shift\n responses.delete(message_id)\n else\n break\n end\n end\n end", "def remove()\n return if @store.empty?\n if @store.size == 1\n return @store.pop\n end\n # swap the first and the last element in the underlying array\n @store[-1], @store[0] = @store[0], @store[-1]\n removed = @store.pop\n heap_down(0)\n return removed.value\n end", "def pop()\n res = @pop_queue.shift()\n return res\n end", "def dequeue\n raise 'Queue is empty' if self.empty?\n\n el = @queue[@head]\n\n if @head == @length - 1\n @head = 0\n else\n @head += 1\n end\n\n if @head == @tail\n self.reset\n end\n\n return el\n end", "def dequeue\n add(queued_requests.shift) unless queued_requests.empty?\n end", "def unlock_queueing_for_queue(queue)\n Resque.data_store.everything_in_queue(queue).uniq.each do |string|\n item = Resque.decode(string)\n\n unlock_queueing(queue, item).tap { RecoveringQueue.remove(queue, item) }\n end\n end", "def trim_queue!(user)\n $redis.ltrim(self.class.redis_key_for_user(user), 0, KEEP_ACTIVITY_ITEMS)\n end", "def cleanup!(redis)\n max_score = Time.now.to_i - @timeout\n expired = redis.zremrangebyscore(key, \"-inf\", max_score)\n expired > 0 ? true : false\n end", "def pop()\n min_dist = 1.0/0.0\n min_tuple = nil\n @queue.each{ |tuple|\n if(tuple.distance < min_dist)\n min_dist = tuple.distance\n min_tuple = tuple\n end\n }\n return @queue.delete(min_tuple)\n end", "def n_removed\n return 0 unless acknowledged?\n @replies.reduce(0) do |n, reply|\n n += reply.documents.first[N]\n end\n end", "def n_removed\n return 0 unless acknowledged?\n @replies.reduce(0) do |n, reply|\n n += reply.documents.first[N]\n end\n end", "def delete(queue)\n @mutex.lock if @multithread\n\n raise MemCacheError, \"No active servers\" unless active?\n cache_key = make_cache_key key\n server = get_server_for_key cache_key\n\n sock = server.socket\n raise MemCacheError, \"No connection to server\" if sock.nil?\n\n begin\n sock.write \"delete #{cache_key}\\r\\n\"\n sock.gets\n rescue SocketError, SystemCallError, IOError => err\n server.close\n raise MemCacheError, err.message\n end\n ensure\n @mutex.unlock if @multithread\n end" ]
[ "0.6768191", "0.6622731", "0.6622731", "0.6622731", "0.6564068", "0.6533087", "0.6527856", "0.64525205", "0.6358689", "0.63296527", "0.6185299", "0.6137111", "0.6098556", "0.6054851", "0.5975801", "0.5957081", "0.59408224", "0.59402317", "0.593895", "0.59385234", "0.59278", "0.59011096", "0.5900004", "0.58902425", "0.5884784", "0.58618397", "0.58567274", "0.5855414", "0.585346", "0.58396775", "0.5839554", "0.5827784", "0.5813282", "0.58047336", "0.57971096", "0.57729906", "0.5766688", "0.5759322", "0.5742081", "0.5734742", "0.57183945", "0.5700927", "0.56561345", "0.5615194", "0.5607107", "0.5606344", "0.5603475", "0.5602703", "0.56021696", "0.559601", "0.5586132", "0.55859977", "0.5566303", "0.5563038", "0.5560163", "0.5559776", "0.55576676", "0.5554606", "0.5553366", "0.55501735", "0.5530929", "0.5525363", "0.55216235", "0.5520543", "0.5489112", "0.5473968", "0.5471468", "0.54642", "0.5461613", "0.5455756", "0.5455756", "0.5453408", "0.5453163", "0.54524225", "0.5439493", "0.5435039", "0.5430921", "0.54300165", "0.5429832", "0.5427583", "0.5425177", "0.5423183", "0.54131097", "0.5411548", "0.54097736", "0.5408575", "0.54078686", "0.54044557", "0.53974193", "0.53848386", "0.53813076", "0.5380275", "0.53755516", "0.5367826", "0.5365693", "0.5364566", "0.5362883", "0.53584886", "0.53584886", "0.5348406" ]
0.7145564
0
parent method returns object, when count eq 1, and array, whe count is more.
def z_list_range(key, start = 0, count = 1) handle_pipeline(@redis.zrevrange(key, start, start + count - 1)) { |object| list = Array(object).map(&method(:without_uuid)) next list.first if count == 1 list } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def length\n array.first.size\n end", "def _serializable_array\n if @options[:single_record]\n super.first\n else\n super\n end\n end", "def ensure_cardinality(result)\n Array.wrap(result)\n end", "def get_items\r\n @arr.to_a\r\n end", "def [](length)\n self::Array.new(length)\n end", "def array\n @array\n end", "def first(count=MaglevUndefined)\n if count._equal?(MaglevUndefined)\n return self.first()\n end\n # return Array of first count elements of the enumeration\n cnt = Maglev::Type.coerce_to(count, Fixnum, :to_int)\n if cnt <= 0\n if cnt._equal?(0)\n return []\n end\n raise ArgumentError, 'negative count'\n end\n arr = []\n n = 0\n self.each { |o| \n arr << o\n n += 1\n if n >= cnt\n return arr\n end\n }\n return arr\n end", "def size\n self.to_a.size\n end", "def __array__; self; end", "def as_collection\n @obj.is_a?(Array) ? self : self.class.new(self.to_a)\n end", "def item_max\r\n \t@data ? @data.size : 1\r\n end", "def array()\n\t\t@array\n\tend", "def array\n self.allObjects\n end", "def item_max\r\r\n @data ? @data.size : 1\r\r\n end", "def size\n \[email protected]\n end", "def count\n to_a.size\n end", "def get_items\n\t\t@arr\n\tend", "def item_max; @data ? @data.size : 0; end", "def item_max\n @data ? @data.size : 1\n end", "def item_max\n @data ? @data.size : 1\n end", "def item_max\n @data ? @data.size : 1\n end", "def item_max\n @data ? @data.size : 1\n end", "def item_max\n @data ? @data.size : 1\n end", "def item_max\n @data ? @data.size : 1\n end", "def array\n raise \"Not implemented\"\n end", "def item_max\n @data ? @data.size : 1;\n end", "def size\n as_array ? as_array.length : 0\n end", "def size\n as_array ? as_array.length : 0\n end", "def inspect\n return super unless has_size?\n\n to_ary.inspect\n end", "def my_controlled_flatten(n=1)\n #here\n return self if n < 1\n\n results = []\n self.each do |el|\n if el.class == Array\n #here\n results += el.my_controlled_flatten(n-1)\n else\n results << el\n end\n end\n\n results\n\n end", "def size\n to_ary.size\n end", "def test_returns_count\n assert(\n FromArray.new([1, 2, 3]).count == 3\n )\n assert(\n FromArray.new([]).count.zero?\n )\n end", "def create_array(base_type, element_count, size = 0)\n if base_type.respond_to?(:name)\n base_type = base_type.name\n end\n return build(\"#{base_type}[#{element_count}]\", size)\n end", "def size\n\t\[email protected]\n\tend", "def be_compatible\n @size = if @results.class == Array\n @results.size\n else\n @results.values.size\n end\n end", "def size\n to_ary.size\n end", "def fetch\n fetch0(Array, false)\n end", "def count_elements(array)\n newArray = []\n array.each do |obj|\n newArray.push(obj)\n obj[:count] = 0\n #if newArray.length > 0\n newArray.each do |obj|\n if obj.include?(:count)\n obj[:count] += 1\n else\n obj[:count] = 1\n end\n #binding.pry\n end\n #end\n end\n newArray.shift\n return newArray\nend", "def another; return []; end", "def size\n self.list.length\n end", "def count\n to_a.size\n end", "def count\n to_a.size\n end", "def length\n @elements.length\n #@elements.size \n end", "def array\n @@array\n end", "def to_a\n return super if __forced__?\n self\n end", "def take(count) # added in 1.8.7\n # return an Array containing self[0 .. count-1 ]\n cnt = Maglev::Type.coerce_to(count, Fixnum, :to_int)\n if cnt < 0\n raise ArgumentError, 'arg to take must be >= 0'\n end\n return self.__at(0, cnt)\n end", "def dimensions(n=0)\n n += 1\n self.first.is_a?(Array) ? self.first.dimensions(n) : n\n end", "def to_a(length=self.length)\n length == 0 ? [] : self[0, length]\n end", "def returns_array?\n true\n end", "def length\n\n count_objects()\n end", "def size\n @array.length\n end", "def length\r\n self.count\r\n end", "def count\n [super || 1, 1].max\n end", "def size\n\t\[email protected]\n\tend", "def initialize\n @size = 10\n @array = Array.new(@size) { [] }\n @count = 0\n end", "def size\n @objects.size\n end", "def size\n @items.length \n end", "def another\n self.class.new(nil, cached? ? [] : io_index.another)\n end", "def subsets(arr)\n return [self] if arr.length == 1\n\n subs + subsets()\nend", "def initialize\n @more_array = Array.new\n end", "def one(array)\n return array.first if array.one?\n\n raise SizeError,\n \"expected size to be exactly 1 but size was #{array.size}\"\n end", "def first\n if resources.is_a?(Array)\n resources.first\n else\n resources\n end\n end", "def first; self.objects.first end", "def size()\n #This is a stub, used for indexing\n end", "def dup_or_calc( array, object, index )\n array[ index ] = object.class.new if ( array[ index ].nil? )\n array[ index ].add!( object )\n end", "def __init_check_row(arow)\n if arow._isArray\n return arow\n end\n if arow._kind_of?( Vector )\n return arow.__elements\n end\n Maglev::Type.coerce_to( arow, Array, :to_ary )\n end", "def size\n\t\treturn @items.size\n end", "def read_array(getter, counter, type)\n count_max = FFI::Libvirt.send(counter, interface)\n output_ptr = FFI::MemoryPointer.new(:pointer, count_max)\n count_returned = FFI::Libvirt.send(getter, interface, output_ptr, count_max)\n output_ptr.send(\"get_array_of_#{type}\", 0, count_returned)\n end", "def current\n validates_possibility_of :current\n self.array[index]\n end", "def count\n underlying_array.length\n end", "def size() end", "def size() end", "def size() end", "def size() end", "def size() end", "def size() end", "def count\n @rarray.length\n end", "def take(limit=1)\n if self.any? #if array in not empty\n self[0...limit]\n else\n nil # if array is empty, return nil\n end\n end", "def item_max\n @data ? @data.size : 0\n end", "def item_max\n @data ? @data.size : 0\n end", "def item_max\n @data ? @data.size : 0\n end", "def item_max\n @data ? @data.size : 0\n end", "def item_max\n @data ? @data.size : 0\n end", "def item_max\n @data ? @data.size : 0\n end", "def item_max\n @data ? @data.size : 0\n end", "def length\n array_list.length\n end", "def get(index)\n raise \"Only positive indexes, #{index}\" if index <= 0\n if index > self.get_length\n return nil\n else\n return internal_object_get(index + 1)\n end\n end", "def Array(p0) end", "def pagy_countless_array(array, vars={})\n pagy = Pagy::Countless.new(pagy_countless_get_vars(array, vars))\n return pagy, pagy_countless_get_items(array, pagy)\n end", "def initialize arr = []\n super arr\n end", "def limit count\n count.zero? ? none : super\n end", "def using_size(array)\n array.size\nend", "def using_size(array)\n array.size\nend", "def size\n @items.size\n end", "def size\n @items.size\n end", "def size\n @items.size\n end", "def size\n @items.size\n end", "def size\n @items.size\n end", "def size\n @items.size\n end", "def size\n @items.size\n end", "def size\n @items.size\n end" ]
[ "0.58764225", "0.5869556", "0.5867699", "0.57020897", "0.56857085", "0.55863225", "0.55777645", "0.5574888", "0.5563173", "0.55594844", "0.55537474", "0.5550768", "0.5545989", "0.5530395", "0.5529184", "0.55236626", "0.5506737", "0.5490876", "0.54904", "0.54904", "0.54904", "0.54904", "0.54904", "0.54904", "0.54446477", "0.5444034", "0.5438173", "0.5438173", "0.54372424", "0.5435523", "0.54315186", "0.5410504", "0.53941655", "0.5394049", "0.5388229", "0.53848237", "0.5375772", "0.5371368", "0.53294635", "0.53275126", "0.5326609", "0.5326609", "0.5305352", "0.53015655", "0.52986944", "0.529778", "0.5288277", "0.5286677", "0.5275177", "0.5273896", "0.5265236", "0.5259006", "0.5245414", "0.52355856", "0.5227987", "0.5227394", "0.52255046", "0.5224242", "0.5224001", "0.5210757", "0.52069527", "0.52019936", "0.51967585", "0.5195419", "0.5188513", "0.5187327", "0.5184762", "0.51749325", "0.5171912", "0.51689327", "0.5163366", "0.5163366", "0.5163366", "0.5163366", "0.5163366", "0.5163366", "0.51628196", "0.51619774", "0.5158188", "0.5158188", "0.5158188", "0.5158188", "0.5158188", "0.5158188", "0.5158188", "0.5152186", "0.51518214", "0.5147614", "0.5146806", "0.5142509", "0.5134784", "0.5127845", "0.5127845", "0.5111506", "0.5111506", "0.5111506", "0.5111506", "0.5111506", "0.5111506", "0.5111506", "0.5111506" ]
0.0
-1
Hack to allow gem work inside Redis Pipilened block. NOTE: See Resque::Plugins::Prioritize::RedisFutureExtensionadd_transformation
def handle_pipeline(object, &block) object.is_a?(Redis::Future) ? object.add_transformation(&block) : block.call(object) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def third_party_processors; end", "def mix\n #future code\n end", "def pre_install; end", "def install_pre_hook\n end", "def redis_pool; end", "def write_redis_recommendation(development_working, lines, index, gemfile)\n # provide a recommendation for using redis-session-store, including commented source code\n if !lines.index { |line| line.include?(\"StimulusReflex does not support :cookie_store\") }\n lines.insert index + 1, <<RUBY\n\n # StimulusReflex does not support :cookie_store, and we recommend switching to Redis.\n # To use `redis-session-store`, make sure to add it to your Gemfile and run `bundle install`.\n\n # config.session_store :redis_session_store,\n # serializer: :json,\n # on_redis_down: ->(*a) { Rails.logger.error(\"Redis down! \\#{a.inspect}\") },\n # redis: {\n # expire_after: 120.minutes,\n # key_prefix: \"session:\",\n # url: ENV.fetch(\"REDIS_URL\") { \"redis://localhost:6379/1\" }\n # }\nRUBY\n development_working.write lines.join\n # add redis-session-store to Gemfile, but comment it out\n if !gemfile.match?(/gem ['\"]redis-session-store['\"]/)\n append_file(gemfile_path, verbose: false) do\n <<~RUBY\n\n # StimulusReflex recommends using Redis for session storage\n # gem \"redis-session-store\", \"0.11.5\"\n RUBY\n end\n say \"💡 Added redis-session-store 0.11.5 to the Gemfile, commented out\"\n end\n end\nend", "def pre_process\n end", "def camaleon_mailchimp_on_upgrade(plugin)\n end", "def redisize_json scheme, &block\n primary_key = self.class.primary_key\n key = [\"json\", self.model_name.name, primary_key, self[primary_key].to_s, scheme]\n\n # binding.pry\n Rails.cache.fetch(key, expires_in: 1.week) do\n value = block.call\n\n Redisable.enqueue(:redisize_json_metas, key, value)\n\n value\n end\n end", "def redis_pool=(_arg0); end", "def pre_wrap\n @pre_wrap ||= {}\n end", "def preloaded_module_paths(resolver:, cache_key: T.unsafe(nil)); end", "def redis_on_base\n on_base\n end", "def extra_runtime_dependencies(answer = T.unsafe(nil)); end", "def blog_on_upgrade(plugin)\r\n end", "def patch\n # do not require these by default, but only when actually patching\n require 'redis'\n require_relative 'tags'\n require_relative 'quantize'\n require_relative 'instrumentation'\n\n ::Redis::Client.include(Instrumentation)\n end", "def needs_rekey?; end", "def run_and_transform; end", "def enable_dependency_loading=(_arg0); end", "def enable_dependency_loading=(_arg0); end", "def initialize\n require 'json'\n optional_gem 'redis'\n end", "def pre_hard_load(mod); end", "def pubsub_adapter; end", "def extensions=(_arg0); end", "def prepended_modules; end", "def direct_dependencies; end", "def promote\n unless redis = shift_argument\n error(\"Usage: heroku redis:promote REDIS\\nMust specify REDIS to promote.\")\n end\n validate_arguments!\n\n config = api.get_config_vars(app).body\n matches = config.keys & [redis || REDIS_PROVIDERS].flatten\n\n case matches.length\n when 0 then error \"No redis add-on found\"\n when 1 then\n display \"Promoting #{matches.first}...\"\n promote_redis(config[matches.first])\n display \"Promoted! Heroku will restart the app.\"\n else error <<-ERROR\nMore than one redis add-on found, please specify one with:\nheroku redis:promote REDIS\n ERROR\n end\n end", "def pre_soft_load(mod); end", "def ready_remix() end", "def pre_install(&block)\n @pre_install_callback = block\n end", "def pry_hooks(ex); end", "def prefetch gems\n end", "def post_install; end", "def before_fork\n yield @resqued\n end", "def custom_sequence_handler\n # For addon ...\n end", "def exec_fix\n super\n end", "def disable_caching=(_arg0); end", "def extension=(_arg0); end", "def extension=(_arg0); end", "def set_compiled_method_cache; end", "def upgrade(version)\n \n end", "def pre_task\n end", "def call\n @from_redis.scan_each(match: \"*\", count: FeatureFlagger::Storage::Redis::SCAN_EACH_BATCH_SIZE) do |redis_key|\n # filter out resource_keys\n next if redis_key.start_with?(\"#{FeatureFlagger::Storage::Redis::RESOURCE_PREFIX}:\")\n\n migrate_key(redis_key)\n end\n end", "def execute_job_ext(worker, args)\n pool = Sidekiq.redis_pool\n item = { 'class' => worker.class, 'args' => args }\n normalized_item = Sidekiq::Client.new(pool).send(:normalize_item, item)\n queue = normalized_item['queue']\n server_middleware = SidekiqUniqueJobs::Middleware::Server::UniqueJobs.new\n\n server_middleware.call(worker, normalized_item, queue, pool) do\n execute_job_orig(worker, args)\n end\n end", "def compression_method=(_arg0); end", "def install_post_hook\n end", "def from_namespace(namespace, &block)\n original_namespace = Resque.redis.namespace\n Resque.redis.namespace = namespace\n\n yield if block_given?\nensure\n Resque.redis.namespace = original_namespace\nend", "def overload_amqp\n require MOQUEUE_ROOT + \"moqueue/overloads\"\n end", "def attach_rb_functions_to_mod_cache(js_mod_name, rb_mod)\n js_mod_name = \"*\" + js_mod_name\n exports_qname = define_cached_module(js_mod_name)\n attach_rb_functions(%Q|#{exports_qname}|, rb_mod)\n exports_qname\n end", "def make_plugin_hash; end", "def plugin_setup!; end", "def counter_cache_enable=(_arg0); end", "def InstallStack\n\n end", "def attach_rb_functions_to_mod_cache(js_mod_name, rb_mod)\n exports_qname = define_cached_module(js_mod_name)\n attach_rb_functions(%Q|#{exports_qname}|, rb_mod)\n exports_qname\n end", "def make_runnable(code)\n return %Q[\nimport webpiraten as garbledwebpiratenlibraryname\nfrom webpiraten import Dir\nfrom webpiraten import Obj\nfrom webpiraten import look\nfrom webpiraten import move\nfrom webpiraten import put\nfrom webpiraten import take\nfrom webpiraten import turn\n\ngarbledwebpiratenlibraryname.configure_prefix(\"#{VM_PREFIX}\")\n\n] + code\n end", "def transformationinterfaceforrepl(*)\n super\n end", "def initialize_redis\n require File.expand_path('../appenders/redis', __dir__)\n end", "def install_dependencies\n raise 'Not implemented'\n end", "def rekey_as_needed; end", "def camaleon_post_clone_on_upgrade(plugin)\n end", "def regenerator; end", "def before_queue(urls)\n # stub\n end", "def register!\n return if @registered\n @registered = true\n\n self.behavior = :notify\n @subscriber = ActiveSupport::Notifications.subscribe(%r{^deprecation}) do |*args|\n queue.enqueue args\n end\n end", "def camaleon_category_order_on_upgrade(plugin)\n end", "def register_reaper_process\n redis { |conn| conn.set(UNIQUE_REAPER, current_timestamp, nx: true, ex: drift_reaper_interval) }\n end", "def activate_inline_deps\n dependency \"RubyInline\", \"~> 3.9\"\n end", "def configure_cache; end", "def post_install\n end", "def preinst\n @package.get_script :preinst\n end", "def gallery_on_upgrade(plugin)\n end", "def base_recipe()\n warn \"#{self} hasn't been overridden to return a Proc!!\"\n lambda {\n # put your capistrano config and tasks in here\n }\n end", "def plugins=(_arg0); end", "def pre_generation_hook(task)\n end", "def pre_process(callback = nil, &block)\n Kicker.pre_process_chain.append_callback(block ? block : callback)\n end", "def extended(a_module)\n end", "def hijacked; end", "def adopt_dependencies\n super if defined? super\n end", "def extended_modules; end", "def extension; end", "def extension; end", "def extension; end", "def extension; end", "def extra_pubish_tasks(p)\n \n end", "def install_dispatch(mod)\n # THREAD CRITICAL BEGIN\n unless @dispatch[mod]\n @dispatch[mod] = true\n # $stderr.puts \"install_dispatch(#{name}) into #{mod}\\n\";\n mod.class_eval(body = <<-\"end_eval\", __FILE__, __LINE__)\ndef #{name}(*args)\n ::#{table.class.name}.instance.dispatch(#{name.inspect}, self, args)\nend\nend_eval\n# $stderr.puts \"install_dispatch = #{body}\"\n end\n # THREAD CRITICAL END\n end", "def transforms; end", "def rexval_modules_hook!\n yield\n end", "def nuixWorkerItemCallbackInit\nend", "def patch_load_current_resource!(provider, version)\n # Create a closure module and inject it.\n provider.extend Module.new {\n # Patch load_current_resource to run our verification logic after\n # the normal code.\n define_method(:load_current_resource) do\n super().tap do |_|\n each_package do |package_name, new_version, current_version, candidate_version|\n # In Chef 12.14+, candidate_version is a Chef::Decorator::Lazy object\n # so we need the nil? check to see if the object being proxied is\n # nil (i.e. there is no version).\n unless candidate_version && (!candidate_version.nil?) && (!candidate_version.empty?) && candidate_version.start_with?(version)\n raise PoiseLanguages::Error.new(\"Package #{package_name} would install #{candidate_version}, which does not match #{version.empty? ? version.inspect : version}. Please set the package_name or package_version provider options.\")\n end\n end\n end\n end\n }\n end", "def wrapper; end", "def camaleon_image_optimizer_on_upgrade(plugin)\n end", "def patch\n # do not require these by default, but only when actually patching\n require 'redis'\n require_relative 'tags'\n require_relative 'quantize'\n require_relative 'instrumentation'\n\n # InstancePatch and ClientPatch allows the client object to access pin on redis instance\n ::Redis.include(InstancePatch)\n ::Redis::Client.include(ClientPatch)\n\n # TODO: To support redis-rb 5.x, Redis::Client -> RedisClient\n ::Redis::Client.include(Instrumentation)\n end", "def enable_dependency_loading; end", "def enable_dependency_loading; end", "def old_redis_key\n @old_redis_key ||= \"sphinx/integration/recent_rt:current\"\n end", "def _postprocess(raw_results,callback)\n if raw_results.is_a?(Redis::Future)\n #\n # Redis::Future have a built-in mechanism for calling a\n # transformation on the raw results.\n #\n # Here, we monkey-patch not the Redis::Future class, but just\n # this one raw_results object. We give ourselves a door to\n # set the post-processing transformation.\n #\n # The transformation will be called only once when the real\n # results are materialized.\n #\n class << raw_results\n def transformation=(transformation)\n raise \"transformation collision\" if @transformation\n @transformation = transformation\n end\n end\n raw_results.transformation = callback\n raw_results\n else\n #\n # If not Redis::Future, we invoke the callback immediately.\n #\n callback.call(raw_results)\n end\n end", "def gen_redis_proto *cmd\n proto = \"*#{cmd.length}\\r\\n\"\n cmd.each { |arg|\n proto << \"$#{arg.bytesize}\\r\\n#{arg}\\r\\n\"\n }\n proto\nend", "def before_export2engine\n \n end", "def pipelined\n if @pipelined\n @redis.pipelined do\n yield\n end\n else\n yield\n end\n end", "def with_optional_dependency\n yield if block_given?\nrescue LoadError # rubocop:disable Lint/SuppressedException\nend", "def with_optional_dependency\n yield if block_given?\nrescue LoadError # rubocop:disable Lint/SuppressedException\nend" ]
[ "0.5497072", "0.54320955", "0.52802294", "0.5263244", "0.5177432", "0.5140445", "0.51394904", "0.5109744", "0.5075031", "0.5073833", "0.50692666", "0.50364727", "0.5034003", "0.50293165", "0.4995952", "0.49938673", "0.49792054", "0.49570453", "0.49433434", "0.49433434", "0.49394804", "0.49226218", "0.4916088", "0.49063703", "0.4904007", "0.4898339", "0.4886812", "0.4878671", "0.48742995", "0.4859337", "0.48490968", "0.48472756", "0.4833823", "0.48323715", "0.48305932", "0.48249385", "0.48157987", "0.48120406", "0.48120406", "0.4802506", "0.47972095", "0.47937056", "0.4779964", "0.47731206", "0.47628006", "0.4758649", "0.47529477", "0.47428915", "0.47377625", "0.47313714", "0.4730082", "0.47247052", "0.47157326", "0.47092128", "0.47054824", "0.47014028", "0.47007284", "0.4700539", "0.46994594", "0.46989015", "0.46938372", "0.46895495", "0.46858233", "0.46801233", "0.46758837", "0.46736422", "0.46736038", "0.46724224", "0.46716136", "0.46711653", "0.46702456", "0.46632957", "0.46572906", "0.4657127", "0.46535653", "0.46465948", "0.46422926", "0.46382245", "0.4633383", "0.4633383", "0.4633383", "0.4633383", "0.4630618", "0.46263334", "0.46262935", "0.46239886", "0.46214208", "0.46212128", "0.46200198", "0.46181235", "0.46178797", "0.46168467", "0.46168467", "0.4614036", "0.46122622", "0.46115214", "0.4609601", "0.46031812", "0.45945382", "0.45945382" ]
0.5610397
0
zset store only uniq elements. But redis queue could have few same elements. So, we should add some uuid to every element
def with_uuid(encoded_item, uuid = SecureRandom.uuid) without_uuid(encoded_item) .then { |item| Serializer.serialize(item, uuid: uuid) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_unique_from_redis\n redis = Redis.new\n keys = redis.scan(0, :match => \"unique*\").last\n redis.del(keys) if !keys.empty?\n end", "def push_unique_payload(conn, payload, queue)\n uniqueue_payload = Sidekiq::Uniqueue.uniqueue_payload(payload)\n serialized_work = Sidekiq.dump_json(payload)\n serialized_unique = Sidekiq.dump_json(uniqueue_payload)\n conn.evalsha push_unique_eval_sha(conn), [queue], [serialized_work, serialized_unique]\n end", "def uniq() end", "def uniq\n :identity\n end", "def uniq!() end", "def set_unique_uuid\n while (uuid.blank?)\n fresh = fresh_uuid\n if ActiveAggregate::EventBase.where(uuid: fresh).present?\n puts \"Event with uuid = #{fresh} found!\"\n else\n self.uuid = fresh\n end\n end\n end", "def uniq\n end", "def uniq\n end", "def map_data_to_uuids\n\t\[email protected]\n\tend", "def uniq(&block)\n append(Unique.new(&block))\n end", "def save_to_most_recent_list\n # potentially, really slow dupe checking\n most_recent_identity = self.class.redis_most_recent_list_identity\n unless $redis.lrange(most_recent_identity, 0, $redis.llen(most_recent_identity)).include? identity\n $redis.lpush(most_recent_identity, identity)\n end\n end", "def unique_key\n \"redis:bitops:#{SecureRandom.hex(20)}\"\n end", "def add_to_cache\n redis.hset 'identifiers', self.typed_id, item.typed_id\n redis.sadd 'identifier:' + item.typed_id, self.typed_id\n end", "def <<(redis_record)\n redis.lpush(base_key, redis_record.key)\n redis.ltrim(base_key, 0, @max_relation_size)\n end", "def next_uuid count = @uuid_batch_count\n @uuids ||= []\n if @uuids.empty?\n @uuids = CouchRest.post(\"#{@uri}/_uuids?count=#{count}\")[\"uuids\"]\n end\n @uuids.pop\n end", "def unique_push!(*elements)\n elements.each do |element|\n self << element unless self.include?(element)\n end\n self\n end", "def uniq_id(*args)\n @uniq_ids[args] || @uniq_ids[args] = (@uniq_id += 1)\n end", "def track\n Redis.current.multi do\n Redis.current.lpush(redis_key, to_json)\n Redis.current.ltrim(redis_key, 0, REDIS_LIMIT)\n end\n end", "def uniq(networkcheckoutput)\n mash = Hashie::Mash.new networkcheckoutput\n #networkcheckoutput.hits.hits.each do |value|\n\n #this creates a dataset of unique values based on a specified field. Need to break the Date out of the timestamp field to use.\n seen = Set.new\n mash.hits.hits.inject([]) do |kept, record|\n\n\n #brokenfield = record._source.src_ip.match(/\\w++ [^_]\\w/)\n\n unless seen.include?(record._source.src_ip)\n kept << record\n seen << record._source.src_ip\n end\n kept\n end\n end", "def hash_record_low_mem! set, rec, duplicate_type\n key = make_key rec, duplicate_type\n\n set << key\nend", "def my_unique\n dict = Hash.new(false)\n self.each_with_index do |el, idx|\n self[idx] = nil if dict[el]\n dict[el] = true\n end\n self.compact!\n end", "def z_list_range(key, start = 0, count = 1)\n handle_pipeline(@redis.zrevrange(key, start, start + count - 1)) { |object|\n list = Array(object).map(&method(:without_uuid))\n\n next list.first if count == 1\n\n list\n }\n end", "def sadd\n @redis.sadd md5_list, @md5_sum\n end", "def push_uuid(data)\n data[\"id\"].blank? &&\n data[\"uuid\"].present? ?\n data.merge(\"id\" => data[\"uuid\"]) :\n data\n end", "def uniq_ints()\n []\n end", "def hash #:nodoc:\n uuid.hash\n end", "def uniq(input, property = T.unsafe(nil)); end", "def my_uniq\n unique = []\n self.each do |ele|\n unique << ele if !unique.include?(ele)\n end\n unique\n end", "def set_redis(resource:, query:, simple_id:)\n \n case resource\n when 'song'\n resource_ids = Song.where('lower(song_title) LIKE ?', \"%#{query}%\").all.map(&:id)\n when 'album'\n resource_ids = Album.where('lower(album_title) LIKE ?', \"%#{query}%\").all.map{|album| album.songs.map(&:id)}.flatten\n when 'artist'\n resource_ids = Artist.where('lower(name) LIKE ?', \"%#{query}%\").all.map{|artist| artist.songs.map(&:id)}.flatten\n end\n \n $redis.set(simple_id, resource_ids.to_json)\n $redis.expire(simple_id, 12.hour.to_i)\n resource_ids.to_json\n end", "def generate_uuid\n Digest::SHA2.hexdigest(\"#{@queue}#{encode(payload)}#{Time.now.to_i}\")\n end", "def uniq(*arguments, &block)\n dup.uniq!\n end", "def save_single_zip_to_redis(zip_url,redis)\n file = open(zip_url)\n Zip::File.open(file) do |zip_file|\n zip_file.each do |entry|\n #looks like there are duplicates with slight differences in username, posts, comments etc\n #I can make them unique by cutting out by discussion title, discussion title+forum, etc as key.\n #otherwise, if I can assume each unique xml filename is a unique instance that we want I can just use that as key\n redis.set(entry.name, entry.get_input_stream.read)\n p entry.name\n p entry.get_input_stream.read\n p entry\n puts \"\"\n end\n end\nend", "def add(elem)\n return if @non_uniq.include? elem\n if @uniq.include? elem\n @uniq.delete elem\n @non_uniq.add elem\n else\n @uniq.add elem\n end\n end", "def push_queue_push val\n return nil if self.push_queue_names.length == 0\n key = self.push_queue_names[rand(self.push_queue_names.length - 1)]\n self.debug_out \"pushing data onto push queue #{key}\"\n @redis.lpush key, Marshal.dump(val)\n key\n end", "def uniq(&block)\n _uniq(::Set.new, &block)\n end", "def find_uniqable!(uid)\n where_uniqable(uid).take!\n end", "def received_uniq_leaderbit_ids\n Rails.cache.fetch(\"#{__method__}/#{cache_key_with_version}\") do\n query = <<-SQL.squish\n SELECT \"leaderbit_logs\".\"leaderbit_id\" FROM \"leaderbit_logs\"\n WHERE \"leaderbit_logs\".\"user_id\" = #{id}\n UNION SELECT \"user_sent_emails\".\"resource_id\" FROM \"user_sent_emails\"\n WHERE \"user_sent_emails\".\"type\" = #{ActiveRecord::Base.connection.quote UserSentScheduledNewLeaderbit}\n AND \"user_sent_emails\".\"resource_type\" = #{ActiveRecord::Base.connection.quote Leaderbit}\n AND \"user_sent_emails\".\"user_id\" = #{id}\n SQL\n\n ActiveRecord::Base.connection.execute(query).values.flatten\n end\n end", "def unique=(val)\n self['unique'] = val\n end", "def save!\n $redis.hset RedisContainer, self.full_name, self.to_json\n end", "def uniq!\n im = Rubinius::IdentityMap.from self\n return if im.size == size\n\n Rubinius.check_frozen\n\n array = im.to_array\n @tuple = array.tuple\n @start = array.start\n @total = array.total\n\n self\n end", "def add_uuid\n self.uuid ||= UUIDTools::UUID.timestamp_create().to_s\n end", "def unique\n self['unique']\n end", "def reserve(limit: 1000)\n record_ids = Set.new\n while record_ids.size < limit && (record_id = Searchkick.with_redis { |r| r.rpop(redis_key) })\n record_ids << record_id\n end\n record_ids.to_a\n end", "def uniqify_fields\n begin\n self.uniq_title = self.title.to_uniq\n self.uniq_position = self.position.to_uniq\n self.uniq_playbacks_count = self.playbacks_count.to_uniq\n self.uniq_likes_count = self.likes_count.to_uniq\n self.uuid = UUIDTools::UUID.timestamp_create().to_s if self.uuid.nil?\n rescue\n end\n end", "def update_unique_ids(env, content); end", "def keys\n @redis.keys(@list + '*').reject { |s| s.end_with? '_MD5' }\n end", "def dump\n current_size = size\n dumped_items = redis.lrange list_id, 0, current_size - 1\n redis.ltrim list_id, current_size, size - 1 \n dumped_items\n end", "def uniq\n dup.uniq! or dup\n end", "def unique\n return @logs_unique unless @logs_unique.nil?\n\n # Store unique IPs\n @logs_unique = {}\n @logs.each do |log|\n if @logs_unique.has_key? log.url\n @logs_unique[log.url].add(log.ip)\n else\n @logs_unique[log.url] = Set.new([log.ip])\n end\n end\n\n # Count unique IPs\n @logs_unique.each {|url, ip_set| @logs_unique[url] = ip_set.size}\n\n # Inject order method if someone wants to get ordered results\n # TODO ideally it should have the same return type as `unique`\n def @logs_unique.order(direction)\n direction = direction[:views] || :desc\n arr = sort_by {|url, views| views}\n\n direction == :asc ? arr : arr.reverse\n end\n\n @logs_unique\n end", "def using_uniq(array)\n\n \nend", "def uniq\n uniq_vector = @data.uniq\n new_index = uniq_vector.inject([]) do |acc, element| \n acc << index_of(element) \n acc\n end\n\n Daru::Vector.new uniq_vector, name: @name, index: new_index, dtype: @dtype\n end", "def atomic_array_add_to_sets\n @atomic_array_add_to_sets ||= {}\n end", "def unique_id\n # check all_data instead of data, as we have to not reuse deleted key\n ids = Set.new(all_data.map { |e| e[:key] })\n id = 1\n loop do\n return id.to_s unless ids.include?(id.to_s)\n id += 1\n end\n end", "def uuid; end", "def uuid; end", "def next_uuid(count = @uuid_batch_count)\n @uuids ||= []\n if @uuids.empty?\n @uuids = IbmCloudRest.get(\"#{@uri}/_uuids?count=#{count}\")[\"uuids\"]\n end\n @uuids.pop\n end", "def uniq\n distinct\n end", "def queue_key\n Digest::SHA256.hexdigest(queues.sort.join(\";\"))\n end", "def enqueue\n redis.multi do\n enqueue_non_atomically\n end\n end", "def recordInAll id\n\t0.upto(@toRemove.length - 1) { |i|\n\t\t\t@toRemove[i] << id\n\t}\nend", "def generate_unique_id\n Digest::SHA256.hexdigest unique_id_elements.join\n end", "def asigna_redis_id\n # El 2 inicial es para saber que es un region\n # El 0 en la segunda posicion denota que es un estado\n # Y despues se ajusta a 8 digitos el numero de estado, para dar un total de 10 digitos\n self.redis = {} unless redis.present?\n self.redis[\"id\"] = \"20#{region_id.to_s.rjust(8,'0')}\".to_i\n end", "def find_uniqable(uid)\n where_uniqable(uid).take\n end", "def add_to_list\n return if exists?\n @redis.lpush list, @data\n sadd\n end", "def uniq_by!(&block)\n ActiveSupport::Deprecation.warn 'uniq_by! is deprecated. Use Array#uniq! instead'\n uniq!(&block)\n end", "def uniq\n hsh = {}\n if block_given?\n each{|v| hsh[yield(v)] = 1 }\n else\n each{|v| hsh[v] = 1 }\n end\n hsh.keys\n end", "def uniq!( header )\n data.uniq!( header ); self\n end", "def test_no_duplicate_id\n dup = {\"_id\" => \"foo\", :_id => \"foo\"}\n one = {\"_id\" => \"foo\"}\n\n assert_equal @encoder.serialize(one, false, true).to_a, @encoder.serialize(dup, false, true).to_a\n end", "def add_to_history history_key,inputed_at=nil\n zset_key=DemandHistory.generate_zset_key self.clientId,self.supplierId,self.relpartId,self.type,self.date\n $redis.zadd(zset_key,(inputed_at||Time.now.to_i),history_key)\n end", "def add_to_redis_list(captured_content)\n begin\n @redis.rpush(@event_list,captured_content[\"name\"])\n puts @redis.lrange(@event_list, 0, -1 )\n rescue Exception => e\n puts e.message\n end\n end", "def hash\n \tcustom_unique_id.hash\n end", "def without_uuid(item)\n Serializer.extract(item, :uuid).fetch(:rest)\n end", "def uuid() = @uuid ||= SecureRandom.uuid", "def tag_processed(hash, keys) \n # Generate a flat md5 of the keys in question\n md5 = generate_md5(hash, keys)\n $logger.info \"MD5 Generated: #{md5}\"\n previous = redis.getset(md5, 1).to_i\n $logger.info \"Previous Redis Value: #{previous}\"\n # Set the TTL on the key\n redis.expire(md5, @ttl)\n previous\n end", "def set_order_uid\n return if uid.present?\n begin\n self.uid = SecureRandom.uuid\n end while self.class.exists?(uid: self.uid)\n end", "def unique_temp\n \"$TMP_#{@unique += 1}\"\n end", "def set(arr)\n\treturn arr.uniq\nend", "def garbage_collect_uuids\n Uuidify::Uuid.where(:model_name => self.to_s).find_each do |uuid|\n if !where(:id => uuid.model_id).first\n uuid.destroy\n end\n end\n end", "def generate_ids\n uuid = UUID.new\n self.id = uuid.generate\n end", "def uniq_by!(&block)\n ActiveSupport::Deprecation.warn 'uniq_by! is deprecated. Use Array#uniq! instead', caller\n uniq!(&block)\n end", "def multi_zset(key, pairs)\n mon_synchronize do\n perform [\"multi_zset\", key, *pairs.to_a].flatten, :proc => T_INT\n end\n end", "def asigna_redis_id\n # El 2 inicial es para saber que es un region\n # El 2 en la segunda posicion denota que es una ANP\n # Y despues se ajusta a 8 digitos, para dar un total de 10 digitos\n self.redis = {} unless redis.present?\n self.redis[\"id\"] = \"22#{region_id.to_s.rjust(8,'0')}\".to_i\n end", "def add_post_to_newest_list\n $redis.lpush(\"newest_post_ids\", id)\n $redis.ltrim(\"newest_post_ids\", 0, 99)\n RedisWorker.perform_async(id)\n end", "def uniq\n uniq_vector = @vector.uniq\n new_index = uniq_vector.inject([]) do |acc, element| \n acc << index_of(element) \n acc\n end\n\n Daru::Vector.new uniq_vector, name: @name, index: new_index, dtype: @dtype\n end", "def set_uuid\n self.uuid = SecureRandom.uuid\n end", "def set_uuid\n self.uuid = SecureRandom.uuid\n end", "def asigna_redis_id\n # El 2 inicial es para saber que es un region\n # El 1 en la segunda posicion denota que es un municipio\n # Y despues se ajusta a 8 digitos, para dar un total de 10 digitos\n self.redis = {} unless redis.present?\n self.redis[\"id\"] = \"21#{region_id.to_s.rjust(8,'0')}\".to_i\n end", "def register_all(queue)\n SideJob.redis.multi do |multi|\n multi.del \"workers:#{queue}\"\n multi.hmset \"workers:#{queue}\", @registry.map {|key, val| [key, val.to_json]}.flatten(1) if @registry.size > 0\n end\n SideJob::Port.group(log: false) do\n SideJob.publish \"/sidejob/workers/#{queue}\", @registry\n end\n end", "def num_uniq\n Set[*self].size\n end", "def push_dup\n push(@store.last) if size > 0\n end", "def my_uniq(arr)\n \n output = []\n hash = Hash.new(false)\n \n arr.each do |x|\n output << x if !hash[x]\n hash[x] = true\n end\n output\n end", "def make_uniq_by(&block)\n result = []\n self.each do |e|\n unless result.any?{|x| yield(x,e)} then result.push(e) end\n end\n return result\n end", "def redis_pool=(_arg0); end", "def uniq_index\n\t\t\t\tcreate_property :in, type: :link, linked_class: :V\n\t\t\t\tcreate_property :out, type: :link, linked_class: :V\n\t\t\t\tcreate_index \"#{ref_name}_idx\", on: [ :in, :out ]\n\t\t\tend", "def unique\n lambda do |rec, acc|\n acc.uniq!\n end\n end", "def uniq(array)\nend", "def multi_zset(key, pairs)\n mon_synchronize do\n perform [\"multi_zset\", key, *pairs.to_a].flatten, proc: T_INT\n end\n end", "def each_uuid\n @uuids.select {|u| !@connections[u].nil?}.each do |uuid|\n yield uuid\n end\n end", "def assign_uuid\n self.uuid ||= SecureRandom.urlsafe_base64(8)\n end", "def uniquify\n super\n subcontainers.each { |ctr| ctr.uniquify }\n end" ]
[ "0.61004", "0.5999087", "0.5997439", "0.5977999", "0.5958174", "0.57865757", "0.5760568", "0.5760568", "0.5720658", "0.5575801", "0.5559301", "0.5534899", "0.55315816", "0.55221695", "0.55065435", "0.55040324", "0.54772705", "0.54653394", "0.54578716", "0.5432307", "0.5387189", "0.53794885", "0.5371153", "0.53585696", "0.5353636", "0.5348226", "0.5329505", "0.5329172", "0.5328159", "0.5318363", "0.5315165", "0.5313809", "0.5304888", "0.5300909", "0.52983165", "0.52942914", "0.52530247", "0.5249843", "0.52415127", "0.5239129", "0.5236325", "0.5235576", "0.52324456", "0.5222762", "0.5206369", "0.52052003", "0.52041537", "0.52014035", "0.51967746", "0.51746666", "0.5173964", "0.51645654", "0.51633596", "0.51568913", "0.51568913", "0.51542085", "0.5146575", "0.51295245", "0.5128962", "0.5124462", "0.5119556", "0.5116195", "0.511377", "0.51047504", "0.5101034", "0.50935215", "0.50907373", "0.50896555", "0.50865453", "0.5086067", "0.50803554", "0.5076526", "0.5073126", "0.5069774", "0.50640935", "0.506136", "0.5047581", "0.5038225", "0.5036195", "0.5035457", "0.5032317", "0.5031672", "0.50263816", "0.5022266", "0.5020256", "0.5020256", "0.5012175", "0.5005704", "0.5001758", "0.49989134", "0.4998298", "0.49949673", "0.4994098", "0.4988127", "0.49855518", "0.49714977", "0.49701712", "0.49683428", "0.49552855", "0.49539125" ]
0.54641885
18
Remove uuid from item. See `with_uuid` method
def without_uuid(item) Serializer.extract(item, :uuid).fetch(:rest) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def with_uuid(encoded_item, uuid = SecureRandom.uuid)\n without_uuid(encoded_item)\n .then { |item| Serializer.serialize(item, uuid: uuid) }\n end", "def remove_item(id:)\n order.items.destroy(id)\n end", "def remove_item(id)\n @items.delete_at(id)\n end", "def remove_item(item_id)\n @items.delete_if { |item| item.id.to_i == item_id.to_i}\n end", "def remove_item(item)\r\n items.delete(item)\r\n item.owner = nil\r\n end", "def delete_by_uuid uuid\n deliberately_unscoped(Webhook).where(uuid: uuid).destroy\n end", "def remove_item(item)\n @items.delete(item)\n end", "def remove_item\n\n end", "def remove_document_by_uuid(uuid)\n @documents.delete(uuid)\n end", "def remove_item(item)\n return unless @items.key? item\n\n @items.delete item\n @version += 1\n end", "def remove_item(item)\n index = @list.index(item)\n remove_item_at(index)\n end", "def remove_item(id)\n return nil if self.class.mode == :sandbox\n\n query = { \"type\" => \"delete\", \"id\" => id.to_s, \"version\" => Time.now.to_i }\n doc_request query\n end", "def remove_item(hash, item)\n hash.delete(item)\nend", "def unsubscribe(uuid)\n post_json(\"#{endpoint}/unsubscribe/#{uri_encode(uuid)}\")\n end", "def unsubscribe(uuid)\n post_json(\"#{endpoint}/unsubscribe/#{uri_encode(uuid)}\")\n end", "def remove_item(item, hash)\n hash.delete(item)\n return hash\nend", "def remove!\n self.class.removed(item)\n end", "def remove_item(hash, item)\n hash.delete(item)\n hash\nend", "def remove_item(hash, item)\n hash.delete(item)\n hash\nend", "def strip_dashes(uuid)\n uuid.delete(\"-\")\n end", "def remove_item(hash, item)\n hash.delete(item)\n return hash\nend", "def cleanup(uuid)\n Util.validate(uuid, 'UUID', UUID_PATTERN)\n uuid.downcase.strip\n end", "def delete_item(item)\r\n @list.delete(item)\r\n end", "def remove_item(hash, item)\r\n\thash.delete(item)\r\n\thash\r\nend", "def remove_item(item)\n if !@item\n log(\"Nothing is equipped in that EquipSlot.\")\n return\n end\n if @item != item\n log(\"Item being removed from EquipSlot is not the same as already equipped item.\")\n return\n end\n @item = nil if @item == item\n return\n end", "def clear_avatar_image_url_with_uuid(uuid)\n raise ArgumentError, \"'uuid' is required and cannot be blank\" if uuid.blank?\n if self.avatar_image_url.to_s.match(/#{uuid}/)\n self.avatar_image_url = nil\n self.save\n end\n end", "def delete_item(item)\n @get_items.delete(item)\n end", "def remove_item (item)\n item_hash[item].delete\nend", "def remove_item(list, item_removed)\n list.delete(item_removed)\nend", "def remove_item(item, hash)\n hash.delete(item)\n return hash\nend", "def remove_item(item_to_be_removed)\n $groceryhash.delete(item_to_be_removed)\nend", "def remove(item)\r\n loc = location_of(item)\r\n loc.remove(item)\r\n end", "def unlinkItem _obj, _args\n \"_obj unlinkItem _args;\" \n end", "def remove(purchase)\n entry = find_item(purchase)\n destroy(entry) if entry\n end", "def remove_item(item_id)\n fail \"There are no items\" if @items.size == 0\n fail \"No such item with id #{item_id}\" unless @items.member?(item_id)\n @items.delete_if { |id, item| item.id == item_id }\n end", "def remove_item(hash, item_name)\r\n hash.delete(item_name)\r\n hash\r\nend", "def delete(name: nil, uuid: nil)\n raise ArgumentError if name && uuid\n raise ArgumentError, 'UUID not implemented' unless name\n new_tags = [@json['tags'].find { |ent| ent['name'] != name }].flatten\n @json['tags'] = new_tags\n end", "def remove(item, hash)\n hash.delete(item)\nend", "def remove_item(user, item)\n before = get_item_count\n self.items.delete(item)\n after = get_item_count\n (before-after-1).times do\n user.add_to_list(item)\n end\n end", "def remove(item)\r\n @contents.delete(item)\r\n end", "def remove_item(list, item)\n list.delete(item)\nend", "def remove_item(list, item)\n list.delete(item)\nend", "def remove_item(hash_of_items, item)\n hash_of_items.delete(item)\n hash_of_items\nend", "def item_from_uuid(id)\n @items.find { |i| i[:id].to_s == id } || raise(\"Unable to resolve item for uuid '#{id}'\")\n end", "def remove_item(list, item)\n list.delete(item)\nend", "def remove_item (list, item)\n list.delete(item)\nend", "def delete_item(item)\n unless item.nil?\n @items.delete(item.to_s.downcase)\n end\n @items\n end", "def remove_item (list, item)\n list.delete(item)\nend", "def remove(item)\n cart_items.where(item_id: item.id).first.try(:destroy)\n end", "def remove_item(list, item)\n list.delete(item)\nend", "def destroyItem(id)\n item = List.find(id)\n item.destroy\n end", "def remove_item(list, item_remove)\n list.delete(item_remove)\nend", "def olduuid uuid\n\trf = uuid\n\trf.insert(8, \"-\")\n\trf.insert(13, \"-\")\n\trf.insert(18, \"-\")\n\trf.insert(23, \"-\")\n\treturn rf\nend", "def remove_item(g_hash,item)\n g_hash.delete(item)\nend", "def remove_item(g_hash,item)\n g_hash.delete(item)\nend", "def remove_item(list, item)\n\tlist.delete(item)\nend", "def set_uuid\n self.uuid = SecureRandom.uuid\n end", "def set_uuid\n self.uuid = SecureRandom.uuid\n end", "def remove_at(idx)\n @todos.delete(item_at(idx))\n end", "def remove_item(list_items, item_name)\n list_items.delete(item_name)\nend", "def remove(item)\n if @hash.include?(item)\n @hash.delete(item)\n item\n else\n nil\n end\n end", "def remove_item(list, item_name)\n list.delete(item_name)\nend", "def remove_item(opts = {})\n data, _status_code, _headers = remove_item_with_http_info(opts)\n data\n end", "def remove!(item)\n @queue.delete(item)\n end", "def remove(instance)\n @registry.each_with_index do |item, i|\n if item.to_h == instance.to_h\n @registry.delete_at(i)\n end\n end\n sync\n end", "def removeItem _obj, _args\n \"_obj removeItem _args;\" \n end", "def remove_item(item_list, item)\r\n item_list.delete(item)\r\n item_list\r\nend", "def remove_from_cache\n redis.hdel 'identifiers', self.typed_id\n redis.srem 'identifier:' + item.typed_id, self.typed_id\n end", "def remove_item(hash,item)\n\tif hash[\"#{item}\"] == hash[\"#{item}\"]\n\t\thash.delete(\"#{item}\")\n\telse puts\n\t\t\"Invalid item\"\n\tend\n\treturn hash\nend", "def remove_item(hash, item)\n if hash.has_key?(item)\n hash.delete(item)\n end\n return hash\nend", "def pbUnregisterItem(item)\n if item.is_a?(String) || item.is_a?(Symbol)\n item = getID(PBItems,item)\n end\n if !item || item<1\n raise ArgumentError.new(_INTL(\"Item number {1} is invalid.\",item))\n return\n end\n registeredlist = self.registeredItems\n if registeredlist.include?(item)\n for i in 0...registeredlist.length\n if registeredlist[i]==item\n registeredlist[i] = nil\n break\n end\n end\n registeredlist.compact!\n end\n end", "def remove_item(item, list)\n list.delete(item)\nend", "def remove_item(list, item_name)\n\tlist.delete_if { |item, quantity| item === item_name }\nend", "def delete_item(item_id)\n raise \"implemented in subclass\"\n end", "def delete_item(hash, item)\n\thash.delete(item)\n\treturn hash \nend", "def teardown\n FileUtils.rm_rf(File.join('/tmp', @uuid))\n end", "def remove(hash, item)\n hash.delete(item)\nend", "def remove(hash, item)\n hash.delete(item)\nend", "def remove_item(list,item)\n\tlist.delete(item)\nend", "def removePrimaryWeaponItem _obj, _args\n \"_obj removePrimaryWeaponItem _args;\" \n end", "def destroy_item_at(position)\n # TODO Stubbed - Requires definition and implementation\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 remove_item(list, item)\n list.delete(item)\n list\nend", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def populate_uuid\n self.uuid = SecureRandom.uuid()\n end", "def remove_item(list, item)\n list.delete(item)\n return list\nend", "def del_item(list, item_to_del)\n list.delete(item_to_del)\nend", "def destroy(item)\n raise StandardError unless @mode == :update\n @attached.delete(item)\n @remove_file.puts(XML.generate({ :id => item.is_a?(String) ? item : item.id }, false))\n end", "def uuid?(item)\n item.to_s.match?(UUID_FORMAT)\n end", "def destroy\n @item.destroy!\n end", "def delete_item(item)\n @chores.delete(item)\n end", "def removeHandgunItem _obj, _args\n \"_obj removeHandgunItem _args;\" \n end", "def remove(itemkey)\n # :nocov:\n raise \"Forgotten implementation\"\n # :nocov:\n end", "def destroy_item_at(position)\n # TODO Stubbed - Requires definition and implementation\n end", "def remove_item(list, item)\r\n list.delete(item)\r\n list\r\nend", "def remove_item(list, item)\n list.delete(item)\n return list\nend", "def release_item(item)\n if self.items.include?(item)\n item.owner = nil\n self.items.delete(item)\n end\n end" ]
[ "0.6722437", "0.65494317", "0.65238476", "0.6312063", "0.6298739", "0.62261593", "0.6216924", "0.6081139", "0.6037604", "0.60075015", "0.5982403", "0.5962084", "0.591718", "0.5884895", "0.5884895", "0.5881425", "0.5859742", "0.5825744", "0.5825744", "0.5825055", "0.5819777", "0.58145803", "0.58117723", "0.5800324", "0.5762168", "0.57603323", "0.5756096", "0.57463825", "0.57313955", "0.5730756", "0.57249093", "0.5721351", "0.5710412", "0.5710169", "0.5697947", "0.56915045", "0.5691062", "0.5689295", "0.5665811", "0.5658336", "0.56549007", "0.56549007", "0.56494665", "0.56487757", "0.5648065", "0.5643891", "0.5643713", "0.5632119", "0.56261545", "0.56244594", "0.5620161", "0.56049436", "0.5592485", "0.55849934", "0.55849934", "0.55835146", "0.5572675", "0.5572675", "0.55645806", "0.5558565", "0.5550673", "0.5547546", "0.5527003", "0.5525815", "0.55197364", "0.55173856", "0.551194", "0.5506778", "0.55061543", "0.5502994", "0.5501883", "0.54972696", "0.54914886", "0.5491309", "0.54899263", "0.54854167", "0.5477765", "0.5477765", "0.5476802", "0.54602885", "0.54597956", "0.5451599", "0.54463315", "0.54463315", "0.54463315", "0.54463315", "0.544566", "0.543956", "0.5437967", "0.5433989", "0.543203", "0.54267216", "0.5424283", "0.54242164", "0.5419994", "0.54199684", "0.5419894", "0.54178935", "0.54157996", "0.5414042" ]
0.75625235
0
Check by type. If type is zset queue is prioritized. In other cases work like it was before
def prioritized?(queue) queue = queue.to_s if @redis.client.is_a?(Redis::Pipeline) # To prevent unexpected values inside result block return queue.include?(Prioritize.prioritized_queue_postfix) end queue = queue.include?('queue:') ? queue : redis_key_for_queue(queue) queue_type = @redis.type(queue) # With type check we will handle the cases when queue postfix was renamed during # the work. So, it is the better practise. However, it doesn't work for empty queues. queue_type == 'zset' || \ # In case when queue is empty on type check, but not empty on the action (pop, in # the most cases), we could have an error. # So, in that cases we should check queue type by name. (queue_type == 'none' && queue.include?(Prioritize.prioritized_queue_postfix)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_a_priority_queue?\n @@queue_types ||= {}\n (@@queue_types[@redis_name] ||= queue_type) == 'zset'\n end", "def queue_size(queue)\n prioritized?(queue) ? z_queue_size(queue) : super\n end", "def in_queue?\n depq_or_subpriority().kind_of? Depq\n end", "def pop_from_queue(queue)\n prioritized?(queue) ? z_pop_from_queue(queue) : super\n end", "def entry_queues\n qs = Bluth.priority.collect { |qname| self.send qname }\n if defined?(Bluth::TimingBelt)\n notch_queues = Bluth::TimingBelt.priority.collect { |notch| notch.queue }\n qs.insert 1, *notch_queues\n end\n qs\n end", "def remove_from_queue(queue, data)\n prioritized?(queue) ? z_remove_from_queue(queue, data) : super\n end", "def lower_item_in_queue\n return nil unless in_queue?\n acts_as_queue_class.find(:first, :conditions =>\n \"#{queue_scope_condition} AND #{queue_position_column} = #{(send(queue_position_column).to_i + 1).to_s}\"\n )\n end", "def queues\n @queues[0] == \"*\" ? RockQueue.queues : @queues\n end", "def dequeue_level\n if @queue_priority.any?\n lvl = @queue_priority.deq\n elsif @queue_normal.any?\n lvl = @queue_normal.deq\n # else\n # nil\n end\n end", "def depq\n in_queue? ? depq_or_subpriority() : nil\n end", "def first_in_queue?\n return false unless in_queue?\n self.send(queue_position_column) == 1\n end", "def normal_priority?\r\n @priority_type == 1\r\n end", "def above?(type)\n (!config[:below]) && (@data > config[type])\n end", "def queue(file, type)\n label = run_cmd(cmd(\"getlabel\", file)).join(\"\\n\").strip\n \n if label != COPIED\n if type == :music\n queue_music(file)\n elsif type == :video\n queue_video(file)\n end\n end\nend", "def queue\n @queue ||= produce_queue\n end", "def initial_queue_for(processing_queue, data, options = {})\n if has_external_dependencies_for?(data)\n return Pipeline::AWAITING_EXTERNAL_DEPENDENCY_QUEUE\n end\n\n options_queue = options[:queue]\n return options_queue if options_queue && processing_queue == :plines\n\n processing_queue\n end", "def rt_queue\n return(self.lang == 'en_US' ? queue : self.lang)\n end", "def _q\n @queue||=[]\n end", "def test_orderOfElements\n @queue.enqueue(100)\n @queue.enqueue(200)\n assert_equal( 100, @queue.dequeue )\n assert_equal( 200, @queue.dequeue )\n end", "def queue\n @queue ||= QueueManager.fetch(@name,@visibility)\n end", "def queue_scope_condition() \"1\" end", "def below?(type)\n config[:below] && @data < config[type]\n end", "def queue(_); end", "def queue(_); end", "def queue() = @queue ||= CommandQueue.new", "def should_enque?(time)\n return false if disabled?\n return false if not_pass_next_enqueue_time?(time)\n\n # support old data without next_enqueue_timestamp\n return false if did_pass_prev_enqueue_time?(time)\n\n true\n end", "def by_type(type)\n processors.values.detect { |v| v.prefix == type&.upcase }\n end", "def higher_item_in_queue\n return nil unless in_queue?\n acts_as_queue_class.find(:first, :conditions =>\n \"#{queue_scope_condition} AND #{queue_position_column} = #{(send(queue_position_column).to_i - 1).to_s}\"\n )\n end", "def peek; @queue[-1] end", "def queue; end", "def queue; end", "def queue_by_name(name)\n matched = nil\n queues.each_value { |queue| matched = queue if queue.name == name }\n matched\n end", "def queued?\n dj.present?\n end", "def queued?\n @queued\n end", "def queueable(queue = nil)\n scope = where(state: :created).order('jobs.id')\n scope = scope.where(queue: queue) if queue\n scope\n end", "def by_priority; end", "def waiting_in_queue_state?(state)\n [:wait_in_queue, :wait_queue_pos].include? state\nend", "def is_prior_to(elem)\n return nil if self == elem\n elem.higher_priority_elements << self\n self.lower_priority_elements << elem\n true\n end", "def supports_prio?\n true\n end", "def call(worker_class_name)\n ss = Sidekiq::ScheduledSet.new\n rs = Sidekiq::RetrySet.new\n qs = Sidekiq::Queue.new(\"default\")\n\n [ss, rs, qs].any? { |s| s.any? { |j| (j.klass == worker_class_name) } }\n end", "def check_queue\n # The interesting options hash for our new work query\n check = {\n :deliver_at => {'$lte' => Time.now.utc},\n :result => {'$exists' => false},\n :locked => {'$exists' => false}\n }\n Candygram.queue.find(check).to_a\n end", "def check_type\n \t self.type = TYPES[0] if !TYPES.include?(self.type)\n\t end", "def get_queues\n @gem_queue = get_queue 'gem'\n @md5_queue = get_queue 'md5'\n @sha512_queue = get_queue 'sha512'\n end", "def insert_front(value)\n if @queue.size < @size\n @queue.unshift(value)\n true\n else\n false\n end\n end", "def check_queue_params(type, queue, connection)\n if type == \"entry\" || type == \"exit\"\n if queue.nil? || !connection.nil?\n raise ArgumentError, \"Event type is #{type} but queue is nil or connection isn't\"\n end\n else\n if queue.nil? || connection.nil?\n raise ArgumentError, \"Event type is #{type} but connection is nil or queue is nil\"\n end\n end\n end", "def queued?\n @state == STATE_QUEUED\n end", "def queued?\n status.queued?\n end", "def peek\n if empty?\n nil\n else\n tempArr = []\n while @queue.size > 1\n tempArr.push(@queue.remove)\n end\n tempItem = @queue.remove\n while !tempArr.empty?\n @queue.insert(tempArr.pop)\n end\n @queue.insert(tempItem)\n tempItem\n end\n end", "def test_peekOnNonEmptyQueue\n @queue.enqueue(100)\n assert_equal( 100 , @queue.peek )\n end", "def queue\n @queue ||= Queue.new\n end", "def enqueue(el)\n @queue.push(el)\n true\n end", "def should_queue?\n @options[:offline_queueing] && @offline_handler.queueing?\n end", "def test_isEmptyOnNonEmptyQueue\n @queue.enqueue(100)\n assert_equal( false , @queue.empty? )\n end", "def queued?\n attributes['status'] == 3\n end", "def peek\n\t\[email protected]\n\tend", "def sort_request(request_type)\n request_type && abnamro? ? \"_#{request_type.to_s}\" : nil\n end", "def queue(*args)\n @queue = args.first unless args.empty?\n (@queue || :default).to_s\n end", "def signal_init(name, origin)\n if(waiters[name])\n cache_signals ||\n origin == :wait ||\n (origin == :signal && !waiters[name][:threads].empty?)\n else\n if(origin == :wait || (origin == :signal && cache_signals))\n waiters[name] = Smash.new(\n :queue => Queue.new,\n :threads => []\n )\n true\n else\n false\n end\n end\n end", "def move_lower_in_queue\n return unless lower_item_in_queue\n\n acts_as_queue_class.transaction do\n lower_item_in_queue.decrement_queue_position\n increment_queue_position\n end\n end", "def test_peekOnEmptyQueue\n assert_equal( nil, @queue.peek )\n end", "def personal_queue\n unless (local_queues = self.queues).empty?\n local_queues[0]\n end\n end", "def queues\n Thread.current[:queues] == \"*\" ? Resque.queues.sort : Thread.current[:queues].split(',')\n end", "def queues\n Thread.current[:queues] == \"*\" ? Resque.queues.sort : Thread.current[:queues].split(',')\n end", "def add_to_DJ_queue(type)\n if Delayed::Job.find_by_queue(type).nil?\n t = Time.now\n run_time =\n if type == :weekly\n t.end_of_week\n else\n t.end_of_day\n end\n\n EmailDigest.delay(queue: type, run_at: run_time).send_emails(type)\n end\n end", "def enqueued?\n !!@handle\n end", "def test_dequeueOnEmptyStack\n assert_equal( nil , @queue.dequeue )\n end", "def in_queue?\n !send(queue_position_column).nil?\n end", "def default?\n self.class == Fizzy::Sync.available.last\n end", "def setup_queue\n queue = Queue.find self.queue_name\n unless queue\n queue = Queue.create _id: self.queue_name\n end\n end", "def queued?\n PlayQueue.songs.include?(self)\n end", "def get_block_type(x, y, z)\n return cache[x][y][z] if cache[x][y][z].eql? :uncached\n return (is_block_at?(x, y ,z) ? :block : nil)\n end", "def before_enqueue_check_lock_availability(*args)\n # Second condition handles the case when the job is already queueing\n # (was allowed to put in queue at the moment of scheduling), and now scheduler moves it\n # from future schedule to queue; if we'll not allow this, job will be lost.\n Resque.inline? || call_from_scheduler? || job_available_for_queueing?(args)\n end", "def move_to_top_in_queue\n return unless in_queue?\n acts_as_queue_class.transaction do\n increment_queue_positions_on_higher_items\n assume_top_queue_position\n end\n end", "def inQueue\n return @bodyStart < 0\n end", "def queue(queue = 'default')\n get_queue(queue)\n end", "def force_queue_to_vimeo\n self.queue_transfer_to_vimeo(true)\n true\n end", "def queue_request(kind, type, payload, target, callback)\n request = {:kind => kind, :type => type, :payload => payload, :target => target, :callback => callback}\n Log.info(\"[offline] Queuing request: #{request.inspect}\")\n vote_to_restart if (@restart_vote_count += 1) >= MAX_QUEUED_REQUESTS\n if @state == :initializing\n # We are in the initialization callback, requests should be put at the head of the queue\n @queue.unshift(request)\n else\n @queue << request\n end\n true\n end", "def supports_prio?\n false\n end", "def installed_adapters_of_type(type)\n (adapters[type] || []).select { |a| a.carrier_demand.positive? }\n end", "def setup_queues\n setup_identity_queue\n setup_shared_queue if @shared_queue\n true\n end", "def queue\n @queue ||= []\n end", "def has_pushed_since_last_respin?(type)\n jobs = push_jobs_since_last_state(type, 'NEW_FILES').where('pub_task_id is not null')\n jobs.reject(&:is_nochannel?).any?(&:is_committed?)\n end", "def queues\n\t\t\t@queues ||= {}\n\t\tend", "def queue_priority(pri=nil)\n if pri\n @queue_priority = pri\n else # accessor\n @queue_priority\n end\n end", "def cache_check(compiler)\n ok = SlotMachine::Label.new(self,\"send_cache_#{@name}_ok_#{self.object_id}\")\n check = build_condition(ok, compiler) # if cached_type != current_type\n check << SlotMachine::SlotLoad.new(self,[dynamic_call.cache_entry, :cached_type] , receiver_type_definition(compiler))\n check << SlotMachine::ResolveMethod.new(self, @name , dynamic_call.cache_entry )\n check << ok\n end", "def minheap?\n\t\theaptype(@min, @heap)\n\tend", "def peek \n self.queue_var[-1]\n end", "def test_peek\n assert_equal(nil, @queue.peek, \"Diese Eissorte ist falsch!\")\nend", "def priority\n return nil if @queues.empty?\n get_next_queue.priority\n end", "def queued?\n Resque.info.fetch(:pending) > 10\n end", "def front()\n self.is_empty ? -1 : @queue[@front]\n end", "def enqueue_to(queue, klass, *args); end", "def insync?(is)\n key = 'PayloadType'\n i, s = [is, should].each do |a|\n a.sort! { |x, y| x[key] <=> y[key] }\n end\n i.eql? s\n end", "def exchange_type\n @exchange_type ||= @worker_class ? :direct : :topic\n end", "def queues\n register_classes\n register_bus\n sorted_queues\n end", "def process(config)\n types = @processor.types\n chain = types.keys.map{|p| [p,{}] }\n result = nil\n config = copy(config)\n until result\n result = process_chain(types,chain,copy(config))\n if result.is_a?(Set)\n # Rearrange chain\n move = chain.size.times.select do |i|\n types[chain[i][0]].to_set.intersect? result\n end\n move.each do |i|\n chain.push [chain[i][0],{}]\n chain[i] = nil\n end\n chain.compact!\n result = nil\n end\n end\n result\n end", "def bottom_item_in_queue(except = nil)\n conditions = queue_scope_condition\n conditions = \"#{conditions} AND #{self.class.primary_key} != #{except.id}\" if except\n acts_as_queue_class.find(:first, :conditions => conditions, :order => \"#{queue_position_column} DESC\")\n end", "def above?(type, val)\n !config[:below] && (val > config[type])\n end", "def enqueue(data); end", "def push(x)\n q = @queue1.empty? ? @queue2 : @queue1\n q.push x\n end" ]
[ "0.7281272", "0.60881543", "0.60406184", "0.5983466", "0.5537937", "0.55207115", "0.5492066", "0.54646033", "0.54320776", "0.5410443", "0.5278801", "0.5233972", "0.5216417", "0.51771605", "0.5163688", "0.51524955", "0.51396704", "0.50943226", "0.50801915", "0.50719863", "0.50697756", "0.5068803", "0.50652105", "0.50652105", "0.50430775", "0.5030375", "0.50243115", "0.50200284", "0.49795637", "0.4973056", "0.4973056", "0.49692914", "0.49691436", "0.49588984", "0.49364477", "0.4935958", "0.4934999", "0.49338612", "0.49045518", "0.49039444", "0.49013847", "0.4891931", "0.48848185", "0.48820403", "0.48801216", "0.48794067", "0.48717827", "0.48691738", "0.4867052", "0.48642117", "0.48639047", "0.4861055", "0.48465455", "0.48426166", "0.4842101", "0.4839025", "0.483185", "0.48245594", "0.4821442", "0.48180526", "0.48091882", "0.48067412", "0.48067412", "0.48053387", "0.48034087", "0.48015153", "0.47990638", "0.4795816", "0.47956878", "0.47950667", "0.479315", "0.47920936", "0.47913176", "0.47883424", "0.47798502", "0.4777788", "0.47756496", "0.47754112", "0.47685254", "0.47666132", "0.47619244", "0.4760609", "0.4759925", "0.47586086", "0.4758513", "0.47551823", "0.47407427", "0.47328615", "0.47319394", "0.4731199", "0.47307056", "0.47264323", "0.47233677", "0.47217196", "0.4711762", "0.47111797", "0.47108772", "0.46983585", "0.4695326", "0.46864468" ]
0.6942802
1
This method handles: Vine video URLs (vine.co/v/...) Vine profile URLs (vine.co/u/...) Tweet URLs (twitter.com/foobar/status/...)
def vines_from_url(url) case url when %r{vine.co/v/.+} then [Pair.new(url, nil)] when %r{vine.co/u/.+} then vines_from_user_profile(url).map { |v| Pair.new(v, url) } when %r{twitter.com/.+} then vine_urls_from_tweet(url).map { |u| vines_from_url(u) }.flatten when %r{\s*} then [] else logger.warn(format("Don't know how to handle input <%s>; skipping", col)) [] end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_video_url(url)\n url_video = case url.downcase\n when /^http:\\/\\/(www\\.)?youtube\\.com/\n parse_youtube(url)\n # when /tudou/\n # parse_tudou(url)\n when /^http:\\/\\/(www\\.)?dailymotion\\.com/\n parse_dailymotion(url)\n # when /metacafe/\n # parse_metacafe(url)\n else\n url\n end\n url_video\n end", "def video_url_regexp\n /\\Ahttps?:\\/\\/www\\.youtube\\.com|\\Ahttps?:\\/\\/youtu\\.be|www\\.youtube.com\\/embed|\\Ahttps?:\\/\\/vimeo\\.com|player\\.vimeo\\.com\\/video/\n end", "def video_url\n \"http://video.ted.com/#{videoID}\"\n end", "def clean_url!\n remove_urchin\n case uri.host\n when 'www.youtube.com'\n self.url = \"#{uri.scheme}://#{uri.host}/watch?v=#{self.params['v'][0]}\"\n when 'boingboing.net'\n self.url = \"#{uri.scheme}://#{uri.host}#{uri.path}\"\n end\n end", "def sanitize_video_url\n if self.video_url\n self.video_url = self.video_url.split('/').last \n if self.video_url.include? \"watch?v=\"\n self.video_url = self.video_url.split('=').last\n end\n end\n end", "def get_video_urls(feed_url)\n Youtube.notify \"Retrieving videos...\"\n urls_titles = {}\n result_feed = Nokogiri::XML(open(feed_url))\n urls_titles.merge!(grab_urls_and_titles(result_feed))\n\n #as long as the feed has a next link we follow it and add the resulting video urls\n loop do\n next_link = result_feed.search(\"//feed/link[@rel='next']\").first\n break if next_link.nil?\n result_feed = Nokogiri::HTML(open(next_link[\"href\"]))\n urls_titles.merge!(grab_urls_and_titles(result_feed))\n end\n\n filter_urls(urls_titles)\n end", "def get_video_site(uri)\n return nil unless uri.is_a?(URI)\n return YouKu if uri.host == YouKu::VideoHost\n return TuDou if uri.host == TuDou::VideoHost\n return SlideShare if uri.host == SlideShare::VideoHost\n end", "def embed_video\r\n\tvid_host = self.video_url.sub(/^https?\\:\\/\\//, '').sub(/^www./,'').split('/')[0]\r\n\tif vid_host == 'youtube.com' or vid_host == 'youtu.be'\r\n\t\tyoutube_embed(self.video_url)\r\n\telsif vid_host == 'player.vimeo.com' or vid_host == 'vimeo.com'\r\n\t\tvimeo_embed(self.video_url)\r\n\tend\r\n end", "def video_by_status_url(status_url)\n parser = YouTubeG::Parser::VideoFeedParser.new(status_url)\n video = parser.parse \n return video \n end", "def from_accepted_site\n uri = URI.parse(self.video_url)\n\n if uri.host.nil? || (%w[youtube.com youtu.be vimeo.com player.vimeo.com].include?(uri.host.sub('www.', '')) == false)\n errors.add(:video_url, \"must be from youtube.com or vimeo.com\")\n end\n end", "def show\n def video_exists?(url)\n url = URI.parse(url)\n url.is_a?(URI::HTTP) && !url.host.nil?\n rescue URI::InvalidURIError\n false\n end\n\n @video = Video.find(params[:id])\n\n if video_exists?(@video[:video_url])\n @video_exists = true\n @youtube_id = @video[:video_url].split('=')[1]\n end\n\n @links = [{:name => \"Home\", :path => root_path}, {:name => \"Back to Videos\", :path => videos_path}]\n end", "def detect_host\n if self.link =~ /(youtube)/\n \"<iframe width='560' height='315' src='https://www.youtube.com/embed/#{youtube_code}' frameborder='0' allow='accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture' allowfullscreen></iframe>\"\n else\n \"<iframe src='https://player.vimeo.com/video/#{vimeo_code}?color=ffffff' width='640' height='360' frameborder='0' allow='autoplay; fullscreen' allowfullscreen></iframe>\"\n end\n end", "def parse_video\n # standard\n unless /\\A\\s*(?<width>\\d+)x(?<height>\\d+)\\s+(?<url>.+)\\z/ =~ content\n env.warn 'can not parse \\video content, should be \"#{WIDTH}x#{HEIGHT} #{URL}\"'\n return\n end\n\n case url\n when /youtu\\.?be/\n # NOTE merging them into one regexp fails (because longest match?)\n unless id = url[/(?<=watch\\?v=)\\w+/] || url[/(?<=embed\\/)\\w+/] || url[/(?<=youtu\\.be\\/)\\w+/]\n env.warn 'can not parse youtube id'\n return\n end\n %Q|<iframe width=\"#{width}\" height=\"#{height}\" src=\"https://www.youtube-nocookie.com/embed/#{id}?rel=0\" frameborder=\"0\" allowfullscreen></iframe>|\n when /vimeo/\n unless id = url[/(?<=vimeo\\.com\\/)\\w+/]\n env.warn 'can not parse vimeo id, should use link like this \"http://vimeo.com/#{DIGITS}\"'\n return\n end\n %Q|<iframe width=\"#{width}\" height=\"#{height}\" src=\"https://player.vimeo.com/video/#{id}\" frameborder=\"0\" allowFullScreen></iframe>|\n when /sm/\n unless id = url[/\\bsm\\d+/]\n env.warn 'can not find \"sm#{DIGITS}\" from link'\n return\n end\n %Q|<script src=\"https://ext.nicovideo.jp/thumb_watch/#{id}?w=#{width}&h=#{height}\"></script>\"|\n else\n env.warn 'failed to parse video link, currently only youtube, vimeo and niconico are supported'\n return\n end\n end", "def keepvid_urls(url)\n doc = Hpricot(open(\"http://keepvid.com/?url=#{URI.escape(url)}\"))\n urls = {}\n (doc/\"a\").each do |e|\n if (href = e.attributes[\"href\"]) =~ /save-video\\.(\\w{3})/\n urls[$1.to_sym] = \"http://keepvid.com#{href}\"\n end\n end\n\n # flv\n # http://keepvid.com/save-video.flv?http%3A%2F%2Fwww.youtube.com%2Fget_video%3Fvideo_id%3DtsgXMRB4TeQ%26t%3DOEgsToPDskKWdRg2fuNSdntV1dNSi1H5\n \n # mp4\n # http://keepvid.com/save-video.mp4?http%3A%2F%2Fwww.youtube.com%2Fget_video%3Fvideo_id%3DtsgXMRB4TeQ%26t%3DOEgsToPDskKWdRg2fuNSdntV1dNSi1H5%26fmt%3D18\n \n urls\nend", "def get_datas\n tnurl=\"/images/no-image.jpg\"\n if self.source_url.match(/(youtube.com*)/)\n vid=self.source_url.match(/=([A-Za-z0-9]*)/) ? self.source_url.match(/=([A-Za-z0-9\\d_\\-]*)/)[0].gsub(/=/,'') : self.source_url\n unless vid.blank?\n \n client=YouTubeIt::Client.new(:dev_key => YOUTUBE_API_KEY)\n \n \n begin\n youtube_data=client.video_by(vid)\n rescue\n youtube_data=nil\n self.errors.add(:source_url, \"Invalid video url, removed from youtube\")\n self.source_url=nil\n end \n \n \n unless youtube_data.nil? \n self.title= self.title.blank? ? youtube_data.title : self.title\n self.description= self.description.blank? ? youtube_data.description : self.description\n tnurl=youtube_data.thumbnails[0].url\n self.media_content_url=youtube_data.media_content[0].url\n end\n end\n self.provider=\"youtube\"\n elsif self.source_url.match(/(vimeo.com*)/)\n tnurl='/images/video/vimeo.png' \n vid=self.source_url.match(/vimeo.com\\/([^&]+)/)[1]\n unless vid.blank?\n vimeo_data=Vimeo::Simple::Video.info(vid)\n if vimeo_data && vimeo_data.size>0\n tnurl=vimeo_data[0][\"thumbnail_medium\"]\n self.title= self.title.blank? ? vimeo_data[0][\"title\"] : self.title\n self.description= self.description.blank? ? vimeo_data[0][\"description\"] : self.description\n end\n end\n\n #self.media_content_url=\"/videos/#{self.id}\"\n\n\n self.media_content_url=\"http://www.vimeo.com/moogaloop.swf?clip_id=#{vid}&amp;server=www.vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=\"\n self.provider=\"vimeo\"\n elsif self.source_url.match(/(dailymotion.com*)/)\n self.provider=\"dailymotion\" \n tnurl='/images/video/dailymotion.png' \n elsif self.source_url.match(/(myspace.com*)/)\n self.provider=\"myspace\" \n tnurl='/images/video/myspace.png' \n end\n\n self.thumbnail_url=tnurl\n\n\n end", "def video_link\n if video_type? && !body.nil?\n vimeo_video(body) || youtube_video(body)\n end\n end", "def video_url(source, options = T.unsafe(nil)); end", "def set_url_video_id\r\n # Get the URL and put in this variable that will be filtered\r\n # down to the Video ID\r\n url_video_id = self.url\r\n \r\n # Remove the http:// part of the URL\r\n if (url_video_id = url_video_id.split(/^http[s]?:\\/\\//i)[1]) != nil\r\n \r\n #Remove the www part if it exists\r\n url_video_id = url_video_id.split(/^www./i)[1] unless url_video_id.match(/^www./i) == nil\r\n \r\n # Go through each of the filters for the source of this story and\r\n # find one that will return the ID\r\n for filter in self.story_source.story_source_id_filters\r\n \r\n # Determine if this filter is usable for the URL provided\r\n if url_video_id.match(/^#{filter.pre_id_regex}/i) != nil\r\n # Remove the first part of the URL\r\n url_video_id = url_video_id.split(filter.pre_id_url)[1]\r\n \r\n # Remove the end of the URL\r\n url_video_id = url_video_id.split(filter.post_id_url)[0]\r\n \r\n # Set the ID and return it\r\n self.url_video_id = url_video_id\r\n return url_video_id\r\n end\r\n end\r\n end\r\n \r\n # The ID could not be found\r\n # Return nil and don't set the ID\r\n return nil\r\n end", "def service_url\n begin\n return video.url\n rescue\n nil\n end\n end", "def streaming_video_url\n # TODO figure out how to remove the need for this stupid hack\n # paperclip adds the cache buster to the URL automatically, I need\n # it to go away, probably a really easy paperclip option, but not\n # finding it at the moment.\n unless streaming_video.nil?\n streaming_video.data.url.split(\"?\")[0]\n else\n nil\n end\n end", "def embedded_video_url\n self.video_url.sub 'watch?v=', 'embed/'\n end", "def video_source(str)\n if str.include? 'www.youtube.com'\n return youtube_embed(str)\n elsif str.include? 'youtu.be'\n return youtube_embed(str)\n else\n return nil\n end\n end", "def fetch_video\n \t @video=UnvlogIt.new(url)\n \t [email protected]_html(300, 169)\n \t [email protected]\n end", "def show\n @seo_video = true # let app header know this is an seo page\n # Consider errors and render seovideo page\n @auth_failure = params[:auth_failure] == '1'\n @auth_strategy = params[:auth_strategy]\n @access_error = params[:access] == \"nos\"\n @invite_error = params[:invite] == \"invalid\"\n\n @from_similar_video = params[:s]\n\n # route guarantees provider_name and provider_id will exist\n @video_provider_name = params.delete(:provider_name)\n @video_provider_id = params.delete(:provider_id)\n @is_mobile = is_mobile?\n @user_signed_in = user_signed_in?\n\n # set all other @video_ variables relevant to primary video\n getVideo(@video_provider_name, @video_provider_id)\n # if the primary video isn't available, means we can't really show a great page, rescue_from catches error\n\n # we'll return a page regardless of how successful the rest of these are\n getRecommendedVideos()\n getConversations()\n splitConversationMessagesByNetwork()\n setMetaDescription()\n\n # A/B tests\n #@seo_show_play_on_related = ab_test :seo_show_play_on_related\n #@seo_messaging_v2 = ab_test :seo_messaging_v2\n=begin\n # if the referrer is google search, parse the search query out of its url\n http_referer = request.env[\"HTTP_REFERER\"]\n if http_referer && http_referer.length > 0\n # the parser doesn't know it's an http url without the protocol, so ensure\n # that it starts with http://\n unless http_referer.start_with? 'http://'\n if http_referer.start_with? 'https://'\n http_referer.slice! 4\n else\n http_referer = 'http://' + http_referer\n end\n end\n\n begin\n referer_uri = Addressable::URI.parse(http_referer)\n rescue Exception => e\n #don't want to blow up on uri parsing errors, but log them so we have some way of tracking them\n Rails.logger.info \"SEO Page Parse Referer URI Failed (ignoring): #{e}\"\n return\n end\n\n if referer_host = referer_uri.host\n if referer_host.start_with?('http://google.') || referer_host.start_with?('google.') || referer_host.include?('.google.')\n if query_values = referer_uri.query_values\n # its a google url so grab the search query\n if @search_query = query_values[\"q\"]\n # check if the google url specified an encoding for the search query and if so decode it accordingly\n if search_query_encoding = query_values[\"ie\"]\n if encoding_obj = Encoding.list.find {|enc| enc.name.casecmp(search_query_encoding) == 0 }\n # re-encode the search query as UTF-8, respecting the input encoding that was passed to google\n @search_query.encode!('utf-8', encoding_obj, :invalid => :replace, :undef => :replace, :replace => '?')\n end\n end\n end\n end\n end\n end\n end\n=end\n\n respond_to do |format|\n format.html { render }\n format.any { head :not_found }\n end\n\n end", "def parse_url(input)\n if input.success?\n video_id = youtube_id(input[:youtube_url])\n Success(video_id: video_id)\n else\n Failure(\"URL #{input.errors.messages.first}\")\n end\n end", "def urls\n @url.map do |el|\n case el\n when %r{^IANA$}\n IANA_URL % [ @media_type, @sub_type ]\n when %r{^RFC(\\d+)$}\n RFC_URL % $1\n when %r{^DRAFT:(.+)$}\n DRAFT_URL % $1\n when %r{^LTSW$}\n LTSW_URL % @media_type\n when %r{^\\{([^=]+)=([^\\}]+)\\}}\n [$1, $2]\n when %r{^\\[([^=]+)=([^\\]]+)\\]}\n [$1, CONTACT_URL % $2]\n when %r{^\\[([^\\]]+)\\]}\n CONTACT_URL % $1\n else\n el\n end\n end\n end", "def url_for_video_player\n if VIDEOS_ON_S3\n \"http://wickedstartbucket.s3.amazonaws.com#{self.multimedia.url(:original, false)}\"\n else\n self.multimedia.url(:original, false)\n end\n end", "def video_id(url)\n url.scan(/\\?v=(.{11})|youtu.be\\/(.{11})/)[0].find {|e| not e.nil?}\n end", "def vimeo_video_id\n self.vid = link.split('/').last\n end", "def validate_job_seeker_url\r\n if not self.video_url .blank?\r\n if not self.video_url.match(/^(http|https):\\/\\/[a-z0-9]+([\\-\\.]{1}[a-z0-9]+)*\\.[a-z]{2,5}(([0-9]{1,5})?\\/.*)?$/ix)\r\n errors.add(\"URL\",\"Invalid URL\")\r\n end\r\n end\r\n end", "def get_service_url unique_id\n \"http://gdata.youtube.com/feeds/api/videos/#{unique_id}?v=2&prettyprint=true&alt=json\"\n end", "def tweet_link_for_new_free_episode_vland\n \t\t# TODO\n \tend", "def getVideoURL\n if (request.post?)\n cVideoID = self.findKeyInJSON(params[:params], \"VideoID\", 2)\n cOS = self.findKeyInJSON(params[:params], \"OS\", 2)\n \n case cOS.to_s\n when \"100\"\n # We have that file stored in S3 yet?\n # Check it later!\n # Just hard-code it\n returnFileName = \"http://ec2-50-112-145-58.us-west-2.compute.amazonaws.com:1935/vods3/_definst_/mp4:s3/\"\n returnFileName += cVideoID + \".mov\"\n returnFileName += \"/playlist.m3u8\"\n when \"101\"\n # android\n returnFileName = \"rtsp://ec2-50-112-145-58.us-west-2.compute.amazonaws.com:1935/vod/_definst_/mp4:s3/\"\n returnFileName += cVideoID + \".mov\"\n else\n # ignore\n end\n \n # Update Video Played Count\n begin\n b = Videotemp.find(cVideoID)\n if(b.playedCount == nil || b.playedCount == '')\n playedCount = 1\n else\n playedCount = b.playedCount\n playedCount = playedCount.to_i + 1\n end\n b.playedCount = playedCount.to_i\n b.save\n rescue Exception => e\n # ignore\n end\n \n # Return JSON response\n cRequestID = self.findKeyInJSON(params[:params], \"RequestID\", 1)\n rData = {\"VideoStreamUrl\" => returnFileName}\n self.jsonRender(rData, 'WOWZA URL', cRequestID, '100')\n end\n end", "def find_videos_linked_in_text(text)\n raise ArgumentError, \"must provide a text string\" unless text.is_a?(String)\n \n raw_urls = text.split.grep(URL_REGEX)\n return videos_from_url_array(raw_urls)\n end", "def service\n case self.url\n when YOUTUBE_REGEXP then :youtube\n when VIMEO_REGEXP then :vimeo\n else nil\n end\n end", "def source_url\n \"https://www.facebook.com/facebook/videos/#{@element.embed_id}\"\n end", "def tokenize_urls!\n @raw.gsub!(%r{http[\\w\\-\\#:/_.?&=]+}) do |url|\n maybe_parse_url(url) do |uri|\n path = uri.path.tap { |str| str.tr!('/_\\-', ' ') }\n query = uri.query.tap { |str| str&.tr!('?=&#_\\-', ' ') }\n fragment = uri.fragment.tap { |str| str&.tr!('#_/\\-', ' ') }\n\n \"#{uri.scheme} #{uri.host} #{path} #{query} #{fragment}\"\n end\n end\n end", "def verify_user_can_access_channel_or_video\n public_token = params[:channel_token]\n user_can_access_either_one = (public_token and public_token.strip == @video.channel.public_token) || user_can_access_channel\n \n ruby_code_from_view.ruby_code_from_view do |rb_from_view|\n if we_should_show_og_tags && [email protected]? \n # Facebook OpenGraph protocol for embedding our video link back to Brevidy \n public_video_url(:public_token => @video.public_token) \n @video.title \n @video.description \n @video.get_thumbnail_url(@video.selected_thumbnail) \n public_video_url(:public_token => @video.public_token) \n else \n # Standard meta tags \n image_path('meta_tag_logo.png') \n end \n browser_title \n # Logged In CSS \n cache_buster_path('/stylesheets/i_love_lamp-1.0.3.min.css') \n # Site-wide JS \n javascript_include_tag \"https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js\" \n cache_buster_path('/javascripts/functions.min.js') \n cache_buster_path('/javascripts/i_love_lamp-1.0.3.min.js') \n javascript_include_tag \"player/player.js\" \n javascript_include_tag \"http://html5shiv.googlecode.com/svn/trunk/html5.js\" \n # Fav Icon and CSRF meta tag \n favicon_link_tag \n csrf_meta_tag \n get_background_for_user \n # Top navigation header \n link_to(image_tag(\"brevidy_rgb_white.png\", :size => \"135x35\", :alt => \"Brevidy - The Soul of Video\"), signed_in? ? user_stream_path(current_user) : :root, :class => \"brand\") \n video_search_path \n if signed_in? \n link_to(\"Explore\", explore_path) \n link_to(\"Upload\", new_user_video_path(current_user)) \n link_to(\"Share a Link\", user_share_dialog_path(current_user), :remote => true, \"data-method\" => \"GET\") \n link_to(\"Invite\", user_invitations_path(current_user)) \n end \n if signed_in? \n link_to(user_path(current_user), :class => \"dropdown-toggle\") do \n image_tag(\"#{current_user.image.blank? ? 'default_user_35px.jpg' : current_user.image_url(:small_profile) }\", :alt => \"#{current_user.name}\", :size => \"35x35\") \n current_user.username \n end \n link_to(\"My Channels\", user_channels_path(current_user)) \n link_to(\"Account Settings\", user_account_path(current_user)) \n link_to(\"Find People\", find_people_path) \n link_to(\"Help\", \"http://getsatisfaction.com/brevidy\", :target => \"_blank\") \n link_to(\"Logout\", logout_path, :remote => true, \"data-method\" => \"DELETE\") \n else \n link_to(\"Explore\", explore_path) \n link_to(\"Sign up\", signup_path) \n link_to(\"Login\", login_path) \n end \n \n # Main container \n # Dark Content Wrapper \n # Main (White) Content Wrapper \n link_to \"Go back\", :back \n image_tag(\"okayguy.png\", :alt => \"Okay\", :size => \"256x275\") \n # Lower navigation \n unless @page_has_infinite_scrolling \n succeed \" \" do \n link_to(\"FAQ\", faq_path, :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Blog\", \"http://blog.brevidy.com\", :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Status\", \"http://status.brevidy.com\", :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Contact\", contact_path, :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Terms\", tos_path, :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Privacy\", privacy_path, :class => \"inlinelink\") \n end \n \n end \n # GetSatisfaction Feedback Widget & Google Analytics \n # Google Analytics \n # GetSatisfaction Code \n # AddThis script \n \n # Scroll back to top \n\nend\n\n end", "def verify_user_owns_video\n ruby_code_from_view.ruby_code_from_view do |rb_from_view|\n if we_should_show_og_tags && [email protected]? \n # Facebook OpenGraph protocol for embedding our video link back to Brevidy \n public_video_url(:public_token => @video.public_token) \n @video.title \n @video.description \n @video.get_thumbnail_url(@video.selected_thumbnail) \n public_video_url(:public_token => @video.public_token) \n else \n # Standard meta tags \n image_path('meta_tag_logo.png') \n end \n browser_title \n # Logged In CSS \n cache_buster_path('/stylesheets/i_love_lamp-1.0.3.min.css') \n # Site-wide JS \n javascript_include_tag \"https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js\" \n cache_buster_path('/javascripts/functions.min.js') \n cache_buster_path('/javascripts/i_love_lamp-1.0.3.min.js') \n javascript_include_tag \"player/player.js\" \n javascript_include_tag \"http://html5shiv.googlecode.com/svn/trunk/html5.js\" \n # Fav Icon and CSRF meta tag \n favicon_link_tag \n csrf_meta_tag \n get_background_for_user \n # Top navigation header \n link_to(image_tag(\"brevidy_rgb_white.png\", :size => \"135x35\", :alt => \"Brevidy - The Soul of Video\"), signed_in? ? user_stream_path(current_user) : :root, :class => \"brand\") \n video_search_path \n if signed_in? \n link_to(\"Explore\", explore_path) \n link_to(\"Upload\", new_user_video_path(current_user)) \n link_to(\"Share a Link\", user_share_dialog_path(current_user), :remote => true, \"data-method\" => \"GET\") \n link_to(\"Invite\", user_invitations_path(current_user)) \n end \n if signed_in? \n link_to(user_path(current_user), :class => \"dropdown-toggle\") do \n image_tag(\"#{current_user.image.blank? ? 'default_user_35px.jpg' : current_user.image_url(:small_profile) }\", :alt => \"#{current_user.name}\", :size => \"35x35\") \n current_user.username \n end \n link_to(\"My Channels\", user_channels_path(current_user)) \n link_to(\"Account Settings\", user_account_path(current_user)) \n link_to(\"Find People\", find_people_path) \n link_to(\"Help\", \"http://getsatisfaction.com/brevidy\", :target => \"_blank\") \n link_to(\"Logout\", logout_path, :remote => true, \"data-method\" => \"DELETE\") \n else \n link_to(\"Explore\", explore_path) \n link_to(\"Sign up\", signup_path) \n link_to(\"Login\", login_path) \n end \n \n # Main container \n # Dark Content Wrapper \n # Main (White) Content Wrapper \n link_to \"Go back\", :back \n image_tag(\"okayguy.png\", :alt => \"Okay\", :size => \"256x275\") \n # Lower navigation \n unless @page_has_infinite_scrolling \n succeed \" \" do \n link_to(\"FAQ\", faq_path, :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Blog\", \"http://blog.brevidy.com\", :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Status\", \"http://status.brevidy.com\", :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Contact\", contact_path, :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Terms\", tos_path, :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Privacy\", privacy_path, :class => \"inlinelink\") \n end \n \n end \n # GetSatisfaction Feedback Widget & Google Analytics \n # Google Analytics \n # GetSatisfaction Code \n # AddThis script \n \n # Scroll back to top \n\nend\n\n end", "def youtube_embed_url\n VideoInfo.new(self.video_url).embed_url if self.video_url?\n end", "def youtube_movie_embed\n str1 = \"http://www.youtube.com/v/\" \n str2 = movie_home_url.split('v=',2).last unless movie_home_url.nil?\n str3 = \"&hl=en_US&fs=1&\"\n return [str1,str2,str3].join \n end", "def render_resolve_url_personal(work, show_youtube_iframe=false)\n url = work.attach_url\n obj = get_resolved_url_obj(url)\n case obj[:type]\n when \"image\"\n tag :img, src: \"#{url}\", onload: \"onImageLoad(this)\"\n when \"audio\" #compare to 2\n tag :audio, controls: \"controls\", src: \"#{url}\", style: \"width:100%;\"\n when \"video\"\n tag :video, controls: \"controls\", src: \"#{url}\", width: \"100%\", height: \"100%\"\n when \"youtube\"\n matches = obj[:match_object]\n if show_youtube_iframe\n queryobj = {}\n queryobj[\"rel\"] = 0\n hashes = \"\"\n overrides = Rack::Utils.parse_query(URI.parse(matches[0]).query)\n overrides.delete(\"v\")\n queryobj = queryobj.merge(overrides)\n if matches[4] != nil\n splits = matches[4].split('#')\n if splits.length > 1\n hashes += \"#\" + splits[1]\n end\n end\n queryobj[\"enablejsapi\"] = 1;\n if queryobj[\"t\"].present?\n timeRe = /((?<min>\\d+)[m])?((?<sec>\\d+)[s])?/\n time = queryobj[\"t\"].scan(timeRe)[0]\n queryobj[\"start\"] = (time[0] ? time[0].to_i : 0) * 60 + (time[1] ? time[1].to_i : 0)\n end\n querystr = Rack::Utils.build_query(queryobj)\n content_tag :iframe, '', src: \"https://www.youtube.com/embed/#{matches[2]}?#{querystr}#{hashes}\", width: '100%', frameborder: '0', height: '100%'\n else\n tag :img, src: \"https://i.ytimg.com/vi/#{matches[2]}/hqdefault.jpg\", onload: \"onImageLoad(this)\"\n end\n else\n # content_tag :div, :data => { :remote_url => url }, class: \"remote-preview\" do\n # content_tag(:div,'', style: 'background-image:url(' + work.remote_image_url + ')', class: 'preview-image') +\n # content_tag(:p, work.remote_description, class: 'preview-description')\n # end\n tag :img, src: \"#{work.remote_image_url}\", onload: \"onImageLoad(this)\"\n end\n end", "def video_page_permalink()\n if video = self.video\n \"#{Settings::ShelbyAPI.web_root}/video/#{video.provider_name}/#{video.provider_id}/?frame_id=#{self.id}\"\n elsif self.roll_id\n \"#{Settings::ShelbyAPI.web_root}/roll/#{self.roll_id}/frame/#{self.id}\"\n else\n \"#{Settings::ShelbyAPI.web_root}/rollFromFrame/#{self.id}\"\n end\n end", "def parse_url(url)\n doc = Net::HTTP.get(URI('http://www.flvcd.com/parse.php?kw=' + url))\n row = ''\n doc.lines do |line|\n if line =~ /<BR><a href=\"http:\\/\\/.*\\.mp4\"/\n row = line.lstrip!.b\n break\n end\n end\n#puts row[%r{\"http://.+?\\.mp4\"}]\n links = []\n row.scan(%r{\"http://.+?\\.mp4\"}) {|link| links.push(link[1..-2])}\n links.each {|l| puts l}\n links\nend", "def youtube_url; \"https://youtube.com/user/#{youtube}\" end", "def detect_source(in_link) #returns true for vimeo, false for youtube\n if in_link.include? \"vimeo\"\n return true\n else\n return false\n end\n end", "def verify_user_owns_channel\n ruby_code_from_view.ruby_code_from_view do |rb_from_view|\n if we_should_show_og_tags && [email protected]? \n # Facebook OpenGraph protocol for embedding our video link back to Brevidy \n public_video_url(:public_token => @video.public_token) \n @video.title \n @video.description \n @video.get_thumbnail_url(@video.selected_thumbnail) \n public_video_url(:public_token => @video.public_token) \n else \n # Standard meta tags \n image_path('meta_tag_logo.png') \n end \n browser_title \n # Logged In CSS \n cache_buster_path('/stylesheets/i_love_lamp-1.0.3.min.css') \n # Site-wide JS \n javascript_include_tag \"https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js\" \n cache_buster_path('/javascripts/functions.min.js') \n cache_buster_path('/javascripts/i_love_lamp-1.0.3.min.js') \n javascript_include_tag \"player/player.js\" \n javascript_include_tag \"http://html5shiv.googlecode.com/svn/trunk/html5.js\" \n # Fav Icon and CSRF meta tag \n favicon_link_tag \n csrf_meta_tag \n get_background_for_user \n # Top navigation header \n link_to(image_tag(\"brevidy_rgb_white.png\", :size => \"135x35\", :alt => \"Brevidy - The Soul of Video\"), signed_in? ? user_stream_path(current_user) : :root, :class => \"brand\") \n video_search_path \n if signed_in? \n link_to(\"Explore\", explore_path) \n link_to(\"Upload\", new_user_video_path(current_user)) \n link_to(\"Share a Link\", user_share_dialog_path(current_user), :remote => true, \"data-method\" => \"GET\") \n link_to(\"Invite\", user_invitations_path(current_user)) \n end \n if signed_in? \n link_to(user_path(current_user), :class => \"dropdown-toggle\") do \n image_tag(\"#{current_user.image.blank? ? 'default_user_35px.jpg' : current_user.image_url(:small_profile) }\", :alt => \"#{current_user.name}\", :size => \"35x35\") \n current_user.username \n end \n link_to(\"My Channels\", user_channels_path(current_user)) \n link_to(\"Account Settings\", user_account_path(current_user)) \n link_to(\"Find People\", find_people_path) \n link_to(\"Help\", \"http://getsatisfaction.com/brevidy\", :target => \"_blank\") \n link_to(\"Logout\", logout_path, :remote => true, \"data-method\" => \"DELETE\") \n else \n link_to(\"Explore\", explore_path) \n link_to(\"Sign up\", signup_path) \n link_to(\"Login\", login_path) \n end \n \n # Main container \n # Dark Content Wrapper \n # Main (White) Content Wrapper \n link_to \"Go back\", :back \n image_tag(\"okayguy.png\", :alt => \"Okay\", :size => \"256x275\") \n # Lower navigation \n unless @page_has_infinite_scrolling \n succeed \" \" do \n link_to(\"FAQ\", faq_path, :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Blog\", \"http://blog.brevidy.com\", :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Status\", \"http://status.brevidy.com\", :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Contact\", contact_path, :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Terms\", tos_path, :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Privacy\", privacy_path, :class => \"inlinelink\") \n end \n \n end \n # GetSatisfaction Feedback Widget & Google Analytics \n # Google Analytics \n # GetSatisfaction Code \n # AddThis script \n \n # Scroll back to top \n\nend\n\n end", "def fetch_video_o_url(id:)\n require 'typhoeus'\n auth_url = 'https://www.flickr.com/video_download.gne?id=' + id\n dl_url = nil\n request = Typhoeus::Request.new(auth_url, headers: {Cookie: @config['cookie']})\n request.on_complete do |response|\n dl_url = response.headers['location']\n end\n request.run\n return dl_url\n end", "def white_list\n case\n when self.the_url =~ /^http:\\/\\/\\w+\\.meetupstatic.com\\/photos\\/member\\/.+\\.jpeg/\n # Let it pass\n when self.the_url =~ /^http:\\/\\/gravatar.com\\/avatar\\/\\w+/\n # Let it pass\n p 'Let it pass'\n when self.the_url =~ /^https:\\/\\/secure.gravatar.com\\/avatar\\/\\w+/\n # Let it pass\n p 'Let it pass'\n when self.the_url =~ /^http:\\/\\/profile.ak.fbcdn.net\\/.+\\.jpg/\n # Let it pass\n p 'Let it pass'\n else\n # Dont let it pass\n self.the_url = nil\n end # case\n end", "def get_links(post)\n post_links = post.content.content.scan(/youtube.*?\\\"/)\nend", "def secondary_url?\n case url\n when %r!pixiv\\.net/stacc!i\n true\n when %r!pixiv\\.net/fanbox!i\n true\n when %r!twitter\\.com/intent!i\n true\n when %r!lohas\\.nicoseiga\\.jp!i\n true\n when %r!(?:www|com|dic)\\.nicovideo\\.jp!i\n true\n when %r!pawoo\\.net/web/accounts!i\n true\n when %r!www\\.artstation\\.com!i\n true\n when %r!blogimg\\.jp!i, %r!image\\.blog\\.livedoor\\.jp!i\n true\n else\n false\n end\n end", "def youtube_video(url)\n render :partial => 'shared/video', :locals => { :url => url }\n end", "def modify_media_file_url_if_from_video_site\n if media_file_url.present? && !ImageSrcUrl.new(media_file_url).is_image?\n video_src_url = VideoSrcUrl.new(media_file_url)\n self.media_file_url = video_src_url.value if video_src_url.is_video?\n end\n end", "def remote_url_to_local url\n url.match /(#{config[:root_path]})(.+)$/\n file = $2\n basename = File.basename file\n basename.match(/(\\.\\w+)$/)\n mimetype = GET_MIME[$1].match(/(audio|video)/)[1]\n File.join(Rails.root,'public', mimetype.pluralize, file)\n end", "def extract_video_page_urls(webpage,options)\r\n puts \"Extracting data from html5 data\"\r\n webpage.css('li.regularitem').each do |post|\r\n link = post.css('h4.itemtitle').css('a').first\r\n description = post.css('div.itemcontent').first.text\r\n download_episode(link.child.text,link['href'],description, options)\r\n end\r\nend", "def vimeo_url(video_id)\n\t\t\"https://player.vimeo.com/video/#{video_id}\"\n\tend", "def youtube_video_id\n video_id = link.match(/\\?v=/) ? link.split('?v=')[1] : link.split('/').last\n video_id = video_id.split('&')[0] if video_id =~ /&/\n self.vid = video_id\n end", "def relative_url\n begin\n return Rails.application.routes.url_helpers.rails_blob_path(video, only_path: true)\n # url_for(clip.video) # for redirect links\n # rails_blob_path(clip.video, disposition: \"attachment\") # for downloads links\n rescue\n nil\n end\n end", "def create\n @video = current_user.videos.build(params[:video])\n\n @url = params[:video][:url]\n\n\n require 'uri'\n\n\n if(@url.downcase.include? 'youtube.com')\n ##create ways to catch if user is using \n query_string = URI.parse(params[:video][:url]).query\n parameters = Hash[URI.decode_www_form(query_string)]\n puts parameters['v'] # => aNdMiIAlK0g\n video_id = parameters['v']\n elsif (@url.downcase.include? 'y2u.be')\n puts video_id = @url.match(/\\.be\\/(.+)$/)[1]\n @url = 'http://www.youtube.com/watch?v='+video_id\n @video.url = @url \n elsif (@url.downcase.include? 'youtu.be')\n puts video_id = @url.match(/\\.be\\/(.+)$/)[1]\n @url = 'http://www.youtube.com/watch?v='+video_id\n @video.url = @url\n end\n \n \n\n @yt_client = YouTubeIt::Client.new(:dev_key => \"AI39si6hkRNCL77mzzv1LycIohZtksVIi0L5S9lQMx6crqOfGdyKcB2U2M5WHeNBUT2VLgTVzjR9rxPa1RJZw-sZ6wqtnaZ7AA\")\n @video.youtube_id = video_id # => aNdMiIAlK0g\n\n this_video = @yt_client.video_by(video_id)\n\n\n @video.duration = this_video.duration \n\n\n\n respond_to do |format|\n if @video.save ##and video is over 60 seconds in duration \n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { render action: \"new\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def convert_to_youtube_embed_link\n self.video_url.gsub!(/(youtube.com\\/)(.)*v=([\\w\\-_]+)(.)*$/, '\\1embed/\\3')\n end", "def parsers\n [\n EmbeddedFacebookVideoParser,\n EmbeddedVimeoVideoParser,\n EmbeddedYoutubeVideoParser,\n EmbeddedTweetParser,\n EmbeddedSlideshareParser,\n EmbeddedSoundcloudParser,\n ]\n end", "def show\n @user_video = UserVideo.find(params[:id]) \n @vid_id = @user_video.video_embed.split('?v=')[1]\n @u = \"http://www.youtube.com/embed/\" + @vid_id\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_video }\n end\n end", "def url_visit\n par = case $url.upcase\n when \"LMX\" then \"https://www.linio.com.mx\"\n when \"LCO\" then \"https://www.linio.com.co\"\n when \"LCL\" then \"https://www.linio.cl\"\n when \"LVE\" then \"https://www.linio.com.ve\"\n when \"LAR\" then \"https://www.linio.com.ar\"\n when \"LEC\" then \"https://www.linio.com.ec\"\n when \"LPA\" then \"https://www.linio.com.pa\" \n when \"LPE\" then \"https://www.linio.com.pe\" \n when \"HPMX\" then \"https://www.hponline.com.mx\"\n when \"HPCL\" then \"https://www.hponline.cl\"\n when \"WLCP\" then \"https://tienda.clubpremier.com\"\n when \"AVCO\" then \"http://co.catalog.lifemiles.com/\"\n when \"AVPE\" then \"http://pe.catalog.lifemiles.com/\"\n#batman\n when \"A01_MX\" then \"http://#{$user_alice01}:#{$pass_alice01}@alice01-mx.linio-staging.com\"\n when \"A01_CO\" then \"http://#{$user_alice01}:#{$pass_alice01}@alice01-co.linio-staging.com\"\n when \"A01_CL\" then \"http://#{$user_alice01}:#{$pass_alice01}@alice01-cl.linio-staging.com\"\n when \"A01_VE\" then \"http://#{$user_alice01}:#{$pass_alice01}@alice01-ve.linio-staging.com\"\n when \"A01_AR\" then \"http://#{$user_alice01}:#{$pass_alice01}@alice01-ar.linio-staging.com\"\n when \"A01_EC\" then \"http://#{$user_alice01}:#{$pass_alice01}@alice01-ec.linio-staging.com\"\n when \"A01_PA\" then \"http://#{$user_alice01}:#{$pass_alice01}@alice01-pa.linio-staging.com\" \n when \"A01_PE\" then \"http://#{$user_alice01}:#{$pass_alice01}@alice01-pe.linio-staging.com\" \n #cobra\n when \"A02_MX\" then \"http://#{$user_alice02}:#{$pass_alice02}@alice02-mx.linio-staging.com\"\n when \"A02_CO\" then \"http://#{$user_alice02}:#{$pass_alice02}@alice02-co.linio-staging.com\"\n when \"A02_CL\" then \"http://#{$user_alice02}:#{$pass_alice02}@alice02-cl.linio-staging.com\"\n when \"A02_VE\" then \"http://#{$user_alice02}:#{$pass_alice02}@alice02-ve.linio-staging.com\"\n when \"A02_AR\" then \"http://#{$user_alice02}:#{$pass_alice02}@alice02-ar.linio-staging.com\"\n when \"A02_EC\" then \"http://#{$user_alice02}:#{$pass_alice02}@alice02-ec.linio-staging.com\"\n when \"A02_PA\" then \"http://#{$user_alice02}:#{$pass_alice02}@alice02-pa.linio-staging.com\" \n when \"A02_PE\" then \"http://#{$user_alice02}:#{$pass_alice02}@alice02-pe.linio-staging.com\" \n #mobile\n when \"A03_MX\" then \"http://#{$user_alice03}:#{$pass_alice03}@alice03-mx.linio-staging.com\"\n when \"A03_CO\" then \"http://#{$user_alice03}:#{$pass_alice03}@alice03-co.linio-staging.com\"\n when \"A03_CL\" then \"http://#{$user_alice03}:#{$pass_alice03}@alice03-cl.linio-staging.com\"\n when \"A03_VE\" then \"http://#{$user_alice03}:#{$pass_alice03}@alice03-ve.linio-staging.com\"\n when \"A03_AR\" then \"http://#{$user_alice03}:#{$pass_alice03}@alice03-ar.linio-staging.com\"\n when \"A03_EC\" then \"http://#{$user_alice03}:#{$pass_alice03}@alice03-ec.linio-staging.com\"\n when \"A03_PA\" then \"http://#{$user_alice03}:#{$pass_alice03}@alice03-pa.linio-staging.com\" \n when \"A03_PE\" then \"http://#{$user_alice03}:#{$pass_alice03}@alice03-pe.linio-staging.com\" \n #shop-launch\n when \"A04_MX\" then \"http://#{$user_alice04}:#{$pass_alice04}@alice04-mx.linio-staging.com\"\n when \"A04_CO\" then \"http://#{$user_alice04}:#{$pass_alice04}@alice04-co.linio-staging.com\"\n when \"A04_CL\" then \"http://#{$user_alice04}:#{$pass_alice04}@alice04-cl.linio-staging.com\"\n when \"A04_VE\" then \"http://#{$user_alice04}:#{$pass_alice04}@alice04-ve.linio-staging.com\"\n when \"A04_AR\" then \"http://#{$user_alice04}:#{$pass_alice04}@alice04-ar.linio-staging.com\"\n when \"A04_EC\" then \"http://#{$user_alice04}:#{$pass_alice04}@alice04-ec.linio-staging.com\"\n when \"A04_PA\" then \"http://#{$user_alice04}:#{$pass_alice04}@alice04-pa.linio-staging.com\" \n when \"A04_PE\" then \"http://#{$user_alice04}:#{$pass_alice04}@alice04-pe.linio-staging.com\" \n\n when \"A06_MX\" then \"https://#{$user_alice06}:#{$pass_alice06}@shop-front06-mx.linio-staging.com\"\n when \"A06_EC\" then \"https://#{$user_alice06}:#{$pass_alice06}@shop-front06-ec.linio-staging.com\"\n when \"A06_CL\" then \"https://#{$user_alice06}:#{$pass_alice06}@shop-front06-cl.linio-staging.com\"\n when \"A06_CO\" then \"https://#{$user_alice06}:#{$pass_alice06}@shop-front06-co.linio-staging.com\"\n when \"A06_PA\" then \"https://#{$user_alice06}:#{$pass_alice06}@shop-front06-pa.linio-staging.com\"\n when \"A06_PE\" then \"https://#{$user_alice06}:#{$pass_alice06}@shop-front06-pe.linio-staging.com\"\n when \"A06_AR\" then \"https://#{$user_alice06}:#{$pass_alice06}@shop-front06-ar.linio-staging.com\"\n \n else \"Error country\"\n end\n return par\nrescue\n puts \"Error\"\nend", "def shorten_urls\n @status = (@status.split(\" \").collect do |word|\n if word =~ URI::regexp and word.length > 30 then\n # using tinyurl\n # NOTE: look into retwt.me, they have a simple api (w/o auth) and provide analysis\n (Net::HTTP.post_form URI.parse('http://tinyurl.com/api-create.php'),{\"url\" => word}).body\n else\n word\n end\n end).join(\" \")\n end", "def oembed_url\n \"https://graph.facebook.com/v9.0/oembed_video?url=#{source_url}\" \\\n \"&access_token=#{access_token}\"\n end", "def link_urls(tweet)\n tweet.gsub(/([A-Z]+:\\/\\/[^\\s]+)/i, '<a href=\"\\1\">\\1</a>')\n end", "def set_video_based_on_user\n video_id = params[:video_id] || params[:id]\n\n begin\n if current_user?(@user)\n @video ||= @user.videos.where(:id => video_id).joins(:video_graph).where(:video_graphs => { :status => Video.statuses_to_show_to_current_user }).first\n else\n @video ||= @user.videos.where(:id => video_id).joins(:video_graph).where(:video_graphs => { :status => VideoGraph.get_status_number(:ready) }).first\n end\n rescue ActiveRecord::StatementInvalid\n @video = nil\n end\n \n ruby_code_from_view.ruby_code_from_view do |rb_from_view|\n if we_should_show_og_tags && [email protected]? \n # Facebook OpenGraph protocol for embedding our video link back to Brevidy \n public_video_url(:public_token => @video.public_token) \n @video.title \n @video.description \n @video.get_thumbnail_url(@video.selected_thumbnail) \n public_video_url(:public_token => @video.public_token) \n else \n # Standard meta tags \n image_path('meta_tag_logo.png') \n end \n browser_title \n # Logged In CSS \n cache_buster_path('/stylesheets/i_love_lamp-1.0.3.min.css') \n # Site-wide JS \n javascript_include_tag \"https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js\" \n cache_buster_path('/javascripts/functions.min.js') \n cache_buster_path('/javascripts/i_love_lamp-1.0.3.min.js') \n javascript_include_tag \"player/player.js\" \n javascript_include_tag \"http://html5shiv.googlecode.com/svn/trunk/html5.js\" \n # Fav Icon and CSRF meta tag \n favicon_link_tag \n csrf_meta_tag \n get_background_for_user \n # Top navigation header \n link_to(image_tag(\"brevidy_rgb_white.png\", :size => \"135x35\", :alt => \"Brevidy - The Soul of Video\"), signed_in? ? user_stream_path(current_user) : :root, :class => \"brand\") \n video_search_path \n if signed_in? \n link_to(\"Explore\", explore_path) \n link_to(\"Upload\", new_user_video_path(current_user)) \n link_to(\"Share a Link\", user_share_dialog_path(current_user), :remote => true, \"data-method\" => \"GET\") \n link_to(\"Invite\", user_invitations_path(current_user)) \n end \n if signed_in? \n link_to(user_path(current_user), :class => \"dropdown-toggle\") do \n image_tag(\"#{current_user.image.blank? ? 'default_user_35px.jpg' : current_user.image_url(:small_profile) }\", :alt => \"#{current_user.name}\", :size => \"35x35\") \n current_user.username \n end \n link_to(\"My Channels\", user_channels_path(current_user)) \n link_to(\"Account Settings\", user_account_path(current_user)) \n link_to(\"Find People\", find_people_path) \n link_to(\"Help\", \"http://getsatisfaction.com/brevidy\", :target => \"_blank\") \n link_to(\"Logout\", logout_path, :remote => true, \"data-method\" => \"DELETE\") \n else \n link_to(\"Explore\", explore_path) \n link_to(\"Sign up\", signup_path) \n link_to(\"Login\", login_path) \n end \n \n # Main container \n # Dark Content Wrapper \n # Main (White) Content Wrapper \n link_to \"Go back\", :back \n image_tag(\"okayguy.png\", :alt => \"Okay\", :size => \"256x275\") \n # Lower navigation \n unless @page_has_infinite_scrolling \n succeed \" \" do \n link_to(\"FAQ\", faq_path, :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Blog\", \"http://blog.brevidy.com\", :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Status\", \"http://status.brevidy.com\", :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Contact\", contact_path, :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Terms\", tos_path, :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Privacy\", privacy_path, :class => \"inlinelink\") \n end \n \n end \n # GetSatisfaction Feedback Widget & Google Analytics \n # Google Analytics \n # GetSatisfaction Code \n # AddThis script \n \n # Scroll back to top \n\nend\n\n end", "def videos_test\n end", "def url(key)\n %(http://#{Panda::Config[:videos_domain]}/#{key})\n end", "def embeddable_url\n\t\turl.sub('watch?v=', 'embed/')\n\tend", "def video_download_links(document, video_files)\n file = video_files.first\n video_links = []\n attachments_json = JSON.parse(file['attachments_ss'])\n %w(video_access_mp4 video_access_webm).each do |v_id|\n next unless attachments_json[v_id]\n\n video_links << file_download_link(file['id'],\n download_link_title(document, attachments_json),\n attachments_json,\n v_id,\n download_link_options)\n end\n video_links\n end", "def play\n\t\treturn \"stoffi:track:youtube:#{youtube_id}\" if youtube?\n\t\treturn \"stoffi:track:soundcloud:#{soundcloud_id}\" if soundcloud?\n\t\treturn url\n\tend", "def get(url, options = {})\n uri = URI.parse(auto_complete_url(url)) rescue nil\n video_site = get_video_site(uri)\n video_site && video_site.new(uri).get(options)\n end", "def index\n if !/(scrape)/.match(request.url).nil?\n # obviously temporary \n commence_scraping\n elsif !/(releases.json)/.match(request.url).nil?\n get_releases\n elsif !/(videos.json)/.match(request.url).nil?\n get_youtube\n elsif !/(merch.json)/.match(request.url).nil?\n get_merch\n elsif !/(youtube_api_fetch)/.match(request.url).nil?\n youtube_api_fetch\n end\n end", "def youtube_code\n code = self.link.match(/v=(.*)/)\n code.captures.first\n end", "def load_youtube\n Video\n YouTube\n end", "def load_youtube\n Video\n YouTube\n end", "def find_vimeo_id url\n url = sanitize url\n matches = VIMEO_REGEX.match url.to_str\n matches[2] if matches\n end", "def get_all_index_links_to_each_vland_show\n \t\t# index link for shows\n \t\tresp = get_resp(self.url)\n \t\tshow_index_link = self.url + resp.match(/\"\\/([^\"]*\\/shows)/)[1]\n \t\t#should probbly store this on something but yolo\n \t\tresp_shows = get_resp(show_index_link)\n \t\t# create shows by urls\n \t\tresp_shows.scan(/href=\"([^\"]*show\\/[^\"]*)/).uniq.each do |show_url|\n \t\t\tshow=Show.find_or_initialize_by(url: \"https:\" + show_url.to_s.gsub(/[\"\\[\\]]/,\"\"))\n \t\t\tif show.new_record?\n \t\t\t\tshow.content_provider_id = self.id\n \t\t\t\tshow.save!\n \t\t\tend\n \t\tend\n \tend", "def show\n @video = Video.find_by_permalink(params[:id])\n \n previous_video = Video.previous(@video)\n if previous_video.empty?\n @previous = Video.last.permalink\n else\n @previous = previous_video.pop.permalink\n end\n \n next_video = Video.next(@video)\n if next_video.empty?\n @next = Video.first.permalink\n else\n @next = next_video.pop.permalink\n end\n # we may need some cant find permalink screen \n \n @text_size = @video.project.size < 35 ? \"textTitle\" : \"textTitleSmall\" \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "def media_video_processed_url\n if self.asset_type == TYPE[:media_video] && read_attribute(:processed).present? && self.processed == true\n self.file.url(:processed,false).gsub(/\\.[0-9a-zA-Z]+$/,\".mp4\")\n end\n end", "def update\n\n\n @video = Video.find(params[:id])\n\n\n @url = params[:video][:url]\n\n require 'uri'\n\n\n if(@url.downcase.include? 'youtube.com')\n ##create ways to catch if user is using \n query_string = URI.parse(params[:video][:url]).query\n parameters = Hash[URI.decode_www_form(query_string)]\n puts parameters['v'] # => aNdMiIAlK0g\n video_id = parameters['v']\n elsif (@url.downcase.include? 'y2u.be')\n puts video_id = @url.match(/\\.be\\/(.+)$/)[1]\n @url = 'http://www.youtube.com/watch?v='+video_id\n puts params[:video][:url] = @url \n elsif (@url.downcase.include? 'youtu.be')\n puts video_id = @url.match(/\\.be\\/(.+)$/)[1]\n @url = 'http://www.youtube.com/watch?v='+video_id\n puts params[:video][:url] = @url\n end\n \n \n\n @yt_client = YouTubeIt::Client.new(:dev_key => \"AI39si6hkRNCL77mzzv1LycIohZtksVIi0L5S9lQMx6crqOfGdyKcB2U2M5WHeNBUT2VLgTVzjR9rxPa1RJZw-sZ6wqtnaZ7AA\")\n @video.youtube_id = video_id # => aNdMiIAlK0g\n\n this_video = @yt_client.video_by(video_id)\n\n\n @video.duration = this_video.duration \n\n\n\n\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end", "def url_to_video(source, options = T.unsafe(nil)); end", "def vivo_ids\n vivo_uris.map {|uri| uri.to_s.split('/').last.to_i }\nend", "def verify_user_owns_page\n ruby_code_from_view.ruby_code_from_view do |rb_from_view|\n if we_should_show_og_tags && [email protected]? \n # Facebook OpenGraph protocol for embedding our video link back to Brevidy \n public_video_url(:public_token => @video.public_token) \n @video.title \n @video.description \n @video.get_thumbnail_url(@video.selected_thumbnail) \n public_video_url(:public_token => @video.public_token) \n else \n # Standard meta tags \n image_path('meta_tag_logo.png') \n end \n browser_title \n # Logged In CSS \n cache_buster_path('/stylesheets/i_love_lamp-1.0.3.min.css') \n # Site-wide JS \n javascript_include_tag \"https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js\" \n cache_buster_path('/javascripts/functions.min.js') \n cache_buster_path('/javascripts/i_love_lamp-1.0.3.min.js') \n javascript_include_tag \"player/player.js\" \n javascript_include_tag \"http://html5shiv.googlecode.com/svn/trunk/html5.js\" \n # Fav Icon and CSRF meta tag \n favicon_link_tag \n csrf_meta_tag \n get_background_for_user \n # Top navigation header \n link_to(image_tag(\"brevidy_rgb_white.png\", :size => \"135x35\", :alt => \"Brevidy - The Soul of Video\"), signed_in? ? user_stream_path(current_user) : :root, :class => \"brand\") \n video_search_path \n if signed_in? \n link_to(\"Explore\", explore_path) \n link_to(\"Upload\", new_user_video_path(current_user)) \n link_to(\"Share a Link\", user_share_dialog_path(current_user), :remote => true, \"data-method\" => \"GET\") \n link_to(\"Invite\", user_invitations_path(current_user)) \n end \n if signed_in? \n link_to(user_path(current_user), :class => \"dropdown-toggle\") do \n image_tag(\"#{current_user.image.blank? ? 'default_user_35px.jpg' : current_user.image_url(:small_profile) }\", :alt => \"#{current_user.name}\", :size => \"35x35\") \n current_user.username \n end \n link_to(\"My Channels\", user_channels_path(current_user)) \n link_to(\"Account Settings\", user_account_path(current_user)) \n link_to(\"Find People\", find_people_path) \n link_to(\"Help\", \"http://getsatisfaction.com/brevidy\", :target => \"_blank\") \n link_to(\"Logout\", logout_path, :remote => true, \"data-method\" => \"DELETE\") \n else \n link_to(\"Explore\", explore_path) \n link_to(\"Sign up\", signup_path) \n link_to(\"Login\", login_path) \n end \n \n # Main container \n # Dark Content Wrapper \n # Main (White) Content Wrapper \n link_to \"Go back\", :back \n image_tag(\"okayguy.png\", :alt => \"Okay\", :size => \"256x275\") \n # Lower navigation \n unless @page_has_infinite_scrolling \n succeed \" \" do \n link_to(\"FAQ\", faq_path, :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Blog\", \"http://blog.brevidy.com\", :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Status\", \"http://status.brevidy.com\", :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Contact\", contact_path, :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Terms\", tos_path, :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Privacy\", privacy_path, :class => \"inlinelink\") \n end \n \n end \n # GetSatisfaction Feedback Widget & Google Analytics \n # Google Analytics \n # GetSatisfaction Code \n # AddThis script \n \n # Scroll back to top \n\nend\n\n end", "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 index\n redirect_to videos_url\n end", "def youtube_url\n \"https://www.youtube.com/watch?v=#{@data['youtubeID']}\" if @data['youtubeID']\n end", "def parse_activity_videos(entry)\n videos = []\n\n entry.css(\"link\").each do |link_tag|\n videos << YouTubeIt::Parser::VideoFeedParser.new(link_tag).parse if link_tag.at(\"entry\")\n end\n\n if videos.size <= 0\n videos = nil\n end\n\n return videos\n end", "def stream_url\n\t\t\"http://www.google.com\"\n\tend", "def get\n page = Page.where(url: @url).first\n\n # if not crawled page, crawl it\n unless page\n uri = URI(@url)\n client = self.client(\"#{uri.scheme}://#{uri.host}\")\n\n begin\n response = client.get(uri.request_uri)\n raise unless response.success?\n rescue\n Page.create(url: @url, is_exist: false, extracted_at: Time.now)\n return render json: { message: \"Invalid Url\" }, status: :bad_request\n end\n\n page = Page.create(url: @url, is_exist: true, extracted_at: Time.now)\n extracted_ids = self.extract_ids(response.body)\n\n # crawl youtube video titles if not have complete them\n exist_videos = Video.where(youtube_id: extracted_ids)\n exist_video_ids = exist_videos.map(&:id)\n unexist_ids = extracted_ids.reject{|id| exist_video_ids.include?(id) }\n unexist_videos = unexist_ids.map {|id| crawl_youtube_video(id) }\n # XXX why cannot work????\n # unexist_videos = Parallel.map(unexist_ids) do |id|\n # ActiveRecord::Base.connection_pool.with_connection do\n # crawl_youtube_video(id)\n # end\n # end\n page.add_videos!(exist_videos + unexist_videos)\n end\n\n if page.exist?\n @videos = page.valid_videos\n @message = \"Cannot find any available videos\" if @videos.empty?\n else\n return render json: { message: \"Invalid Url\" }, status: :bad_request\n end\n end", "def search_videos(search_string)\n url = \"http://www.blip.tv/search/?search=#{search_string}&skin=json\"\n request = open(url,{\"UserAgent\" => \"Ruby-Wget\"}).read\n json = JSON.parse(request[16...-3])\n parse_json_videos_list(json)\n end", "def show_youtube\n @youtube = YoutubeMovie.find(params[:id])\n s = @youtube.url.index(\"?v=\")\n e = @youtube.url.index(\"&\")\n @id = @youtube.url[s+3..e-1] rescue 1\n end", "def get(url); end", "def video_by(vid)\n video_id = vid =~ /^http/ ? vid : \"http://gdata.youtube.com/feeds/api/videos/#{vid}\"\n parser = YouTubeG::Parser::VideoFeedParser.new(video_id)\n parser.parse \n end", "def video_id\n match = uri.path.match(/\\/v_show\\/id_([a-zA-Z0-9_=\\-]+)(\\.html)?.*/)\n return match[1] if match && match[1]\n\n nil\n rescue\n return nil\n end", "def video_id\n match = uri.path.match(/\\/v_show\\/id_([a-zA-Z0-9]*)(\\.html)*/)\n return match[1] if match && match[1]\n\n nil\n rescue\n return nil\n end", "def verify_user_can_access_channel\n unless user_can_access_channel\n if (params[:controller] == \"channels\" && params[:action] == \"show\")\n ruby_code_from_view.ruby_code_from_view do |rb_from_view|\n if we_should_show_og_tags && [email protected]? \n # Facebook OpenGraph protocol for embedding our video link back to Brevidy \n public_video_url(:public_token => @video.public_token) \n @video.title \n @video.description \n @video.get_thumbnail_url(@video.selected_thumbnail) \n public_video_url(:public_token => @video.public_token) \n else \n # Standard meta tags \n image_path('meta_tag_logo.png') \n end \n browser_title \n # Logged In CSS \n cache_buster_path('/stylesheets/i_love_lamp-1.0.3.min.css') \n # Site-wide JS \n javascript_include_tag \"https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js\" \n cache_buster_path('/javascripts/functions.min.js') \n cache_buster_path('/javascripts/i_love_lamp-1.0.3.min.js') \n javascript_include_tag \"player/player.js\" \n javascript_include_tag \"http://html5shiv.googlecode.com/svn/trunk/html5.js\" \n # Fav Icon and CSRF meta tag \n favicon_link_tag \n csrf_meta_tag \n get_background_for_user \n # Top navigation header \n link_to(image_tag(\"brevidy_rgb_white.png\", :size => \"135x35\", :alt => \"Brevidy - The Soul of Video\"), signed_in? ? user_stream_path(current_user) : :root, :class => \"brand\") \n video_search_path \n if signed_in? \n link_to(\"Explore\", explore_path) \n link_to(\"Upload\", new_user_video_path(current_user)) \n link_to(\"Share a Link\", user_share_dialog_path(current_user), :remote => true, \"data-method\" => \"GET\") \n link_to(\"Invite\", user_invitations_path(current_user)) \n end \n if signed_in? \n link_to(user_path(current_user), :class => \"dropdown-toggle\") do \n image_tag(\"#{current_user.image.blank? ? 'default_user_35px.jpg' : current_user.image_url(:small_profile) }\", :alt => \"#{current_user.name}\", :size => \"35x35\") \n current_user.username \n end \n link_to(\"My Channels\", user_channels_path(current_user)) \n link_to(\"Account Settings\", user_account_path(current_user)) \n link_to(\"Find People\", find_people_path) \n link_to(\"Help\", \"http://getsatisfaction.com/brevidy\", :target => \"_blank\") \n link_to(\"Logout\", logout_path, :remote => true, \"data-method\" => \"DELETE\") \n else \n link_to(\"Explore\", explore_path) \n link_to(\"Sign up\", signup_path) \n link_to(\"Login\", login_path) \n end \n \n # Main container \n # Lower navigation \n unless @page_has_infinite_scrolling \n succeed \" \" do \n link_to(\"FAQ\", faq_path, :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Blog\", \"http://blog.brevidy.com\", :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Status\", \"http://status.brevidy.com\", :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Contact\", contact_path, :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Terms\", tos_path, :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Privacy\", privacy_path, :class => \"inlinelink\") \n end \n \n end \n # GetSatisfaction Feedback Widget & Google Analytics \n # Google Analytics \n # GetSatisfaction Code \n # AddThis script \n \n # Scroll back to top \n\nend\n\n else\n ruby_code_from_view.ruby_code_from_view do |rb_from_view|\n if we_should_show_og_tags && [email protected]? \n # Facebook OpenGraph protocol for embedding our video link back to Brevidy \n public_video_url(:public_token => @video.public_token) \n @video.title \n @video.description \n @video.get_thumbnail_url(@video.selected_thumbnail) \n public_video_url(:public_token => @video.public_token) \n else \n # Standard meta tags \n image_path('meta_tag_logo.png') \n end \n browser_title \n # Logged In CSS \n cache_buster_path('/stylesheets/i_love_lamp-1.0.3.min.css') \n # Site-wide JS \n javascript_include_tag \"https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js\" \n cache_buster_path('/javascripts/functions.min.js') \n cache_buster_path('/javascripts/i_love_lamp-1.0.3.min.js') \n javascript_include_tag \"player/player.js\" \n javascript_include_tag \"http://html5shiv.googlecode.com/svn/trunk/html5.js\" \n # Fav Icon and CSRF meta tag \n favicon_link_tag \n csrf_meta_tag \n get_background_for_user \n # Top navigation header \n link_to(image_tag(\"brevidy_rgb_white.png\", :size => \"135x35\", :alt => \"Brevidy - The Soul of Video\"), signed_in? ? user_stream_path(current_user) : :root, :class => \"brand\") \n video_search_path \n if signed_in? \n link_to(\"Explore\", explore_path) \n link_to(\"Upload\", new_user_video_path(current_user)) \n link_to(\"Share a Link\", user_share_dialog_path(current_user), :remote => true, \"data-method\" => \"GET\") \n link_to(\"Invite\", user_invitations_path(current_user)) \n end \n if signed_in? \n link_to(user_path(current_user), :class => \"dropdown-toggle\") do \n image_tag(\"#{current_user.image.blank? ? 'default_user_35px.jpg' : current_user.image_url(:small_profile) }\", :alt => \"#{current_user.name}\", :size => \"35x35\") \n current_user.username \n end \n link_to(\"My Channels\", user_channels_path(current_user)) \n link_to(\"Account Settings\", user_account_path(current_user)) \n link_to(\"Find People\", find_people_path) \n link_to(\"Help\", \"http://getsatisfaction.com/brevidy\", :target => \"_blank\") \n link_to(\"Logout\", logout_path, :remote => true, \"data-method\" => \"DELETE\") \n else \n link_to(\"Explore\", explore_path) \n link_to(\"Sign up\", signup_path) \n link_to(\"Login\", login_path) \n end \n \n # Main container \n # Dark Content Wrapper \n # Main (White) Content Wrapper \n link_to \"Go back\", :back \n image_tag(\"okayguy.png\", :alt => \"Okay\", :size => \"256x275\") \n # Lower navigation \n unless @page_has_infinite_scrolling \n succeed \" \" do \n link_to(\"FAQ\", faq_path, :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Blog\", \"http://blog.brevidy.com\", :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Status\", \"http://status.brevidy.com\", :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Contact\", contact_path, :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Terms\", tos_path, :class => \"inlinelink\") \n end \n succeed \" \" do \n link_to(\"Privacy\", privacy_path, :class => \"inlinelink\") \n end \n \n end \n # GetSatisfaction Feedback Widget & Google Analytics \n # Google Analytics \n # GetSatisfaction Code \n # AddThis script \n \n # Scroll back to top \n\nend\n\n end\n end\n end", "def parse_url(url)\n regex = /(?:.be\\/|\\/watch\\?v=|\\/(?=p\\/))([\\w\\/\\-]+)/\n url.match(regex)[1] unless url.match(regex).nil?\n end", "def url\n match(/URL\\s+:\\s+(.+)/)\n end" ]
[ "0.7082522", "0.6794188", "0.66055846", "0.6520774", "0.6426998", "0.6340824", "0.6217328", "0.61695296", "0.6168784", "0.615081", "0.6111477", "0.6023151", "0.60227937", "0.6020153", "0.598621", "0.59522283", "0.5908281", "0.5902367", "0.5877663", "0.5853634", "0.5841633", "0.57991564", "0.57879895", "0.5761611", "0.5710602", "0.5695496", "0.56802404", "0.5668659", "0.5656225", "0.56308323", "0.56173396", "0.5606876", "0.55958533", "0.55930775", "0.5593033", "0.55907905", "0.5575974", "0.55725485", "0.55681115", "0.55561835", "0.55411255", "0.5515188", "0.5509815", "0.5504689", "0.5494203", "0.5488848", "0.5465411", "0.5460252", "0.5459508", "0.5445554", "0.5440596", "0.54349387", "0.54311436", "0.54268646", "0.54176635", "0.541373", "0.54110587", "0.538959", "0.53888744", "0.5385349", "0.5379291", "0.5375202", "0.5356459", "0.5355841", "0.53474647", "0.5345852", "0.53446066", "0.5339348", "0.53145134", "0.5312856", "0.5308556", "0.53014356", "0.52993166", "0.5292481", "0.52876186", "0.5265364", "0.5265364", "0.52636784", "0.52621", "0.5250498", "0.5249417", "0.524849", "0.52355033", "0.5227783", "0.52109605", "0.5208848", "0.52076185", "0.5204221", "0.5202778", "0.52027375", "0.51760226", "0.5175538", "0.5174265", "0.5172997", "0.5170847", "0.51654476", "0.51626974", "0.5156047", "0.51415026", "0.5130038" ]
0.65810585
3
Test about associating token info with node Might delete this method
def setLine (line) @line = line end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_token\n end", "def token\n end", "def token; end", "def token; end", "def token; end", "def token; end", "def token; end", "def token; end", "def push_token(tk); end", "def process_token(tk); end", "def token\n @token\n end", "def assign_token(user)\n\t\t0\n\tend", "def create_token\n if self.token.nil?\n self.token = loop do\n random_token = \"BON-#{SecureRandom.uuid.split('-').first}\"\n break random_token unless self.class.exists?(token: random_token)\n end\n end\n end", "def pass_token\n next_remote_node = @calendar_network.get_next_remote_node\n puts \"Passing token to #{next_remote_node}\"\n if !@calendar_network.has_token || next_remote_node == @calendar_network.local_node || @calendar_network.need_token\n return true\n end\n puts \"Passing token to: \" + next_remote_node.to_s\n remote_server = xml_rpc_client(next_remote_node.address, @calendar_network.config[\"path\"], next_remote_node.port)\n remote_server.call(\"calendar_network.take_token\")\n\n @calendar_network.has_token = false\n true\n end", "def token_attribute; end", "def validate_token_hash; end", "def token; config[:token]; end", "def token\n @token\n end", "def test_finding_a_token\n assert_equal \"returns\", @vtree.get_token(\"current\\t\\treturns the current\", 16)\n end", "def match_token (exp, token)\n\tputs \"Leaf token received: #{token.value}\"\n\tputs \"\\tExpecting token of type: #{exp}\"\n\n\tif exp == token.type\n\t\tputs \"\\t\\tShiny. Got #{token.type}!\"\n\t\t$cst.add_leaf(token.value, token)\n\t\t\n\t\t# To try to make this auto-managed\n\t\t$index = $index + 1\n\t\t\n\telse\n\t\traise FaultyTokenError.new(exp, token)\n\tend\nend", "def create_node(node, token)\n raise NotImplementedError\n end", "def token\n @token.present? ? @token : token_hash\n end", "def generate_token\n self.token = custom_token.presence || SecureRandom.hex(3)\n self.custom_token = nil\n generate_token if AliasedLink.exists?(token: token)\n end", "def populate_token\n if new_record? && self.token.nil?\n self.token = SecureRandom.uuid().to_s.last(8)\n while check_token?(self.token) == true\n self.token = SecureRandom.uuid().to_s.last(8)\n end\n end\n end", "def assign_unique_token\n unless(self.token)\n begin\n self.token = rand(36**8).to_s(36).downcase # a-z \n end while self.class.exists?(:token => token)\n end\n end", "def principal_token=(token)\n end", "def initialize(token) \n self.token_set = token\n end", "def create_token\n token = SecureRandom.hex(10) #on crée un token de 10 caractères au hasard\n self.token = token #affectation du token à la candidature\n self.save\n end", "def test_get_token\n # iterate through all the test cases\n token_test_cases.each do |t|\n token = IR.new.get_token_str([t[:str]])\n assert_equal(\n t[:desired_tokens],\n token.map(&:to_s)\n )\n end\n end", "def test_get_token\n # iterate through all the test cases\n token_test_cases.each do |t|\n token = IR.new.get_token_str([t[:str]])\n assert_equal(\n t[:desired_tokens],\n token.map(&:to_s)\n )\n end\n end", "def next_token; end", "def token(request)\n end", "def set_token\n @token = @instance.tokens.find(params[:id] || params[:token_id])\n end", "def valid_token\n # generate the token\n self.token=Digest::MD5.hexdigest(\"#{Time.now}-#{self.ad_id}-#{self.publisher_id}\")\n\n # Aux var to the ValidatorLoop\n counter = 0\n\n # Loop which validate the token on the DB\n while true do\n another_access = Access.where(token: self.token).take\n break if another_access.nil?\n self.token=\"#{self.token}#{counter}\"\n counter=counter+1\n end\n end", "def token\n @data[:token]\n end", "def token_get()\n\t\tputs \"Here is the token \" + @token\n\tend", "def set_internal_token!\n self.token ||= generate_token\n end", "def initialize\n setup_token\n end", "def fetch_token_details\n\n token_resp = Util::EntityHelper.fetch_and_validate_token(@client_id, 'a_s_tm_gtdbs')\n\n # as the above method would return error if token was not found.\n # it is a valid scenario here, this ignoring error\n @token = token_resp.data\n\n success\n\n end", "def scan_for_on(token); end", "def token\n @attributes[:token]\n end", "def token_key\n @token_key\n end", "def setup_token\n token = SecureRandom.hex(16)\n @token = token\n token\n end", "def token?\n parent_id.present? && coin?\n end", "def data\n token\n end", "def set_token\n @token = @instance.tokens.find(params[:id] || params[:token_id])\n end", "def set_token\n @token = @instance.tokens.find(params[:id] || params[:token_id])\n end", "def owner_token\n end", "def initialize(token)\n #accepts a token to assign\n @token = token\n end", "def tokens; end", "def tokens; end", "def tokens; end", "def tokens; end", "def tokens; end", "def tokens; end", "def tokens; end", "def tokens; end", "def token_hash=(_arg0); end", "def initialize(token)\n\t\t@token = token\n\tend", "def verify_token\n associate = Associate.where(id: params[:associate_id])[0] if params[:associate_id]\n #checking signed_in user\n if user_signed_in?\n #checking token is nil or not.\n if params[:token].nil?\n #response in json format\n render :json=> { success: false, message: \"Token is required to proceed further.\" },:status=> 203\n return\n elsif associate && associate.associate_user == true\n return true\n #checking token with the current_user\n elsif current_user.authentication_token != params[:token]\n render :json=> { success: false, message: \"Problem with the authentication token.please check token.\" },:status=> 203\n return\n else\n end\n end\n end", "def token?\n @token && [email protected]?\n end", "def set_token\n @token = Token.find(params[:id])\n end", "def token?\n (@token.respond_to?(:empty?) && [email protected]?)\n end", "def add_token(xml, token, expiry, address, cv2)\n\n xml.tag! :Card do\n\n # DataCash calls the CC number 'pan'\n xml.tag! :pan, {type: 'token'}, token\n xml.tag! :expirydate, format_date(expiry.month, expiry.year)\n\n xml.tag! :Cv2Avs do\n xml.tag! :cv2, cv2\n xml.tag! :cv2_present, '1'\n\n if address\n xml.tag! :street_address1, address[:address1] unless address[:address1].blank?\n xml.tag! :street_address2, address[:address2] unless address[:address2].blank?\n xml.tag! :street_address3, address[:city] unless address[:city].blank?\n xml.tag! :street_address4, address[:state] unless address[:state].blank?\n xml.tag! :postcode, address[:zip] unless address[:zip].blank?\n xml.tag! :country, address[:country] unless address[:country].blank?\n end\n # The ExtendedPolicy defines what to do when the passed data\n # matches, or not...\n #\n # All of the following elements MUST be present for the\n # xml to be valid (or can drop the ExtendedPolicy and use\n # a predefined one\n # xml.tag! :ExtendedPolicy do\n # xml.tag! :cv2_policy,\n # :notprovided => POLICY_REJECT, # REJ\n # :notchecked => POLICY_REJECT, # REJ\n # :matched => POLICY_ACCEPT,\n # :notmatched => POLICY_REJECT, # REJ\n # :partialmatch => POLICY_REJECT\n # xml.tag! :postcode_policy,\n # :notprovided => POLICY_ACCEPT,\n # :notchecked => POLICY_ACCEPT,\n # :matched => POLICY_ACCEPT,\n # :notmatched => POLICY_REJECT, # REJ\n # :partialmatch => POLICY_ACCEPT\n # xml.tag! :address_policy,\n # :notprovided => POLICY_ACCEPT,\n # :notchecked => POLICY_ACCEPT,\n # :matched => POLICY_ACCEPT,\n # :notmatched => POLICY_REJECT, # REJ\n # :partialmatch => POLICY_ACCEPT\n # end\n end\n end\n end", "def token\n @@token ||= fetch_token\n end", "def token?(token)\n return false\n end", "def token=(_arg0); end", "def token=(_arg0); end", "def token=(_arg0); end", "def set_token\n self.token = Digest::SHA2.hexdigest \"#{username}-#{lastvisitDate.to_i}\" if self.token.blank?\n end", "def save_token\n self.token = SecureRandom.uuid unless self.token\n end", "def tikify(token)\n if @tikis.has_key?(token) then\n return @tikis[token]\n else\n (@tokens.length + 1) % 1000 == 0 and puts \"#{@tokens.length + 1} tokens\"\n @tokens << token\n return @tikis[token] = @tokens.length - 1\n end\n end", "def initialize(token)\n @token = token\n end", "def initialize(token)\n @token = token\n end", "def generate_token\n #Token.generate_token(self.id)\n end", "def create_token\n Rails.logger.info(\"Enter Create Token\")\n \n # create token\n token = GenerateToken.unique_token\n access_token = self.create_access_token( token: token, role: {})\n raise et(\"account.create_token_failed\") if access_token.blank?\n\n true\n rescue => e \n Rails.logger.error(\"**** ERROR **** #{e.message}\")\n end", "def save token_object\n #raise StandardError\n unless token_object.respond_to?('token')\n raise TokenObjectError\n end \n super(token_object)\n end", "def token\n item = read\n return item['token'] if item['token']\n token_reset\n read['token']\n end", "def process_token(token)\n # Create a ProcessedToken to make sure we don't process the same thing twice\n processed_token = ProcessedToken.new(token.name, token.parent)\n \n unless @processed_tokens.include?(processed_token)\n # Add to the right array of tokens\n tokens[token.classifier] << token\n @processed_tokens << processed_token\n \n # WTF!? :)\n raise token.method_list[0].singleton.inspect unless token.method_list[0].singleton rescue true\n \n # Process the tokens inside of this one accordingly\n [:method_list, :classes, :modules].each do |meth, type|\n token.send(meth).each do |item|\n process_token item\n end if token.respond_to?(meth)\n end\n end\n end", "def token!\n # at line 1:8: ( T__48 | T__49 | T__50 | T__51 | T__52 | CATEGORY_KEY | LINK_KEY | X_OCCI_ATTRIBUTE_KEY | X_OCCI_LOCATION_KEY | ACTION | ACTIONS | AMPERSAND | AT | ATTRIBUTES | BACKSLASH | CATEGORY | CLASS | COLON | DASH | DOT | EQUALS | GT | HASH | KIND | LINK | LOCATION | LT | MIXIN | PERCENT | PLUS | QUESTION | QUOTE | REL | SCHEME | SELF | SEMICOLON | SLASH | SQUOTE | TERM | TILDE | TITLE | UNDERSCORE | LBRACKET | RBRACKET | LOALPHA | UPALPHA | DIGIT | WS | ESC )\n alt_5 = 49\n alt_5 = @dfa5.predict( @input )\n case alt_5\n when 1\n # at line 1:10: T__48\n t__48!\n\n when 2\n # at line 1:16: T__49\n t__49!\n\n when 3\n # at line 1:22: T__50\n t__50!\n\n when 4\n # at line 1:28: T__51\n t__51!\n\n when 5\n # at line 1:34: T__52\n t__52!\n\n when 6\n # at line 1:40: CATEGORY_KEY\n category_key!\n\n when 7\n # at line 1:53: LINK_KEY\n link_key!\n\n when 8\n # at line 1:62: X_OCCI_ATTRIBUTE_KEY\n x_occi_attribute_key!\n\n when 9\n # at line 1:83: X_OCCI_LOCATION_KEY\n x_occi_location_key!\n\n when 10\n # at line 1:103: ACTION\n action!\n\n when 11\n # at line 1:110: ACTIONS\n actions!\n\n when 12\n # at line 1:118: AMPERSAND\n ampersand!\n\n when 13\n # at line 1:128: AT\n at!\n\n when 14\n # at line 1:131: ATTRIBUTES\n attributes!\n\n when 15\n # at line 1:142: BACKSLASH\n backslash!\n\n when 16\n # at line 1:152: CATEGORY\n category!\n\n when 17\n # at line 1:161: CLASS\n class!\n\n when 18\n # at line 1:167: COLON\n colon!\n\n when 19\n # at line 1:173: DASH\n dash!\n\n when 20\n # at line 1:178: DOT\n dot!\n\n when 21\n # at line 1:182: EQUALS\n equals!\n\n when 22\n # at line 1:189: GT\n gt!\n\n when 23\n # at line 1:192: HASH\n hash!\n\n when 24\n # at line 1:197: KIND\n kind!\n\n when 25\n # at line 1:202: LINK\n link!\n\n when 26\n # at line 1:207: LOCATION\n location!\n\n when 27\n # at line 1:216: LT\n lt!\n\n when 28\n # at line 1:219: MIXIN\n mixin!\n\n when 29\n # at line 1:225: PERCENT\n percent!\n\n when 30\n # at line 1:233: PLUS\n plus!\n\n when 31\n # at line 1:238: QUESTION\n question!\n\n when 32\n # at line 1:247: QUOTE\n quote!\n\n when 33\n # at line 1:253: REL\n rel!\n\n when 34\n # at line 1:257: SCHEME\n scheme!\n\n when 35\n # at line 1:264: SELF\n self!\n\n when 36\n # at line 1:269: SEMICOLON\n semicolon!\n\n when 37\n # at line 1:279: SLASH\n slash!\n\n when 38\n # at line 1:285: SQUOTE\n squote!\n\n when 39\n # at line 1:292: TERM\n term!\n\n when 40\n # at line 1:297: TILDE\n tilde!\n\n when 41\n # at line 1:303: TITLE\n title!\n\n when 42\n # at line 1:309: UNDERSCORE\n underscore!\n\n when 43\n # at line 1:320: LBRACKET\n lbracket!\n\n when 44\n # at line 1:329: RBRACKET\n rbracket!\n\n when 45\n # at line 1:338: LOALPHA\n loalpha!\n\n when 46\n # at line 1:346: UPALPHA\n upalpha!\n\n when 47\n # at line 1:354: DIGIT\n digit!\n\n when 48\n # at line 1:360: WS\n ws!\n\n when 49\n # at line 1:363: ESC\n esc!\n\n end\n end", "def token\n begin\n self.token = SecureRandom.hex\n end while self.class.exists?(token: auth_token)\n end", "def scan_for_t(token); end", "def after_token_authentication\n end", "def after_token_authentication\n end", "def token_uri; end", "def initialize(token)\n @token = token\n end", "def token\n unless defined?(@token)\n @token = {\n 'id' => self.catalog['token']['id'],\n 'expires' => Time.parse(self.catalog['token']['expires'])\n }\n @token['tenant'] = self.catalog['token']['tenant']['id'] if self.catalog['token']['tenant']\n end\n @token\n end", "def token_type; end", "def token\n @token ||= Token.new(config)\n end", "def fix_up_token\n# FIX THIS: token age should be configurable\n new_token if updated_at < 1.day.ago\n end", "def sync_token\n # Will be 'null' in the first round, and will increment ever after.\n @token\n end", "def for_node; end", "def token\n @token ||= @context[\"value\"]\n end", "def create\n @apn_token = ApnToken.find_by(token: apn_token_params[:token])\n @apn_token = ApnToken.new(apn_token_params) unless @apn_token\n @apn_token.updated_at = Time.now\n respond_to do |format|\n if @apn_token.save\n format.html { redirect_to @apn_token, notice: 'Apn token was successfully created.' }\n format.json { render :show, status: :created, location: @apn_token }\n else\n format.html { render :new }\n format.json { render json: @apn_token.errors, status: :unprocessable_entity }\n end\n end\n end", "def token=(_token)\n raise NotImplementedError, \"#token= is not implemented\"\n end", "def match_token(token)\n return true\n end", "def set_token! model\n token = set_token model\n model.save!\n token\n end", "def ensure_token!(instance)\n reset_token!(instance) unless token_set?(instance)\n get_token(instance)\n end", "def require_tokens\n @tokens_required = true\n end", "def test_token(token)\n Discordrb::API.validate_token(token)\n end", "def next_token\n\t\[email protected]_token\n\tend" ]
[ "0.6736973", "0.6532654", "0.6398172", "0.6398172", "0.6398172", "0.6398172", "0.6398172", "0.6398172", "0.62084687", "0.60977995", "0.593706", "0.59104717", "0.5894079", "0.58867645", "0.5874596", "0.5858708", "0.58429295", "0.58253163", "0.5807749", "0.57968974", "0.57965446", "0.5787496", "0.57734674", "0.57592887", "0.57387877", "0.57338446", "0.5731224", "0.57255125", "0.57213086", "0.57213086", "0.5710213", "0.57071865", "0.56931955", "0.5691685", "0.56702757", "0.5657346", "0.5656845", "0.5655248", "0.56495863", "0.5648635", "0.56379294", "0.5613936", "0.5609687", "0.558773", "0.5575159", "0.556483", "0.556483", "0.5548552", "0.5543282", "0.554327", "0.554327", "0.554327", "0.554327", "0.554327", "0.554327", "0.554327", "0.554327", "0.553272", "0.5530992", "0.55291706", "0.55152833", "0.5514932", "0.54874486", "0.548552", "0.54714894", "0.5467796", "0.5456215", "0.5456215", "0.5456215", "0.54531056", "0.54473776", "0.5445778", "0.54424894", "0.54424894", "0.5441228", "0.54388654", "0.54262733", "0.5394543", "0.53710675", "0.53666383", "0.5366279", "0.53490084", "0.53459036", "0.53459036", "0.5344952", "0.5330144", "0.53175694", "0.5312231", "0.53032726", "0.5295848", "0.5292401", "0.5289459", "0.5285221", "0.52834034", "0.52814835", "0.527611", "0.5276072", "0.52664864", "0.5262862", "0.5253573", "0.525168" ]
0.0
-1
Return the sequence of letters on the reflector.
def letters @letters.join("") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def letters\n # the_letters = []\n letter_regex = /[a-z]/i\n # for i in 0..self.length - 1\n # character = self[i]\n # if (character.match(letter_regex))\n # the_letters << character\n # end\n # end\n\n # self.chars.each do |character|\n # if character.match(letter_regex)\n # the_letters << character\n # end\n # end\n # the_letters.join\n\n # self.chars.select { |c| c.match letter_regex }.join\n\n # self.chars.map{ |c| c.match /[a-zA-Z]/ }.join\n\n self.scan(letter_regex).join\n end", "def letters\n the_letters = []\n letter_regex = /[a-z]/i\n chars.each do |character|\n the_letters << character if character.match(letter_regex)\n end\n the_letters.join\n end", "def letter_array (name)\n\tname.chars\nend", "def letters\n self.chars.select { |c| c.match(/[a-z]/i) }.join\nend", "def to_s\n letters\n end", "def alphabet\n ('A'..'Z').to_a\n end", "def alphabet\n ('A'..'Z').to_a\n end", "def alphabet\n ('a'..'z').to_a\n end", "def word\n @letters.join\n end", "def ordered_letters\n @word.chars.sort.join\n end", "def alphabet_array\n ('A'..'Z').to_a\n end", "def chars()\n #This is a stub, used for indexing\n end", "def letters\n @letters ||= (\n load_letters || corpus.letters\n )\n end", "def alphabet\n 'abcdefghijklmnopqrstuvwxyz'\n end", "def letters\n @letters ||= {\n \"2\" => ['a','b','c'],\n \"3\" => ['d','e','f'],\n \"4\" => ['g','h','i'],\n \"5\" => ['j','k','l'],\n \"6\" => ['m','n','o'],\n \"7\" => ['p','q','r','s'],\n \"8\" => ['t','u','v'],\n \"9\" => ['w','x','y','z']\n }\n end", "def output\n puts \"Letter sequence: #{char_list}\"\n puts \"Number sequence: #{num_list}\"\n end", "def letters_before(char)\n (\"a\"...char).to_a\nend", "def letter_list(equation)\n equation.gsub(/[^A-Z]/, '').chars.uniq\n end", "def get_alpha\n@alphabet\nend", "def marked_letters\n return if not_registered\n marked_choices.map do |q|\n q.map { |cho| (65+cho).chr }\n end\n end", "def characters; end", "def guess_letters\n guess_array = []\n @current_word.each do\n guess_array << \"_\"\n end\n return guess_array\n end", "def alphabet\n alpha = []\n @transitions.each { |k,v| alpha += v.keys }\n Set.new(expand_symbols(alpha))\n end", "def chars\n map { |b| b.chr }\n end", "def generate_alphabet\n (\"a\"..\"z\").to_a\nend", "def generate\n @letters = alphabet\n include_letters\n exclude_letters\n shuffle_alphabet_maybe\n reverse_alphabet_maybe\n @letters.split('').join(' ')\n end", "def alphabet\n read_attr :alphabet\n end", "def generate_letters( length )\n ('A'..'Z').to_a.sample( length ).join\n end", "def characters\n self.char_episode.collect{ |char_episode| char_episode.character }\n end", "def first_letters(morse, pos)\n\t letters = []\n\t @rev.keys.each { |k| letters << k unless morse[pos..-1].scan(/^#{k.gsub(\".\",\"\\\\.\")}.*/).empty? }\n\t\n\t letters\n\tend", "def get_one_char_names()\n names = []\n chars = get_poss_characters\n for pos in 0..chars.length-1\n names.push(chars[pos])\n end\n return names\nend", "def get_letters(word)\n word.encode('UTF-8').downcase.split(\"\")\n end", "def draw_letters\n # Letters A B C D E F G H I J K L M N O P Q R S T U V W X Y Z\n letter_dist = [9, 2, 2, 4, 12, 2, 3, 2, 9, 1, 1, 4, 2, 6, 8, 2, 1, 6, 4, 6, 4, 2, 2, 1, 2, 1]\n hand_size = 10\n # ASCII table number for a\n letter_a_offset = 65\n \n letter_pool = letter_dist.map.with_index { |dist, index| (index + letter_a_offset).chr * dist }\n return letter_pool.join('').split('').sample(hand_size)\nend", "def player_show_alph\n\t\t@letter_track.each_key{|key| puts key}\n\tend", "def letters_before(character)\n\t\n\t alphabet_storage = []\n results = []\n \n (\"a\"..\"z\").each do |i|\n \t alphabet_storage << i\n end\n \n starting_position = alphabet_storage.index(character) \n i = 0\n \n until i == starting_position\n results << alphabet_storage[i]\n i += 1\n end\n \n puts \"#{results}\"\nend", "def letters_and_digits\n self.to_s.scan(/\\w/).join\n end", "def get_poss_characters()\n alpha = \"abcdefghijklmnopqrstuvwxyz0123456789\"\n poss = []\n for i in (0..alpha.length-1)\n poss.push(alpha[i])\n end\n return poss\nend", "def characters\n characters = []\n self.episodes.each do |episode|\n characters << episode.characters\n end\n return characters.flatten.uniq\n end", "def charset\n names = []\n 26.times do |i|\n names << (65 + i).chr\n end\n names\nend", "def random_letters(length = 2)\n Array.new(length) { (rand(122-97) + 97).chr }.join\n end", "def alteration\n (0...length).flat_map { |i|\n LETTERS.map { |letter|\n string.dup.tap { |w| w[i] = letter }\n }\n }.uniq\n end", "def puts_letters\n puts \"a\"\n puts \"b\"\n puts \"c\"\nend", "def get_letters(instr)\n MORSE.each { |c, re|\n if (instr =~ re) then\n yield c,$1\n end\n }\nend", "def calculate_alphabet(str)\nend", "def letter_for(n)\n offset = n < 26 ? 'A'.ord : 'a'.ord\n ascii = offset + (n % 26)\n ascii.chr\n end", "def available_letters\n ltrs = []\n letter_set.letter_amount_points.each do |k, v|\n ltrs << k.to_s unless k == '?'\n end\n return ltrs.sort\n end", "def marked_letters_unique\n return if not_registered\n marked_choices_unique.map do |c|\n c.nil?? '' : (65+c).chr\n end\n end", "def alphabet_position(text)\r\n numbers = \"\"\r\n text.split(\"\").each do |letter|\r\n if is_char_in_alpha(letter) == true\r\n numbers += \"#{letter.upcase.ord - 'A'.ord + 1} \"\r\n end\r\n end\r\n return numbers.strip\r\n\r\nend", "def alphabet\n\t\treturn @variables | @constants\n\tend", "def processed_content\n scan(/[a-z]/i).join.downcase\n\n # self.letters.downcase\n end", "def getAlphabet\n alphabet = \"A\"..\"Z\"\n $alphabet_array = alphabet.to_a\nend", "def get_letter\n\t\t# move the 'a' and 'b' jokers \n\t\tmove_joker_a\n\t\tmove_joker_b\n\n\t\t# get their new positons\n\t\tnew_a = @deck_of_cards.index(Card.new(:joker, 1))\n\t\tnew_b = @deck_of_cards.index(Card.new(:joker, 2))\n\n\t\t# perform a triple split around the positions of the jokers\n\t\ttriple_split(new_a, new_b) if new_a < new_b\n\t\ttriple_split(new_b, new_a) if new_b < new_a\n\n\t\t# perform a count cut with the value of the bottom card\n\t\tcount_cut(@deck_of_cards[53].value)\n\n\t\t# now that the deck has been properly mutated, we can now\n\t\t# get the output lettere by getting the value of the top card in the deck\n\t\t# and stepping down that many cards (including the top) and converting\n\t\t# the value of the ending card to a letter\n\t\tfinal_val = @deck_of_cards[@deck_of_cards[0].value].value\n\tend", "def to_array\n @word.chars\n end", "def letter_choices(game_data)\n \"USED LETTERS: #{game_data.chosen_letters}\"\n end", "def alphabet_position(text)\n \nend", "def getAlphabeticalPosition()\n \n @alphabeticalPosition = returnPermutationsBefore(@multiLetterDivisor) + 1\n \n end", "def processed_content\n letter_regex = /[a-z0-9]/i\n to_s.scan(letter_regex).join.downcase\n end", "def _LETTER\n\n _save = self.pos\n while true # choice\n _tmp = apply(:_ALPHA)\n break if _tmp\n self.pos = _save\n _tmp = match_string(\"_\")\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n set_failed_rule :_LETTER unless _tmp\n return _tmp\n end", "def greek_organization\n Array.new(3) { |_| sample(greek_alphabet) }.join\n end", "def char_sequences(code)\n code.scan(/((.)\\2*)/)\n end", "def displayLettersFound()\n\n @lettersDisplayArr.each do |i| \n print i\n end\n print \"\\n\"\n end", "def encode\n @word.chars.map do |letter|\n index = @abc.index(letter) \n @abc_reverse[index]\n end.join\n \n end", "def all_characters\n @shows.map do |show|\n show.characters\n end.flatten\n end", "def alphabet_position(text)\n alpha = {\"a\" => 1, \"b\" => 2, \"c\" => 3, \"d\" => 4,\n \"e\" => 5, \"f\" => 6, \"g\" => 7, \"h\" => 8,\n \"i\" => 9, \"j\" => 10, \"k\" => 11, \"l\" => 12,\n \"m\" => 13, \"n\" => 14, \"o\" => 15, \"p\" => 16,\n \"q\" => 17, \"r\" => 18, \"s\" => 19, \"t\" => 20,\n \"u\" => 21, \"v\" => 22, \"w\" => 23, \"x\" => 24,\n \"y\" => 25, \"z\" => 26}\n \n array = []\n text.downcase.chars.each do |letter|\n if letter[/[a-zA-Z]+/]\n array.push(alpha[letter])\n end\n end\n array.join(\" \")\nend", "def pirates_say_arrrrrrrrr(string)\n # find index of r's but ignore when r is the last letter\n indices_of_r = (0..string.length - 2).select{|n| string[n] == \"r\" || string[n] == \"R\"}\n letters = \"\"\n # extract letters at indices of r + 1\n indices_of_r.each {|n|\n letters += string[n + 1]}\n letters\nend", "def characters\n pad.chars\n end", "def accessor(sequence)\n sequence.reverse.each_char.reduce(self) do |memo, char|\n case char\n when \"a\" then memo.head\n when \"d\" then memo.tail\n end\n end\n end", "def accessor(sequence)\n sequence.reverse.each_char.reduce(self) do |memo, char|\n case char\n when \"a\" then memo.head\n when \"d\" then memo.tail\n end\n end\n end", "def get_starting_letter\t\n\t\trandom_number = @random_number_generator.rand(0.0..1.0)\n\n @pair_probability_table.frequencies.select {|k, v| k[0] == ' ' &&\n k[1] != ' ' &&\n v >= random_number}.keys.sort.first[1]\n\tend", "def reverse_ordered_letters\n ordered_letters.reverse\n end", "def index_to_letter(index)\n ALPHA26[index]\n end", "def to_array\n\[email protected] \nend", "def characters\n chars = []\n participants.each do |participant|\n chars << participant.character unless chars.include?(participant.character)\n end\n chars\n end", "def next_letter(name)\r\n\tname.join.split('').map! {|letter|\r\n\t\tcase\r\n\t\twhen letter == \"a\"\r\n\t\t\tletter = \"e\"\r\n\t\twhen letter == \"e\"\r\n\t\t\tletter = \"i\"\r\n\t\twhen letter == \"o\"\r\n\t\t\tletter = \"u\"\r\n\t\twhen letter == \"u\"\r\n\t\t\tletter = \"a\"\r\n\t\twhen letter == \"z\"\r\n\t\t\tletter = \"b\"\r\n\t\twhen letter == \"d\"\r\n\t\t\tletter = \"f\"\r\n\t\twhen letter == \"h\"\r\n\t\t\tletter = \"j\"\r\n\t\twhen letter == \"n\"\r\n\t\t\tletter = \"p\"\r\n\t\twhen letter == \"t\"\r\n\t\t\tletter = \"v\"\r\n\t\twhen letter == \" \"\r\n\t\t\tletter = \" \"\r\n\t\telse letter = letter.next\r\n\t\tend\r\n\t}\r\nend", "def generate_keystream_letters\t\t\n\t\tdeck = Deck.new\n\t\twhile @keystream.length < @message.length\n\t\t\tletter = deck.cycle_steps\n\t\t\tunless letter.nil?\n\t\t\t\t@keystream << letter\n\t\t\tend\n\t\tend\n\t\t@keystream\n\tend", "def next_letters(string)\r\n\r\n string = swap_names(string)\r\n \r\n letters = string.split(\"\")\r\n \r\n \r\n next_letters = letters.map! do |letter|\r\n next_vowel?(letter)\r\n end\r\n \r\n next_letters.join(\"\")\r\n \r\n \r\nend", "def each_first_letters\n self.split.map(&:capitalize).join(' ')\n end", "def output_letter\r\n a = @deck.first\r\n a = 53 if a.instance_of? String\r\n output = @deck[a]\r\n if output.instance_of? String\r\n nil\r\n else\r\n output -= 26 if output > 26\r\n (output + 64).chr\r\n end\r\n end", "def pirates_say_arrrrrrrrr(string)\n characters = \"\"\n add_letter = false\n string.length.times do |index|\n current = string[index]\n characters << current if add_letter\n add_letter = (current == 'r' || current == 'R')\n end\n characters\nend", "def get index\n @letters[index]\n end", "def get_starting_letter\n random_number = @random_number_generator.rand(0.0..1.0)\n\n @pair_probability_table.frequencies.select do |k, v|\n k[0] == ' ' && k[1] != ' ' && v >= random_number\n end.keys.sort.first[1]\n end", "def encode\n @word.chars.map { |letter|\n index = @abc.index(letter)\n cipher_character = @abc_reverse[index]\n }.join\n end", "def letters_only(case_matters=false)\n just_letters = split('').find_all do |char| \n DUAL_CASE_ALPHABET.include?(char) \n end.join('')\n return just_letters if (case_matters)\n return just_letters.downcase\n end", "def get_three_char_names()\n names = []\n chars = get_poss_characters\n for i in 0..chars.length-1\n for j in 0..chars.length-1\n for k in 0..chars.length-1\n names.push(chars[i] + chars[j] + chars[k])\n end\n end\n end\n return names\nend", "def show_wrong_letters\n\t\t@wrong_letters.sort.join(\", \")\n\tend", "def processed_content\n self.letters.downcase\nend", "def customer_initials\n @customer_initials ||= ('a'..'z').to_a\n end", "def gen_alpha(length = 10)\n positive_int! length\n gen_string_from_letters length, ASCII_LETTERS\n end", "def pirates_say_arrrrrrrrr(string)\n last_letter_r = false\n array = []\n string.size.times { |x|\n string_letter = string[x]\n array << string_letter if last_letter_r\n last_letter_r = (string_letter == \"r\" || string_letter == \"R\") }\n array.join(\"\")\nend", "def assembled_characters\n characters_in_split_arrays.map {|array| array.join}\n end", "def get_edigaul\n if (@error)\n return @error\n else\n edigaul = \"\"\n\n edigaul_keys = @edigaul_letters.keys.sort\n edigaul_keys.each do |i|\n edigaul += @edigaul_letters[i].get_full_letter\n end\n\n return edigaul\n end\n end", "def vigenere_cipher(str, k)\n alpha = (\"a\"..\"z\").to_a\n\n msg = (0...str.length).map do |i|\n old_pos = alpha.index(str[i])\n new_pos = (old_pos + k[i%k.length]) % alpha.length\n alpha[new_pos]\n end\n\n msg.join()\nend", "def alphabet_position(text)\n text.downcase.delete(\"^a-z\").chars.map{ |chr| chr.ord - 96 }.join(\" \")\nend", "def alphabet_position(text)\n text.downcase.scan(/[a-z]/).map { |i| i.ord - 96 }.join(' ')\nend", "def get_word\n @lettercollection.push(@string_as_array[@i])\n @lettercollection.join('')\nend", "def generate_letter(cnt)\n letters = (\"0\"..\"9\").to_a + (\"a\"..\"f\").to_a\n word = \"\"\n cnt.times do\n word << letters.sample\n end\n word\nend", "def alphabet\n Set.new(to_a.flatten!.uniq!)\n end", "def letter_changes(string)\n array = (\"a\"..\"z\").to_a\n\n result_array = string.chars.map do |char|\n case\n when char.downcase == \"x\" then char == \"x\" ? \"a\" : \"A\"\n when char.downcase == \"y\" then char == \"y\" ? \"b\" : \"B\"\n when char.downcase == \"z\" then char == \"z\" ? \"c\" : \"C\"\n when char.match(/[a-z]/) then array[array.index(char.downcase) + 3]\n when char.match(/[A-Z]/) then array[array.index(char.downcase) + 3].upcase\n else char\n end\n end\n result_array.join\nend", "def initial_consonants\n \n @@sentence.map { |word|\n if word.start_with?('a','e','i','o','u','A','E','I','O','U') \n \"\" \n else \n consonant_blend = word.split /([aeiou].*)/\n consonant_blend[0]\n\n end\n }\n end", "def characters\n sample = @rows[0]\n sample.characters\n end" ]
[ "0.72158295", "0.69570714", "0.6926662", "0.68904597", "0.6764149", "0.6706202", "0.6706202", "0.6649412", "0.65311885", "0.6524821", "0.6502596", "0.6443188", "0.6435509", "0.64260197", "0.6414374", "0.64039165", "0.6389422", "0.63270694", "0.6261627", "0.6218776", "0.6193611", "0.6131265", "0.6124848", "0.6122464", "0.61116177", "0.60673106", "0.60315716", "0.60189927", "0.6006366", "0.5976647", "0.5942204", "0.59348595", "0.5929252", "0.59243673", "0.5903609", "0.58938146", "0.5887206", "0.5878589", "0.5876088", "0.5862834", "0.5854162", "0.5853585", "0.5845615", "0.5844375", "0.58309484", "0.58298224", "0.58210576", "0.5801321", "0.5796502", "0.57946444", "0.57882327", "0.57871664", "0.5776239", "0.5769002", "0.57653344", "0.576271", "0.57578176", "0.5756633", "0.5751668", "0.57514966", "0.5746477", "0.57355523", "0.5727703", "0.57240844", "0.57205313", "0.57130677", "0.57077765", "0.57077765", "0.57003313", "0.56911266", "0.5679503", "0.5679451", "0.5678517", "0.5675009", "0.567499", "0.5671307", "0.56550705", "0.5634566", "0.56325644", "0.5632115", "0.56136036", "0.560499", "0.55993694", "0.55951893", "0.5588828", "0.55886376", "0.5581538", "0.5581363", "0.5581089", "0.55792207", "0.55747294", "0.5569064", "0.5563691", "0.55629903", "0.5548492", "0.5544298", "0.55440676", "0.55421644", "0.5542134", "0.5537317" ]
0.76369154
0
Get the current letter position of the rotor.
def current_letter @letters[self.position] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def position_for(char)\n return ''.freeze if char.position.y == @y\n\n @y = char.position.y\n char.position.to_s\n end", "def current_char\n @current_char\n end", "def getAlphabeticalPosition()\n \n @alphabeticalPosition = returnPermutationsBefore(@multiLetterDivisor) + 1\n \n end", "def prev_char(single_letter)\n (single_letter.ord - 1).chr\nend", "def prev_char(single_letter)\n (single_letter.ord - 1).chr\nend", "def pos\n @position[:current]\n end", "def get_letter\n\t\t# move the 'a' and 'b' jokers \n\t\tmove_joker_a\n\t\tmove_joker_b\n\n\t\t# get their new positons\n\t\tnew_a = @deck_of_cards.index(Card.new(:joker, 1))\n\t\tnew_b = @deck_of_cards.index(Card.new(:joker, 2))\n\n\t\t# perform a triple split around the positions of the jokers\n\t\ttriple_split(new_a, new_b) if new_a < new_b\n\t\ttriple_split(new_b, new_a) if new_b < new_a\n\n\t\t# perform a count cut with the value of the bottom card\n\t\tcount_cut(@deck_of_cards[53].value)\n\n\t\t# now that the deck has been properly mutated, we can now\n\t\t# get the output lettere by getting the value of the top card in the deck\n\t\t# and stepping down that many cards (including the top) and converting\n\t\t# the value of the ending card to a letter\n\t\tfinal_val = @deck_of_cards[@deck_of_cards[0].value].value\n\tend", "def alphabet_position(text)\r\n numbers = \"\"\r\n text.split(\"\").each do |letter|\r\n if is_char_in_alpha(letter) == true\r\n numbers += \"#{letter.upcase.ord - 'A'.ord + 1} \"\r\n end\r\n end\r\n return numbers.strip\r\n\r\nend", "def closest_character_index(position)\n\t\t\t# Move caret into position\n\t\t\t# Try to get as close to the position of the cursor as possible\n\t\t\twidth = @font.width(@string, @height)\n\t\t\tx = @position.x\n\t\t\tmouse_x = $window.mouse.position_in_world.x\n\t\t\t\n\t\t\t# Figure out where mouse_x is along the continuum from x to x+width\n\t\t\t# Use that to guess what the closest letter is\n\t\t\t# * basically, this algorithm is assuming fixed width, but it works pretty well\n\t\t\tpercent = (mouse_x - x)/width.to_f\n\t\t\ti = (percent * (@string.length)).to_i\n\t\t\t\n\t\t\ti = 0 if i < 0\n\t\t\ti = @string.length if i > @string.length\n\t\t\t\n\t\t\treturn i\n\t\tend", "def alphabet_position(text)\n \nend", "def alphabet_position(text)\n text.downcase.delete(\"^a-z\").chars.map{ |chr| chr.ord - 96 }.join(\" \")\nend", "def get_char at\n index = range_correct_index(at)\n return internal_object_get(index + 1)\n end", "def position\n get_cipher_position * 64\n end", "def letter\n case @letter\n when \"q\"\n return \"qu\"\n else\n return @letter\n end\n end", "def orientation \n @position - @prev_position\n end", "def alphabet_position(text)\n text.downcase.scan(/[a-z]/).map { |c| c.ord - 96 }.join(' ')\nend", "def alphabet_position(text)\n text.downcase.scan(/[a-z]/).map { |i| i.ord - 96 }.join(' ')\nend", "def get index\n @letters[index]\n end", "def pos() @current end", "def current_position\n position = @position_overwrite || $game_system.message_position\n case position\n when 0\n return :top\n when 1\n return :middle\n when 2\n return :bottom\n end\n position\n end", "def get_direction\n return (@dir || @character.direction)\n end", "def letter_to_index(letter)\n ALPHA26.index(letter.upcase)\n end", "def update_position\n chr = Console.read_char\n\n offset = arrow_val(chr)\n if offset\n new_position = Coord.sum(position, offset)\n self.position = new_position if in_range?(new_position)\n end\n\n chr\n end", "def position\n current.position\n end", "def get_char_position_in_line\n raise NotImplementedError\n end", "def text_pos(pos = @pos)\t\n\t\treturn to_text(pos[0]) + (pos[1] + 1).to_s\n\tend", "def prev_char\n self.cursor -= 1\n end", "def _LETTER\n\n _save = self.pos\n while true # choice\n _tmp = apply(:_ALPHA)\n break if _tmp\n self.pos = _save\n _tmp = match_string(\"_\")\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n set_failed_rule :_LETTER unless _tmp\n return _tmp\n end", "def get_letter(word, index)\n if word[index] == 'Q' && index+1 < word.length && word[index+1] == 'U'\n return 'Qu'\n end\n\n return word[index]\n end", "def position\n\t\treturn \"#{@x} #{@y} #{PlanetModel::ORIENTATIONS.invert[@angle.abs % 360].to_s}#{if @lost == true then ' LOST' end}\"\t\n\tend", "def character_location\n ((@cr[5] ^ 0x08) & 0x08) << 12 | (@cr[5] & 0x07) << 10\n end", "def letterToInt (c)\n\t\treturn c.ord() -'A'.ord() + 1\n\tend", "def cur_pos\n @cursor.pos\n end", "def current_position\n @start_position + delta\n end", "def rot(position)\n position + 13\n end", "def decrypt_letter(pos,char)\n\tkey = [5,17,4,10,4,24]\n\t\n\tc = char.ord - key[pos%6]\n\tif c < 'A'.ord\n\t\tc += 26\n\tend\n\treturn c.chr\nend", "def get_pitch\n 12 * (@octave - 1) + @@letters[@letter] + @@accidentals[@accidental]\n end", "def get_swapped_char (letter)\n\tif is_vowel(letter)\n\t\tget_next_vowel(letter)\n\telse\n\t\tget_next_consonant(letter)\n\tend\nend", "def get_swapped_char (letter)\n\tif is_vowel(letter)\n\t\tget_next_vowel(letter)\n\telse\n\t\tget_next_consonant(letter)\n\tend\nend", "def decrypt_letter(pos,char)\t\n\tc = char.ord - $key[pos % KEY_LENGTH]\n\tif c < 'A'.ord\n\t\tc += 26\n\tend\n\treturn c.chr\nend", "def text_position\n end", "def current_position\n board.coordinates_of(capturing_pawn)\n end", "def get_char\n\t\tc = read_char\n\n\t\tcase c\n\t\twhen \"\\e[A\"\n\t\t\treturn :up\n\t\twhen \"\\e[B\"\n\t\t\treturn :down\n\t\twhen \"\\e[C\"\n\t\t\treturn :right\n\t\twhen \"\\e[D\"\n\t\t\treturn :left\n\t\twhen \"\\177\"\n\t\t\treturn :backspace\n\t\twhen \"\\004\"\n\t\t\treturn :delete\n\t\twhen \"\\e[3~\"\n\t\t\treturn :altdelete\n\t\twhen \"\\u0003\" # Ctrl C\n\t\t\texit 0\n\t\twhen /^.$/ # Only one char\n\t\t\treturn c\n\t\telse\n\t\t\tSTDERR.puts \"strange char: #{c.inspect}\"\n\t\tend\n\tend", "def character\n ang_moment.character\n end", "def getChar\n $look = ARGF.readchar\nend", "def alphabet_position(text)\n r = [*\"a\"..\"z\"] # a~z陣列\n text = text.downcase #轉成小寫\n text_to_array = text.split(\"\") #轉成陣列\n y = text_to_array.map do |i| #對應成陣列index值\n if r.index(i) != nil \n r.index(i) + 1 \n end \n end\n y = y.compact #去除nil\n y = y.join(\" \")\nend", "def shift_char(letter, shift)\n ascii_letter = letter.ord\n shifted_ascii = 0 # can't do Integer.new\n\n if ascii_letter >= 65 && ascii_letter <= 90\n shifted_ascii = ascii_letter-shift\n # if we go out of range, subtract high end by the difference\n # btwn low end and current value\n if shifted_ascii < 65\n shifted_ascii = 91-(65-shifted_ascii)\n end\n elsif ascii_letter >= 97 && ascii_letter <= 122\n shifted_ascii = ascii_letter-shift\n if shifted_ascii < 97\n shifted_ascii = 123-(97-shifted_ascii)\n end\n else\n return ascii_letter\n end\n return shifted_ascii\nend", "def getChar\n if @index <= @code.size - 1\n return @code[@index] if !@code[@index].nil?\n end\n # If nil return empty string.\n return nil\n end", "def text_coordinate\n return 39, 5, 222, 16\n end", "def get_char\n @look = @expression[@number]\n @number +=1\nend", "def get_position_in_list alphabet, letter\n pos = 0\n while pos < alphabet.length\n alphabet_letter = alphabet[pos]\n if alphabet_letter == letter.upcase\n # if so, return position\n return pos\n end\n pos = pos + 1\n end\n return pos\nend", "def alphabet_position(text)\n alpha = {\"a\" => 1, \"b\" => 2, \"c\" => 3, \"d\" => 4,\n \"e\" => 5, \"f\" => 6, \"g\" => 7, \"h\" => 8,\n \"i\" => 9, \"j\" => 10, \"k\" => 11, \"l\" => 12,\n \"m\" => 13, \"n\" => 14, \"o\" => 15, \"p\" => 16,\n \"q\" => 17, \"r\" => 18, \"s\" => 19, \"t\" => 20,\n \"u\" => 21, \"v\" => 22, \"w\" => 23, \"x\" => 24,\n \"y\" => 25, \"z\" => 26}\n \n array = []\n text.downcase.chars.each do |letter|\n if letter[/[a-zA-Z]+/]\n array.push(alpha[letter])\n end\n end\n array.join(\" \")\nend", "def position\n return @position\n end", "def position\n return @position\n end", "def useInstruct(letter, pos_x, pos_y)\n if letter == \"^\"\n pos_y -= 1\n elsif letter == \"v\"\n pos_y += 1\n elsif letter == \"<\"\n pos_x -= 1\n elsif letter == \">\"\n pos_x += 1\n end\n return pos_x, pos_y\nend", "def cur_angle\n MSPhysics::Newton::Corkscrew.get_cur_angle(@address)\n end", "def get_rotation\n return @rotation\n end", "def current_player\n @players.each do |name, letter|\n if letter == whose_turn\n return name\n end\n end\n end", "def prev_char(options = {})\n ix = column - 1\n ix = skip_space(ix, :left) if options[:skip_space]\n char_at(ix) || ''\n end", "def current()\n @string[@index...(@index+1)]\n end", "def get_current_position\n [@current_X_pos, @current_Y_pos]\n end", "def pos\n @pos\n end", "def to_text(single_pos)\t\n\t\t\t\t\tcase single_pos\n\t\t\t\t\t\twhen 0\n\t \t\tsingle_pos =\"A\"\n\t \t\twhen 1\n\t \t\tsingle_pos =\"B\"\n\t \t\twhen 2\n\t \t\t\tsingle_pos =\"C\"\n\t \t\twhen 3\n\t \t\tsingle_pos =\"D\"\n\t \t\twhen 4\n\t \t\tsingle_pos =\"E\"\n\t \t\twhen 5\n\t \t\tsingle_pos =\"F\"\n\t \t\twhen 6\n\t \t\tsingle_pos =\"G\"\n\t \t\twhen 7\n\t \t\tsingle_pos =\"H\"\n\t \tend\n\t \t\t\treturn single_pos\n\tend", "def cur_angle\n MSPhysics::Newton::Hinge.get_cur_angle(@address)\n end", "def peekChar\r\n\t\tcheckLine\r\n\t\tcheckSpace\r\n\t\treturn @Line[0]\r\n\tend", "def find_position(pass) = pass.gsub(/./, {\n FRONT => 0,\n LEFT => 0,\n BACK => 1,\n RIGHT => 1\n}).to_i(2)", "def position_number_for_character(character_name)\n char = init.find_character_by_name(command.character_name)\n return nil if char.blank?\n return init.postion_number_for_character(char)\n end", "def chosen_ciphertext(cipher)\n letter = cipher.decrypt(@alphabet.at(0)[0])\n index = @alphabet.index(letter)\n index = mod(index * (-1), @alphabet.length)\n return index\n end", "def current_position\n return super if $game_system.battle_interpreter.running?\n return :bottom\n end", "def index_to_letter(index)\n ALPHA26[index]\n end", "def output_letter\r\n a = @deck.first\r\n a = 53 if a.instance_of? String\r\n output = @deck[a]\r\n if output.instance_of? String\r\n nil\r\n else\r\n output -= 26 if output > 26\r\n (output + 64).chr\r\n end\r\n end", "def get_new_position line, start_pos, keypad\n line.each_char.with_object(start_pos.dup) do |c, new_pos|\n new_pos[1] -= 1 if c == \"U\" && new_pos[1].positive? && !keypad[new_pos[1] - 1][new_pos[0]].nil?\n new_pos[1] += 1 if c == \"D\" && new_pos[1] < (keypad.length - 1) && !keypad[new_pos[1] + 1][new_pos[0]].nil?\n new_pos[0] -= 1 if c == \"L\" && new_pos[0].positive? && !keypad[new_pos[1]][new_pos[0] - 1].nil?\n new_pos[0] += 1 if c == \"R\" && new_pos[0] < (keypad.length - 1) && !keypad[new_pos[1]][new_pos[0] + 1].nil?\n end\n end", "def forward_position\n\t\tcase @orientations.key(@orientation.to_i)\n\t\twhen 'N'\n\t\t\treturn [@x.to_i, @y.to_i + 1]\n\t\twhen 'E'\n\t\t\treturn [@x.to_i + 1,@y.to_i]\n\t\twhen 'S'\n\t\t\treturn [@x.to_i,@y.to_i - 1]\n\t\twhen 'W'\n\t\t\treturn [@x.to_i - 1,@y.to_i]\n\t\telse\n\t\t\treturn 'There was a problem'\n\t\tend\n\tend", "def letter_index(letter)\n @places = []\n @split_word.each_with_index do |char, index|\n if char == letter\n @places << index\n end\n end\n end", "def current_line_pos\n pos - col\n end", "def index_to_letter(idx)\n letter = \"\"\n while true\n idx -= 1\n r = idx % 26\n idx /= 26\n letter = (r + 97).chr + letter\n break if idx <= 0\n end\n letter\n end", "def line_char_to_offset(text, line, character); end", "def find_rotation_point(words)\n\n first_word = words[0]\n\n floor_index = 0\n ceiling_index = words.length - 1\n\n while floor_index < ceiling_index\n\n # guess a point halfway between floor and ceiling\n guess_index = floor_index + ((ceiling_index - floor_index) / 2)\n puts \"guess_index #{guess_index}\"\n # if guess comes after first word or is the first word\n if words[guess_index] >= first_word\n # go right\n floor_index = guess_index\n puts \"floor_index #{floor_index}\"\n else\n # go left\n ceiling_index = guess_index\n puts \"ceiling_index #{ceiling_index}\"\n end\n\n # if floor and ceiling have converged\n if floor_index + 1 == ceiling_index\n\n # between floor and ceiling is where we flipped to the beginning\n # so ceiling is alphabetically first\n puts \"return #{ceiling_index}\"\n return ceiling_index\n\n end\n end\nend", "def az_index c\n c.upcase.ord - 'A'.ord\nend", "def letter_to_number(letter)\n letter.ord - 64\nend", "def get\n @source_index += 1\n\n # Maintain line count.\n prev_char = @source_text[@source_index - 1]\n if @source_index.positive? && prev_char == \"\\n\"\n @line_index += 1\n @col_index = -1\n end\n\n @col_index += 1\n char = if @source_index > @last_index\n # Read past the end of source text.\n END_MARK\n else\n @source_text[@source_index]\n end\n Character.new(char, @line_index, @col_index, @source_index, @source_text)\n end", "def bat\n return @character\n end", "def getCharByOffset(char, offset=0)\n # Chars could be in the upper alphabet, the lower alphabet, or neither.\n indexUpper = $ALPHABET.index(char)\n indexLower = $alphabet.index(char)\n if indexUpper\n i = calculateOffset(indexUpper, offset)\n char = $ALPHABET[i] # Get the char at that index\n elsif indexLower\n i = calculateOffset(indexLower, offset)\n char = $alphabet[i]\n end\n char\n end", "def letter_to_index(letter)\n alphabet_array.index(letter.upcase)\n end", "def current_pos\n\t\treturn arr = [pos_x, pos_y]\n\tend", "def column\n old_pos - start_of_current_line_pos\n end", "def column\n old_pos - start_of_current_line_pos\n end", "def advance \n \n @pos += 1\n if @pos > @text.length - 1\n @currentChar = nil\n else \n @currentChar = @text[@pos]\n end\n \n end", "def alphabet_position(text)\n text.downcase.chars.grep('a'..'z').map { |l| ('a'..'z').to_a.index(l) + 1 }.join(' ')\nend", "def cur_position\n MSPhysics::Newton::Corkscrew.get_cur_position(@address)\n end", "def last_cell_letter\n return unless @dimension\n\n @dimension.scan(/:([A-Z]+)/)&.first&.first || 'A'\n end", "def char\n self[@char]\n end", "def next_char\n @current_char_pos += 1\n @current_char = @string[@current_char_pos, 1]\n end", "def printAlphabeticalPositionUserFriendly()\n \n puts \"Given word is #{word}.\" +\n \"Total words from this combination of letters is \" +\n (getFactorial(@length)/@multiLetterDivisor).to_s + \".\"\n \n print \"The alphabetical position of #{word} is: \"\n \n puts @alphabeticalPosition\n end", "def locate(letter)\n key_loc = @key.index(letter)\n [key_loc/ 5, key_loc % 5]\n end", "def next_position\n (@position + face_vector).column(0).to_a\n end", "def to_position\n self\n end", "def chosen_plaintext(cipher)\n letter = cipher.encrypt(@alphabet.at(0)[0])\n return @alphabet.index(letter)\n end", "def position\n @position\n end", "def charChange(char)\n alpha = \"abcdefghijklmnopqrstuvwxyz\"\n charPosition = alpha.index(char)\n newChar = alpha[charPosition - 1]\n return newChar\nend" ]
[ "0.68672055", "0.6770376", "0.6634781", "0.6595292", "0.6595292", "0.6354422", "0.63511574", "0.63159454", "0.62628335", "0.62415946", "0.6236456", "0.61646485", "0.61506283", "0.6139785", "0.61211425", "0.60932535", "0.60834205", "0.60301054", "0.6013547", "0.60059726", "0.598701", "0.59704745", "0.596622", "0.5962003", "0.59604263", "0.5956645", "0.5937591", "0.59276664", "0.59260106", "0.59242386", "0.59193695", "0.5917079", "0.59168965", "0.5914969", "0.5899962", "0.5866717", "0.586241", "0.5854524", "0.5854524", "0.58544505", "0.585015", "0.5841178", "0.58316785", "0.58189076", "0.5796291", "0.5784992", "0.57727635", "0.57685584", "0.57585293", "0.5757909", "0.57514614", "0.5720116", "0.5711163", "0.5711163", "0.5707495", "0.57036513", "0.5694381", "0.56906974", "0.5689126", "0.5683178", "0.56822765", "0.5674201", "0.5674064", "0.56740505", "0.5669901", "0.5665378", "0.5658802", "0.5653881", "0.5651809", "0.56512153", "0.56292504", "0.5614153", "0.5609092", "0.55944884", "0.55854505", "0.5581976", "0.55708414", "0.5563629", "0.55603623", "0.5556135", "0.5553196", "0.5551151", "0.55477583", "0.55394286", "0.5538768", "0.5537822", "0.5537822", "0.553508", "0.55285627", "0.5524898", "0.5516894", "0.55142987", "0.55132395", "0.5506779", "0.55022705", "0.5483803", "0.5475898", "0.54727864", "0.54691607", "0.54649913" ]
0.78007245
0
GET /customer_users GET /customer_users.json
def index @customer_users = CustomerUser.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @customers = @user.customers.all\n render json: @customers\n end", "def index\n @user = current_user\n @customers = @user.customers\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @customers }\n end\n end", "def customer_list\n perform_get_request('/customer/list')\n end", "def list_users_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CustomerApi.list_users ...'\n end\n # unbox the parameters from the hash\n customer_id = opts[:'customer_id']\n # verify the required parameter 'customer_id' is set\n if @api_client.config.client_side_validation && customer_id.nil?\n fail ArgumentError, \"Missing the required parameter 'customer_id' when calling CustomerApi.list_users\"\n end\n # resource path\n local_var_path = '/customer/{customer_id}/users'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s))\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\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'Array<SchemasUserResponse>'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['token']\n\n new_options = opts.merge(\n :operation => :\"CustomerApi.list_users\",\n :header_params => 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(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CustomerApi#list_users\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @users = User.fetch_all_customers\n end", "def index\n if current_user.role == 'customer_admin'\n render json: current_user.customer and return\n else\n authorize! :read_all, Customer\n customers = Customer.order('name asc')\n render json: customers and return\n end\n end", "def users\n get('get_users')\n end", "def users(params = {})\n make_get_request('/account/users', params)\n end", "def users(args = {})\n get(\"/users.json\",args)\n end", "def customers\n ShopifyAPI::Customer.all\n end", "def GetUsers params = {}\n\n params = params.merge(path: 'users.json')\n APICall(params)\n\n end", "def show\n @users = User.all\n json_response(@users)\n end", "def list_users\n self.class.get('/users')\n end", "def get_shopify_user(customer_id, email)\n conn = shopify_connection()\n\n response = conn.get do |req|\n req.url \"/admin/customers/#{customer_id}.json\"\n end\n customer = JSON.parse(response.body)['customer']\n customer_match = customer.nil? ? false : customer['email'] == email\n { 'customer' => customer, 'match' => customer_match }\nend", "def get_shopify_user(customer_id, email)\n conn = shopify_connection()\n\n response = conn.get do |req|\n req.url \"/admin/customers/#{customer_id}.json\"\n end\n customer = JSON.parse(response.body)['customer']\n customer_match = customer.nil? ? false : customer['email'] == email\n { 'customer' => customer, 'match' => customer_match }\nend", "def list_users_for_all_tenants(args = {}) \n get(\"/users.json/global\", args)\nend", "def list_users_for_all_tenants(args = {}) \n get(\"/users.json/global\", args)\nend", "def get_customer_profile\n authenticate_request!\n json_response(current_customer)\n end", "def index\n \tcustomers = Customer.all\n \trender json: customers\n \tend", "def index\n #byebug\n #CHECK AUTHORIZATION HERE NOT JUST JUST AUTHENTICATION\n \n render json: {farmers: Farmer.all, customers: CustomerUser.all} #User.all #CustomerUser.all #{users: User.all, customers: Customer_User.all}\n end", "def customer(options = nil)\n request = Request.new(@client)\n path = \"/authorization-requests/\" + CGI.escape(@id) + \"/customers\"\n data = {\n\n }\n\n response = Response.new(request.get(path, data, options))\n return_values = Array.new\n \n body = response.body\n body = body[\"customer\"]\n customer = Customer(self._client)\n return_values.push(customer.fill_with_data(body))\n\n \n return_values[0]\n end", "def index\n @customers = Customer.where(:company_id => current_user.company.id).paginate(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @customers }\n end\n end", "def index\n @customers = Customer.where(user_id: current_user.id)\n end", "def get_customers\n return ShopifyAPI::Customer.all\n end", "def users(params = {})\n params.merge!(key: 'users')\n objects_from_response(Code42::User, :get, 'user', params)\n end", "def get_users(request); end", "def index\n\t\t# specifying json format in the URl\n\t uri = \"#{API_BASE_URL}/users.json\"\n\t # It will create new rest-client resource so that we can call different methods of it\n\t rest_resource = RestClient::Resource.new(uri, USERNAME, PASSWORD)\n\n\t # this next line will give you back all the details in json format, \n\t #but it will be wrapped as a string, so we will parse it in the next step.\n\t users = rest_resource.get \n\n\t # we will convert the return data into an array of hash. see json data parsing here\n\t @users = JSON.parse(users, :symbolize_names => true)\n\tend", "def index\n users = User.all\n\n render json: users, each_serializer: Api::V1::UsersSerializer\n end", "def customer(customer_id)\n client.get \"customers/#{inst_id}/#{customer_id}\"\n end", "def list\r\n users = User.all\r\n render json: users\r\n end", "def customers(options = {})\n perform_get_with_object('/customers', options, Epages::CustomersResponse)\n end", "def index\n users = User.all\n json_response(users)\n end", "def index\n @customers = User.where(:authority => 'customer')\n end", "def show\n begin\n user = User.find(params[:user_id])\n render json: { users: user }, status: :ok\n rescue => e\n render json: { errors: e.message}, status: 404\n end\n end", "def index\n @myusers = Myuser.all\n\n render json: @myusers\n end", "def index\n @users = User.order_by(last_name: :desc)\n if @users\n render json: Oj.dump(json_for(@users, include: ['phones', 'cards'], meta: meta), mode: :compat)\n else\n return head :unauthorized\n end\n end", "def customer(customer_id)\n perform_get_request(\"/customer/#{customer_id}\")\n end", "def query_users(options={}) path = \"/api/v2/users\"\n get(path, options, AvaTax::VERSION) end", "def list\n @customers = Customer.all\n\n respond_to do |format|\n format.html { render action: \"index\" }\n format.json { render json: @customers }\n end\n end", "def index\n @customers = Customer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @customers }\n end\n end", "def index\n @users = User.all\n\n render json: @users\n end", "def index\n users = User.all\n render json: { users: users }, status: :ok\n end", "def index\n #@users = User.all\n @users = User.where(tenant_id: current_tenant.id)\n render json: {\n message: 'Your All Users',\n user: @users\n }\n end", "def index\n @users = User.all\n render json: @users\n end", "def index\n @users = User.all\n render json: @users\n end", "def index\n @users = User.all\n render json: @users\n end", "def index\n @users = User.all\n render json: @users\n end", "def index\n @users = User.all\n render json: @users\n end", "def index\n @users = User.all\n render json: @users\n end", "def index\n @users = User.all\n render json: @users\n end", "def index\n @users = User.all\n render json: @users\n end", "def index\n @users = User.all\n render json: @users\n end", "def index\n @users = User.all\n render json: @users\n end", "def index\n @users = User.all\n\n render json: @users\n end", "def index\n @users = User.all\n\n render json: @users\n end", "def index\n @users = User.all\n\n render json: @users\n end", "def index\n @users = User.all\n\n render json: @users\n end", "def index\n @users = User.all\n\n render json: @users\n end", "def index\n @users = User.all\n\n render json: @users\n end", "def index\r\n users = User.all\r\n render json: users\r\n end", "def index\n if !session[:user_id]\n redirect_to customer_path(session[:customer_id]) , notice: 'Access Denied'\n return\n else\n @customers = Customer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @customers }\n end\n end\n end", "def show\n @users = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @users }\n end\n end", "def index\n users = User.all\n render json: users\n end", "def index\n users = User.all\n render json: users\n end", "def index\n users = User.all\n render json: users\n end", "def index\n users = User.all\n render json: users\n end", "def account_user_with_http_info(customeruuid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CustomersApi.account_user ...'\n end\n # verify the required parameter 'customeruuid' is set\n if @api_client.config.client_side_validation && customeruuid.nil?\n fail ArgumentError, \"Missing the required parameter 'customeruuid' when calling CustomersApi.account_user\"\n end\n # resource path\n local_var_path = '/1.0.0/account/{customeruuid}/user'.sub('{' + 'customeruuid' + '}', customeruuid.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oAuth2']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<User>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CustomersApi#account_user\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n users = User.all \n render json: users \n end", "def index\n users = User.all\n render json: users \n end", "def get_customer(id)\n get(\"customers/#{id}\")\n end", "def get_customer(id)\n get(\"customers/#{id}\")\n end", "def index\n\n users = User.all \n render json: users\n\n end", "def index\n user= User.all\n render json: {users:user}\n end", "def index\n \n respond_to do |format|\n \n format.json {\n render json: CustomerDatatable.new(view_context, @current_account.id)\n }\n format.html {\n @users = @current_account.users.with_role(:customers)\n .where{(first_name =~ \"%#{params[:sSearch]}%\") | (last_name =~ \"%#{params[:sSearch]}%\") | (email =~ \"%#{params[:sSearch]}%\") }\n .page(params[:page])\n .per(10)\n }\n end\n \n end", "def index\n @users = @users.order('created_at DESC').page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @users, :except => [:perishable_token, :persistence_token, :email, :single_access_token, :last_login_ip, :current_login_ip, :crypted_password, :password_salt] }\n end\n end", "def index\n @users = User.all\n render json: @users, status: :ok\n end", "def index\n @users = User.all\n render json: @users, status: :ok\n end", "def index\n json_response(User.all) \n end", "def index\n if params[:single]\n\t url = \"#{API_BASE_URL}/users/#{params[:id]}.json\"\n\t response = RestClient.get(url)\n\t @user = JSON.parse(response.body)\n\telse\n\t url = \"#{API_BASE_URL}/users.json\"\t \n response = RestClient.get(url)\n @users = JSON.parse(response.body)\t\t \n\tend\n end", "def users\n\t\trespond_with User.all\n\tend", "def index\n @clients = current_user.clients\n render json: @clients\n end", "def index\n @users = User.not_deleted.where(:client_id => nil).order(:role_id, :name).page(params[:page]).per(15)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end", "def list\n render json: User.all\n end", "def index\n render ActiveModelSerializers::SerializableResource.new(@users,\n each_serializer: UserSerializer\n ).to_json, status: 200\n end", "def index\n @users = User.users_only.active # only active users\n @users = @users.search( params[:q] ) unless params[:q].blank? # search for term\n @users = @users.page( params[:page] ).per( params[:per_page] ) # paginate\n\n render json: UsersListSerializer.new(@users), status: :ok\n end", "def show\n @user = User.find(params[:id])\n render json: {\n username: @user.username,\n first_name: @user.first_name,\n last_name: @user.last_name,\n email: @user.email,\n phone_number: @user.phone_number,\n contacts: @user.contacts\n }, status: :ok\n end", "def get_users\r\n # Prepare query url.\r\n _path_url = '/users'\r\n _query_builder = Configuration.get_base_uri\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body)\r\n decoded.map { |element| User.from_hash(element) }\r\n end", "def index\n \n @users = User.page(params[:page]).per_page(14)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n \n end", "def index\n @users = User.all \n render json: @users, status: :ok \n end", "def list_users\n http_get(:uri=>\"/users\", :fields=>x_cookie)\n end", "def all_users()\n @endpoint = \"/users.json?limit=100\"\n setup_get\n res = @http.request(@req)\n return JSON.load(res.body)[\"users\"].sort_by { |user| user[\"lastname\"] }\n end", "def index\n @users = User.all\n render json: {\n messages: \"Request Successfull!\",\n is_success: true,\n data: { users: @users }\n }\n end", "def get_users(filter: {}, includes: nil, limit: nil, sort: nil)\n params = users_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)\n users_request_client.get(\"users\", params)\n end", "def index\n r = @api.get_users\n response = JSON.parse(r.body)\n if r.code == 200\n @users = response\n else\n redirect_to login_sign_in_admin_path, alert: response['message']\n end\n end", "def index \n #Show all users \n @users = User.all\n render json: @users.as_json(only: [:id, :first_name, :last_name, :email, :business_name, :business_verticals, :business_neighborhood, :created_at, :sign_in_count, :current_sign_in_at, :last_sign_in_at])\n end", "def index\n @service_users = ServiceUser.all\n render json: @service_users\n end", "def users(params = {})\n response = get('users/lookup.json', params)\n response.map {|user| Croudia::Object::User.new(user) }\n end", "def users\n puts \"SEARCH USERS\"\n @users = User.search(params[:q])\n puts \"SEARCH USERS COUNT:#{@users.count}\"\n render :json => @users.as_json(:current_user => current_user)\n end", "def customers\n @customers ||= new_resource(self, :customer, :customers)\n end", "def index\n\t\t@users = User.all\n\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json { render json: @users.map(&:as_json) }\n\t\tend\n\tend" ]
[ "0.7715447", "0.76284164", "0.7294764", "0.72746605", "0.7166863", "0.7097876", "0.706521", "0.7025746", "0.6991902", "0.6927888", "0.6877634", "0.6840204", "0.68299955", "0.6819776", "0.6819776", "0.67977816", "0.67977816", "0.6795483", "0.6790534", "0.67780924", "0.67735255", "0.6768281", "0.67661136", "0.6719244", "0.67042446", "0.6702292", "0.6693111", "0.66618276", "0.66543055", "0.6643312", "0.6631541", "0.66212815", "0.66193885", "0.6612774", "0.66120154", "0.6602234", "0.66015524", "0.65944403", "0.65606326", "0.65606177", "0.6546175", "0.654329", "0.6541115", "0.6535182", "0.6535182", "0.6535182", "0.6535182", "0.6535182", "0.6535182", "0.6535182", "0.6535182", "0.6535182", "0.6535182", "0.6530851", "0.6530851", "0.6530851", "0.6530851", "0.6530851", "0.6530851", "0.6523667", "0.6518981", "0.6518874", "0.651474", "0.651474", "0.651474", "0.651474", "0.64989144", "0.64959294", "0.6493687", "0.6466953", "0.6466953", "0.6456851", "0.6440747", "0.6436908", "0.6431073", "0.6427255", "0.6425663", "0.6424148", "0.641534", "0.6407998", "0.6405597", "0.63819754", "0.6381145", "0.63797694", "0.63782305", "0.63746566", "0.63692325", "0.63682467", "0.63678044", "0.6367091", "0.63465965", "0.6345338", "0.6344306", "0.63438463", "0.63422394", "0.6337381", "0.6334417", "0.6327198", "0.63257825", "0.63231874" ]
0.71540993
5