repo stringlengths 5 58 | path stringlengths 9 168 | func_name stringlengths 9 130 | original_string stringlengths 66 10.5k | language stringclasses 1
value | code stringlengths 66 10.5k | code_tokens list | docstring stringlengths 8 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 94 266 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
Azure/azure-sdk-for-ruby | management/azure_mgmt_sql/lib/2017-10-01-preview/generated/azure_mgmt_sql/managed_instance_keys.rb | Azure::SQL::Mgmt::V2017_10_01_preview.ManagedInstanceKeys.begin_delete_with_http_info | def begin_delete_with_http_info(resource_group_name, managed_instance_name, key_name, custom_headers:nil)
begin_delete_async(resource_group_name, managed_instance_name, key_name, custom_headers:custom_headers).value!
end | ruby | def begin_delete_with_http_info(resource_group_name, managed_instance_name, key_name, custom_headers:nil)
begin_delete_async(resource_group_name, managed_instance_name, key_name, custom_headers:custom_headers).value!
end | [
"def",
"begin_delete_with_http_info",
"(",
"resource_group_name",
",",
"managed_instance_name",
",",
"key_name",
",",
"custom_headers",
":",
"nil",
")",
"begin_delete_async",
"(",
"resource_group_name",
",",
"managed_instance_name",
",",
"key_name",
",",
"custom_headers",
... | Deletes the managed instance key with the given name.
@param resource_group_name [String] The name of the resource group that
contains the resource. You can obtain this value from the Azure Resource
Manager API or the portal.
@param managed_instance_name [String] The name of the managed instance.
@param key_name ... | [
"Deletes",
"the",
"managed",
"instance",
"key",
"with",
"the",
"given",
"name",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2017-10-01-preview/generated/azure_mgmt_sql/managed_instance_keys.rb#L493-L495 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_monitor/lib/2018-06-01-preview/generated/azure_mgmt_monitor/guest_diagnostics_settings.rb | Azure::Monitor::Mgmt::V2018_06_01_preview.GuestDiagnosticsSettings.update_with_http_info | def update_with_http_info(resource_group_name, diagnostic_settings_name, parameters, custom_headers:nil)
update_async(resource_group_name, diagnostic_settings_name, parameters, custom_headers:custom_headers).value!
end | ruby | def update_with_http_info(resource_group_name, diagnostic_settings_name, parameters, custom_headers:nil)
update_async(resource_group_name, diagnostic_settings_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"update_with_http_info",
"(",
"resource_group_name",
",",
"diagnostic_settings_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"update_async",
"(",
"resource_group_name",
",",
"diagnostic_settings_name",
",",
"parameters",
",",
"custom_headers",
"... | Updates guest diagnostics settings.
@param resource_group_name [String] The name of the resource group.
@param diagnostic_settings_name [String] The name of the diagnostic setting.
@param parameters [GuestDiagnosticSettingsPatchResource] The configuration to
patch.
@param custom_headers [Hash{String => String}] A... | [
"Updates",
"guest",
"diagnostics",
"settings",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_monitor/lib/2018-06-01-preview/generated/azure_mgmt_monitor/guest_diagnostics_settings.rb#L261-L263 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_monitor/lib/2018-06-01-preview/generated/azure_mgmt_monitor/guest_diagnostics_settings.rb | Azure::Monitor::Mgmt::V2018_06_01_preview.GuestDiagnosticsSettings.delete | def delete(resource_group_name, diagnostic_settings_name, custom_headers:nil)
response = delete_async(resource_group_name, diagnostic_settings_name, custom_headers:custom_headers).value!
nil
end | ruby | def delete(resource_group_name, diagnostic_settings_name, custom_headers:nil)
response = delete_async(resource_group_name, diagnostic_settings_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"delete",
"(",
"resource_group_name",
",",
"diagnostic_settings_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_async",
"(",
"resource_group_name",
",",
"diagnostic_settings_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value... | Delete guest diagnostics settings.
@param resource_group_name [String] The name of the resource group.
@param diagnostic_settings_name [String] The name of the diagnostic setting.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Delete",
"guest",
"diagnostics",
"settings",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_monitor/lib/2018-06-01-preview/generated/azure_mgmt_monitor/guest_diagnostics_settings.rb#L357-L360 | train |
Azure/azure-sdk-for-ruby | runtime/ms_rest/lib/ms_rest/http_operation_error.rb | MsRest.HttpOperationError.to_json | def to_json(*a)
res_dict = response ? { body: response.body, headers: response.headers, status: response.status } : nil
{message: @msg, request: request, response: res_dict}.to_json(*a)
end | ruby | def to_json(*a)
res_dict = response ? { body: response.body, headers: response.headers, status: response.status } : nil
{message: @msg, request: request, response: res_dict}.to_json(*a)
end | [
"def",
"to_json",
"(",
"*",
"a",
")",
"res_dict",
"=",
"response",
"?",
"{",
"body",
":",
"response",
".",
"body",
",",
"headers",
":",
"response",
".",
"headers",
",",
"status",
":",
"response",
".",
"status",
"}",
":",
"nil",
"{",
"message",
":",
... | Creates and initialize new instance of the HttpOperationException class.
@param [Hash] the HTTP request data (uri, body, headers).
@param [Faraday::Response] the HTTP response object.
@param [String] body the HTTP response body.
@param [String] error message. | [
"Creates",
"and",
"initialize",
"new",
"instance",
"of",
"the",
"HttpOperationException",
"class",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/runtime/ms_rest/lib/ms_rest/http_operation_error.rb#L58-L61 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_mixedreality/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/mixed_reality_client.rb | Azure::MixedReality::Mgmt::V2019_02_28_preview.MixedRealityClient.check_name_availability_local | def check_name_availability_local(location, check_name_availability, custom_headers:nil)
response = check_name_availability_local_async(location, check_name_availability, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def check_name_availability_local(location, check_name_availability, custom_headers:nil)
response = check_name_availability_local_async(location, check_name_availability, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"check_name_availability_local",
"(",
"location",
",",
"check_name_availability",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"check_name_availability_local_async",
"(",
"location",
",",
"check_name_availability",
",",
"custom_headers",
":custom_headers",
... | Check Name Availability for global uniqueness
@param location [String] The location in which uniqueness will be verified.
@param check_name_availability [CheckNameAvailabilityRequest] Check Name
Availability Request.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the... | [
"Check",
"Name",
"Availability",
"for",
"global",
"uniqueness"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_mixedreality/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/mixed_reality_client.rb#L135-L138 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_sql/lib/2017-10-01-preview/generated/azure_mgmt_sql/recoverable_managed_databases.rb | Azure::SQL::Mgmt::V2017_10_01_preview.RecoverableManagedDatabases.get_with_http_info | def get_with_http_info(resource_group_name, managed_instance_name, recoverable_database_name, custom_headers:nil)
get_async(resource_group_name, managed_instance_name, recoverable_database_name, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_group_name, managed_instance_name, recoverable_database_name, custom_headers:nil)
get_async(resource_group_name, managed_instance_name, recoverable_database_name, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_group_name",
",",
"managed_instance_name",
",",
"recoverable_database_name",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_group_name",
",",
"managed_instance_name",
",",
"recoverable_database_name",
",",
"cu... | Gets a recoverable managed database.
@param resource_group_name [String] The name of the resource group that
contains the resource. You can obtain this value from the Azure Resource
Manager API or the portal.
@param managed_instance_name [String] The name of the managed instance.
@param recoverable_database_name ... | [
"Gets",
"a",
"recoverable",
"managed",
"database",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2017-10-01-preview/generated/azure_mgmt_sql/recoverable_managed_databases.rb#L156-L158 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_kusto/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/clusters.rb | Azure::Kusto::Mgmt::V2018_09_07_privatepreview.Clusters.list_skus_by_resource | def list_skus_by_resource(resource_group_name, cluster_name, custom_headers:nil)
response = list_skus_by_resource_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_skus_by_resource(resource_group_name, cluster_name, custom_headers:nil)
response = list_skus_by_resource_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_skus_by_resource",
"(",
"resource_group_name",
",",
"cluster_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_skus_by_resource_async",
"(",
"resource_group_name",
",",
"cluster_name",
",",
"custom_headers",
":custom_headers",
")",
".",
... | Returns the SKUs available for the provided resource.
@param resource_group_name [String] The name of the resource group containing
the Kusto cluster.
@param cluster_name [String] The name of the Kusto cluster.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP ... | [
"Returns",
"the",
"SKUs",
"available",
"for",
"the",
"provided",
"resource",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_kusto/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/clusters.rb#L706-L709 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_kusto/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/clusters.rb | Azure::Kusto::Mgmt::V2018_09_07_privatepreview.Clusters.begin_create_or_update_with_http_info | def begin_create_or_update_with_http_info(resource_group_name, cluster_name, parameters, custom_headers:nil)
begin_create_or_update_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_create_or_update_with_http_info(resource_group_name, cluster_name, parameters, custom_headers:nil)
begin_create_or_update_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_create_or_update_with_http_info",
"(",
"resource_group_name",
",",
"cluster_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_create_or_update_async",
"(",
"resource_group_name",
",",
"cluster_name",
",",
"parameters",
",",
"custom_heade... | Create or update a Kusto cluster.
@param resource_group_name [String] The name of the resource group containing
the Kusto cluster.
@param cluster_name [String] The name of the Kusto cluster.
@param parameters [Cluster] The Kusto cluster parameters supplied to the
CreateOrUpdate operation.
@param custom_headers [... | [
"Create",
"or",
"update",
"a",
"Kusto",
"cluster",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_kusto/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/clusters.rb#L821-L823 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_sql/lib/2015-05-01-preview/generated/azure_mgmt_sql/virtual_clusters.rb | Azure::SQL::Mgmt::V2015_05_01_preview.VirtualClusters.begin_update_with_http_info | def begin_update_with_http_info(resource_group_name, virtual_cluster_name, parameters, custom_headers:nil)
begin_update_async(resource_group_name, virtual_cluster_name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_update_with_http_info(resource_group_name, virtual_cluster_name, parameters, custom_headers:nil)
begin_update_async(resource_group_name, virtual_cluster_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_update_with_http_info",
"(",
"resource_group_name",
",",
"virtual_cluster_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_update_async",
"(",
"resource_group_name",
",",
"virtual_cluster_name",
",",
"parameters",
",",
"custom_headers",... | Updates a virtual cluster.
@param resource_group_name [String] The name of the resource group that
contains the resource. You can obtain this value from the Azure Resource
Manager API or the portal.
@param virtual_cluster_name [String] The name of the virtual cluster.
@param parameters [VirtualClusterUpdate] The ... | [
"Updates",
"a",
"virtual",
"cluster",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2015-05-01-preview/generated/azure_mgmt_sql/virtual_clusters.rb#L515-L517 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_sql/lib/2017-03-01-preview/generated/azure_mgmt_sql/server_dns_aliases.rb | Azure::SQL::Mgmt::V2017_03_01_preview.ServerDnsAliases.get_with_http_info | def get_with_http_info(resource_group_name, server_name, dns_alias_name, custom_headers:nil)
get_async(resource_group_name, server_name, dns_alias_name, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_group_name, server_name, dns_alias_name, custom_headers:nil)
get_async(resource_group_name, server_name, dns_alias_name, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_group_name",
",",
"server_name",
",",
"dns_alias_name",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_group_name",
",",
"server_name",
",",
"dns_alias_name",
",",
"custom_headers",
":custom_headers",
")",... | Gets a server DNS alias.
@param resource_group_name [String] The name of the resource group that
contains the resource. You can obtain this value from the Azure Resource
Manager API or the portal.
@param server_name [String] The name of the server that the alias is pointing
to.
@param dns_alias_name [String] The... | [
"Gets",
"a",
"server",
"DNS",
"alias",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2017-03-01-preview/generated/azure_mgmt_sql/server_dns_aliases.rb#L60-L62 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_sql/lib/2017-03-01-preview/generated/azure_mgmt_sql/server_dns_aliases.rb | Azure::SQL::Mgmt::V2017_03_01_preview.ServerDnsAliases.begin_create_or_update_with_http_info | def begin_create_or_update_with_http_info(resource_group_name, server_name, dns_alias_name, custom_headers:nil)
begin_create_or_update_async(resource_group_name, server_name, dns_alias_name, custom_headers:custom_headers).value!
end | ruby | def begin_create_or_update_with_http_info(resource_group_name, server_name, dns_alias_name, custom_headers:nil)
begin_create_or_update_async(resource_group_name, server_name, dns_alias_name, custom_headers:custom_headers).value!
end | [
"def",
"begin_create_or_update_with_http_info",
"(",
"resource_group_name",
",",
"server_name",
",",
"dns_alias_name",
",",
"custom_headers",
":",
"nil",
")",
"begin_create_or_update_async",
"(",
"resource_group_name",
",",
"server_name",
",",
"dns_alias_name",
",",
"custom... | Creates a server dns alias.
@param resource_group_name [String] The name of the resource group that
contains the resource. You can obtain this value from the Azure Resource
Manager API or the portal.
@param server_name [String] The name of the server that the alias is pointing
to.
@param dns_alias_name [String] ... | [
"Creates",
"a",
"server",
"dns",
"alias",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2017-03-01-preview/generated/azure_mgmt_sql/server_dns_aliases.rb#L410-L412 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_sql/lib/2017-03-01-preview/generated/azure_mgmt_sql/server_dns_aliases.rb | Azure::SQL::Mgmt::V2017_03_01_preview.ServerDnsAliases.begin_delete_with_http_info | def begin_delete_with_http_info(resource_group_name, server_name, dns_alias_name, custom_headers:nil)
begin_delete_async(resource_group_name, server_name, dns_alias_name, custom_headers:custom_headers).value!
end | ruby | def begin_delete_with_http_info(resource_group_name, server_name, dns_alias_name, custom_headers:nil)
begin_delete_async(resource_group_name, server_name, dns_alias_name, custom_headers:custom_headers).value!
end | [
"def",
"begin_delete_with_http_info",
"(",
"resource_group_name",
",",
"server_name",
",",
"dns_alias_name",
",",
"custom_headers",
":",
"nil",
")",
"begin_delete_async",
"(",
"resource_group_name",
",",
"server_name",
",",
"dns_alias_name",
",",
"custom_headers",
":custo... | Deletes the server DNS alias with the given name.
@param resource_group_name [String] The name of the resource group that
contains the resource. You can obtain this value from the Azure Resource
Manager API or the portal.
@param server_name [String] The name of the server that the alias is pointing
to.
@param dn... | [
"Deletes",
"the",
"server",
"DNS",
"alias",
"with",
"the",
"given",
"name",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2017-03-01-preview/generated/azure_mgmt_sql/server_dns_aliases.rb#L524-L526 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_managed_applications/lib/2016-09-01-preview/generated/azure_mgmt_managed_applications/appliance_definitions.rb | Azure::ManagedApplications::Mgmt::V2016_09_01_preview.ApplianceDefinitions.get_by_id | def get_by_id(appliance_definition_id, custom_headers:nil)
response = get_by_id_async(appliance_definition_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_by_id(appliance_definition_id, custom_headers:nil)
response = get_by_id_async(appliance_definition_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_by_id",
"(",
"appliance_definition_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_by_id_async",
"(",
"appliance_definition_id",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"response",... | Gets the appliance definition.
@param appliance_definition_id [String] The fully qualified ID of the
appliance definition, including the appliance name and the appliance
definition resource type. Use the format,
/subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{ap... | [
"Gets",
"the",
"appliance",
"definition",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_managed_applications/lib/2016-09-01-preview/generated/azure_mgmt_managed_applications/appliance_definitions.rb#L325-L328 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_managed_applications/lib/2016-09-01-preview/generated/azure_mgmt_managed_applications/appliance_definitions.rb | Azure::ManagedApplications::Mgmt::V2016_09_01_preview.ApplianceDefinitions.begin_create_or_update_with_http_info | def begin_create_or_update_with_http_info(resource_group_name, appliance_definition_name, parameters, custom_headers:nil)
begin_create_or_update_async(resource_group_name, appliance_definition_name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_create_or_update_with_http_info(resource_group_name, appliance_definition_name, parameters, custom_headers:nil)
begin_create_or_update_async(resource_group_name, appliance_definition_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_create_or_update_with_http_info",
"(",
"resource_group_name",
",",
"appliance_definition_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_create_or_update_async",
"(",
"resource_group_name",
",",
"appliance_definition_name",
",",
"parameter... | Creates a new appliance definition.
@param resource_group_name [String] The name of the resource group. The name
is case insensitive.
@param appliance_definition_name [String] The name of the appliance
definition.
@param parameters [ApplianceDefinition] Parameters supplied to the create or
update an appliance de... | [
"Creates",
"a",
"new",
"appliance",
"definition",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_managed_applications/lib/2016-09-01-preview/generated/azure_mgmt_managed_applications/appliance_definitions.rb#L626-L628 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_kusto/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/event_hub_connections.rb | Azure::Kusto::Mgmt::V2018_09_07_privatepreview.EventHubConnections.get_with_http_info | def get_with_http_info(resource_group_name, cluster_name, database_name, event_hub_connection_name, custom_headers:nil)
get_async(resource_group_name, cluster_name, database_name, event_hub_connection_name, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_group_name, cluster_name, database_name, event_hub_connection_name, custom_headers:nil)
get_async(resource_group_name, cluster_name, database_name, event_hub_connection_name, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_group_name",
",",
"cluster_name",
",",
"database_name",
",",
"event_hub_connection_name",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_group_name",
",",
"cluster_name",
",",
"database_name",
",",
"event_... | Returns an Event Hub connection.
@param resource_group_name [String] The name of the resource group containing
the Kusto cluster.
@param cluster_name [String] The name of the Kusto cluster.
@param database_name [String] The name of the database in the Kusto cluster.
@param event_hub_connection_name [String] The n... | [
"Returns",
"an",
"Event",
"Hub",
"connection",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_kusto/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/event_hub_connections.rb#L271-L273 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_kusto/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/event_hub_connections.rb | Azure::Kusto::Mgmt::V2018_09_07_privatepreview.EventHubConnections.begin_delete_with_http_info | def begin_delete_with_http_info(resource_group_name, cluster_name, database_name, event_hub_connection_name, custom_headers:nil)
begin_delete_async(resource_group_name, cluster_name, database_name, event_hub_connection_name, custom_headers:custom_headers).value!
end | ruby | def begin_delete_with_http_info(resource_group_name, cluster_name, database_name, event_hub_connection_name, custom_headers:nil)
begin_delete_async(resource_group_name, cluster_name, database_name, event_hub_connection_name, custom_headers:custom_headers).value!
end | [
"def",
"begin_delete_with_http_info",
"(",
"resource_group_name",
",",
"cluster_name",
",",
"database_name",
",",
"event_hub_connection_name",
",",
"custom_headers",
":",
"nil",
")",
"begin_delete_async",
"(",
"resource_group_name",
",",
"cluster_name",
",",
"database_name"... | Deletes the Event Hub connection with the given name.
@param resource_group_name [String] The name of the resource group containing
the Kusto cluster.
@param cluster_name [String] The name of the Kusto cluster.
@param database_name [String] The name of the database in the Kusto cluster.
@param event_hub_connectio... | [
"Deletes",
"the",
"Event",
"Hub",
"connection",
"with",
"the",
"given",
"name",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_kusto/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/event_hub_connections.rb#L790-L792 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_service_fabric/lib/2016-09-01/generated/azure_mgmt_service_fabric/cluster_versions.rb | Azure::ServiceFabric::Mgmt::V2016_09_01.ClusterVersions.get_with_http_info | def get_with_http_info(location, environment, cluster_version, custom_headers:nil)
get_async(location, environment, cluster_version, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(location, environment, cluster_version, custom_headers:nil)
get_async(location, environment, cluster_version, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"location",
",",
"environment",
",",
"cluster_version",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"location",
",",
"environment",
",",
"cluster_version",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
... | Get cluster code versions by environment and version
@param location [String] The location for the cluster code versions, this is
different from cluster location
@param environment [Enum] Cluster operating system, the default means all.
Possible values include: 'Windows', 'Linux'
@param cluster_version [String] T... | [
"Get",
"cluster",
"code",
"versions",
"by",
"environment",
"and",
"version"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_service_fabric/lib/2016-09-01/generated/azure_mgmt_service_fabric/cluster_versions.rb#L244-L246 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_policy.rb | Azure::ApiManagement::Mgmt::V2018_01_01.ApiPolicy.list_by_api | def list_by_api(resource_group_name, service_name, api_id, custom_headers:nil)
response = list_by_api_async(resource_group_name, service_name, api_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_by_api(resource_group_name, service_name, api_id, custom_headers:nil)
response = list_by_api_async(resource_group_name, service_name, api_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_by_api",
"(",
"resource_group_name",
",",
"service_name",
",",
"api_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_api_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"api_id",
",",
"custom_headers",
":custom_headers"... | Get the policy configuration at the API level.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param api_id [String] API revision identifier. Must be unique in the current
API Management service instance. Non-current revision... | [
"Get",
"the",
"policy",
"configuration",
"at",
"the",
"API",
"level",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api_policy.rb#L37-L40 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_recovery_services/lib/2016-06-01/generated/azure_mgmt_recovery_services/usages.rb | Azure::RecoveryServices::Mgmt::V2016_06_01.Usages.list_by_vaults | def list_by_vaults(resource_group_name, vault_name, custom_headers:nil)
response = list_by_vaults_async(resource_group_name, vault_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_by_vaults(resource_group_name, vault_name, custom_headers:nil)
response = list_by_vaults_async(resource_group_name, vault_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_by_vaults",
"(",
"resource_group_name",
",",
"vault_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_vaults_async",
"(",
"resource_group_name",
",",
"vault_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"respo... | Fetches the usages of the vault.
@param resource_group_name [String] The name of the resource group where the
recovery services vault is present.
@param vault_name [String] The name of the recovery services vault.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HT... | [
"Fetches",
"the",
"usages",
"of",
"the",
"vault",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_recovery_services/lib/2016-06-01/generated/azure_mgmt_recovery_services/usages.rb#L35-L38 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_policy_insights/lib/2018-04-04/generated/azure_mgmt_policy_insights/policy_events.rb | Azure::PolicyInsights::Mgmt::V2018_04_04.PolicyEvents.list_query_results_for_policy_set_definition_with_http_info | def list_query_results_for_policy_set_definition_with_http_info(subscription_id, policy_set_definition_name, query_options:nil, custom_headers:nil)
list_query_results_for_policy_set_definition_async(subscription_id, policy_set_definition_name, query_options:query_options, custom_headers:custom_headers).value!
... | ruby | def list_query_results_for_policy_set_definition_with_http_info(subscription_id, policy_set_definition_name, query_options:nil, custom_headers:nil)
list_query_results_for_policy_set_definition_async(subscription_id, policy_set_definition_name, query_options:query_options, custom_headers:custom_headers).value!
... | [
"def",
"list_query_results_for_policy_set_definition_with_http_info",
"(",
"subscription_id",
",",
"policy_set_definition_name",
",",
"query_options",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"list_query_results_for_policy_set_definition_async",
"(",
"subscription_id",
... | Queries policy events for the subscription level policy set definition.
@param subscription_id [String] Microsoft Azure subscription ID.
@param policy_set_definition_name [String] Policy set definition name.
@param query_options [QueryOptions] Additional parameters for the operation
@param custom_headers [Hash{Str... | [
"Queries",
"policy",
"events",
"for",
"the",
"subscription",
"level",
"policy",
"set",
"definition",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_policy_insights/lib/2018-04-04/generated/azure_mgmt_policy_insights/policy_events.rb#L533-L535 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_policy_insights/lib/2018-04-04/generated/azure_mgmt_policy_insights/policy_events.rb | Azure::PolicyInsights::Mgmt::V2018_04_04.PolicyEvents.list_query_results_for_policy_definition_with_http_info | def list_query_results_for_policy_definition_with_http_info(subscription_id, policy_definition_name, query_options:nil, custom_headers:nil)
list_query_results_for_policy_definition_async(subscription_id, policy_definition_name, query_options:query_options, custom_headers:custom_headers).value!
end | ruby | def list_query_results_for_policy_definition_with_http_info(subscription_id, policy_definition_name, query_options:nil, custom_headers:nil)
list_query_results_for_policy_definition_async(subscription_id, policy_definition_name, query_options:query_options, custom_headers:custom_headers).value!
end | [
"def",
"list_query_results_for_policy_definition_with_http_info",
"(",
"subscription_id",
",",
"policy_definition_name",
",",
"query_options",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"list_query_results_for_policy_definition_async",
"(",
"subscription_id",
",",
"pol... | Queries policy events for the subscription level policy definition.
@param subscription_id [String] Microsoft Azure subscription ID.
@param policy_definition_name [String] Policy definition name.
@param query_options [QueryOptions] Additional parameters for the operation
@param custom_headers [Hash{String => Strin... | [
"Queries",
"policy",
"events",
"for",
"the",
"subscription",
"level",
"policy",
"definition",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_policy_insights/lib/2018-04-04/generated/azure_mgmt_policy_insights/policy_events.rb#L657-L659 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_service_bus/lib/2015-08-01/generated/azure_mgmt_service_bus/topics.rb | Azure::ServiceBus::Mgmt::V2015_08_01.Topics.delete_with_http_info | def delete_with_http_info(resource_group_name, namespace_name, topic_name, custom_headers:nil)
delete_async(resource_group_name, namespace_name, topic_name, custom_headers:custom_headers).value!
end | ruby | def delete_with_http_info(resource_group_name, namespace_name, topic_name, custom_headers:nil)
delete_async(resource_group_name, namespace_name, topic_name, custom_headers:custom_headers).value!
end | [
"def",
"delete_with_http_info",
"(",
"resource_group_name",
",",
"namespace_name",
",",
"topic_name",
",",
"custom_headers",
":",
"nil",
")",
"delete_async",
"(",
"resource_group_name",
",",
"namespace_name",
",",
"topic_name",
",",
"custom_headers",
":custom_headers",
... | Deletes a topic from the specified namespace and resource group.
@param resource_group_name [String] Name of the Resource group within the
Azure subscription.
@param namespace_name [String] The namespace name
@param topic_name [String] The topic name.
@param custom_headers [Hash{String => String}] A hash of custo... | [
"Deletes",
"a",
"topic",
"from",
"the",
"specified",
"namespace",
"and",
"resource",
"group",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_service_bus/lib/2015-08-01/generated/azure_mgmt_service_bus/topics.rb#L270-L272 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_service_bus/lib/2015-08-01/generated/azure_mgmt_service_bus/topics.rb | Azure::ServiceBus::Mgmt::V2015_08_01.Topics.list_authorization_rules_with_http_info | def list_authorization_rules_with_http_info(resource_group_name, namespace_name, topic_name, custom_headers:nil)
list_authorization_rules_async(resource_group_name, namespace_name, topic_name, custom_headers:custom_headers).value!
end | ruby | def list_authorization_rules_with_http_info(resource_group_name, namespace_name, topic_name, custom_headers:nil)
list_authorization_rules_async(resource_group_name, namespace_name, topic_name, custom_headers:custom_headers).value!
end | [
"def",
"list_authorization_rules_with_http_info",
"(",
"resource_group_name",
",",
"namespace_name",
",",
"topic_name",
",",
"custom_headers",
":",
"nil",
")",
"list_authorization_rules_async",
"(",
"resource_group_name",
",",
"namespace_name",
",",
"topic_name",
",",
"cust... | Gets authorization rules for a topic.
@param resource_group_name [String] Name of the Resource group within the
Azure subscription.
@param namespace_name [String] The namespace name
@param topic_name [String] The topic name.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be add... | [
"Gets",
"authorization",
"rules",
"for",
"a",
"topic",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_service_bus/lib/2015-08-01/generated/azure_mgmt_service_bus/topics.rb#L470-L472 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_service_bus/lib/2015-08-01/generated/azure_mgmt_service_bus/topics.rb | Azure::ServiceBus::Mgmt::V2015_08_01.Topics.post_authorization_rule_with_http_info | def post_authorization_rule_with_http_info(resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers:nil)
post_authorization_rule_async(resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers:custom_headers).value!
end | ruby | def post_authorization_rule_with_http_info(resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers:nil)
post_authorization_rule_async(resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers:custom_headers).value!
end | [
"def",
"post_authorization_rule_with_http_info",
"(",
"resource_group_name",
",",
"namespace_name",
",",
"topic_name",
",",
"authorization_rule_name",
",",
"custom_headers",
":",
"nil",
")",
"post_authorization_rule_async",
"(",
"resource_group_name",
",",
"namespace_name",
"... | Returns the specified authorization rule.
@param resource_group_name [String] Name of the Resource group within the
Azure subscription.
@param namespace_name [String] The namespace name
@param topic_name [String] The topic name.
@param authorization_rule_name [String] The authorization rule name.
@param custom_h... | [
"Returns",
"the",
"specified",
"authorization",
"rule",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_service_bus/lib/2015-08-01/generated/azure_mgmt_service_bus/topics.rb#L702-L704 | train |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.4.0.36/generated/azure_service_fabric/mesh_network.rb | Azure::ServiceFabric::V6_4_0_36.MeshNetwork.create_or_update | def create_or_update(network_resource_name, network_resource_description, custom_headers:nil)
response = create_or_update_async(network_resource_name, network_resource_description, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create_or_update(network_resource_name, network_resource_description, custom_headers:nil)
response = create_or_update_async(network_resource_name, network_resource_description, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create_or_update",
"(",
"network_resource_name",
",",
"network_resource_description",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_or_update_async",
"(",
"network_resource_name",
",",
"network_resource_description",
",",
"custom_headers",
":custom_... | Creates or updates a Network resource.
Creates a Network resource with the specified name, description and
properties. If Network resource with the same name exists, then it is updated
with the specified description and properties. Network resource provides
connectivity between application services.
@param netwo... | [
"Creates",
"or",
"updates",
"a",
"Network",
"resource",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.4.0.36/generated/azure_service_fabric/mesh_network.rb#L41-L44 | train |
Azure/azure-sdk-for-ruby | data/azure_graph_rbac/lib/1.6/generated/azure_graph_rbac/applications.rb | Azure::GraphRbac::V1_6.Applications.patch | def patch(application_object_id, parameters, custom_headers:nil)
response = patch_async(application_object_id, parameters, custom_headers:custom_headers).value!
nil
end | ruby | def patch(application_object_id, parameters, custom_headers:nil)
response = patch_async(application_object_id, parameters, custom_headers:custom_headers).value!
nil
end | [
"def",
"patch",
"(",
"application_object_id",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"patch_async",
"(",
"application_object_id",
",",
"parameters",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"nil",
"end"
] | Update an existing application.
@param application_object_id [String] Application object ID.
@param parameters [ApplicationUpdateParameters] Parameters to update an
existing application.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Update",
"an",
"existing",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_graph_rbac/lib/1.6/generated/azure_graph_rbac/applications.rb#L384-L387 | train |
Azure/azure-sdk-for-ruby | data/azure_graph_rbac/lib/1.6/generated/azure_graph_rbac/applications.rb | Azure::GraphRbac::V1_6.Applications.list_owners | def list_owners(application_object_id, custom_headers:nil)
response = list_owners_async(application_object_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_owners(application_object_id, custom_headers:nil)
response = list_owners_async(application_object_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_owners",
"(",
"application_object_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_owners_async",
"(",
"application_object_id",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"response",... | Directory objects that are owners of the application.
The owners are a set of non-admin users who are allowed to modify this
object.
@param application_object_id [String] The object ID of the application for
which to get owners.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will b... | [
"Directory",
"objects",
"that",
"are",
"owners",
"of",
"the",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_graph_rbac/lib/1.6/generated/azure_graph_rbac/applications.rb#L478-L481 | train |
Azure/azure-sdk-for-ruby | data/azure_graph_rbac/lib/1.6/generated/azure_graph_rbac/applications.rb | Azure::GraphRbac::V1_6.Applications.list_key_credentials | def list_key_credentials(application_object_id, custom_headers:nil)
response = list_key_credentials_async(application_object_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_key_credentials(application_object_id, custom_headers:nil)
response = list_key_credentials_async(application_object_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_key_credentials",
"(",
"application_object_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_key_credentials_async",
"(",
"application_object_id",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unle... | Get the keyCredentials associated with an application.
@param application_object_id [String] Application object ID.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [KeyCredentialListResult] operation results. | [
"Get",
"the",
"keyCredentials",
"associated",
"with",
"an",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_graph_rbac/lib/1.6/generated/azure_graph_rbac/applications.rb#L671-L674 | train |
Azure/azure-sdk-for-ruby | data/azure_graph_rbac/lib/1.6/generated/azure_graph_rbac/applications.rb | Azure::GraphRbac::V1_6.Applications.update_key_credentials | def update_key_credentials(application_object_id, parameters, custom_headers:nil)
response = update_key_credentials_async(application_object_id, parameters, custom_headers:custom_headers).value!
nil
end | ruby | def update_key_credentials(application_object_id, parameters, custom_headers:nil)
response = update_key_credentials_async(application_object_id, parameters, custom_headers:custom_headers).value!
nil
end | [
"def",
"update_key_credentials",
"(",
"application_object_id",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"update_key_credentials_async",
"(",
"application_object_id",
",",
"parameters",
",",
"custom_headers",
":custom_headers",
")",
".",
... | Update the keyCredentials associated with an application.
@param application_object_id [String] Application object ID.
@param parameters [KeyCredentialsUpdateParameters] Parameters to update the
keyCredentials of an existing application.
@param custom_headers [Hash{String => String}] A hash of custom headers that
... | [
"Update",
"the",
"keyCredentials",
"associated",
"with",
"an",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_graph_rbac/lib/1.6/generated/azure_graph_rbac/applications.rb#L760-L763 | train |
Azure/azure-sdk-for-ruby | data/azure_graph_rbac/lib/1.6/generated/azure_graph_rbac/applications.rb | Azure::GraphRbac::V1_6.Applications.list_password_credentials | def list_password_credentials(application_object_id, custom_headers:nil)
response = list_password_credentials_async(application_object_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_password_credentials(application_object_id, custom_headers:nil)
response = list_password_credentials_async(application_object_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_password_credentials",
"(",
"application_object_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_password_credentials_async",
"(",
"application_object_id",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body... | Get the passwordCredentials associated with an application.
@param application_object_id [String] Application object ID.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [PasswordCredentialListResult] operation results. | [
"Get",
"the",
"passwordCredentials",
"associated",
"with",
"an",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_graph_rbac/lib/1.6/generated/azure_graph_rbac/applications.rb#L850-L853 | train |
Azure/azure-sdk-for-ruby | data/azure_graph_rbac/lib/1.6/generated/azure_graph_rbac/applications.rb | Azure::GraphRbac::V1_6.Applications.update_password_credentials | def update_password_credentials(application_object_id, parameters, custom_headers:nil)
response = update_password_credentials_async(application_object_id, parameters, custom_headers:custom_headers).value!
nil
end | ruby | def update_password_credentials(application_object_id, parameters, custom_headers:nil)
response = update_password_credentials_async(application_object_id, parameters, custom_headers:custom_headers).value!
nil
end | [
"def",
"update_password_credentials",
"(",
"application_object_id",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"update_password_credentials_async",
"(",
"application_object_id",
",",
"parameters",
",",
"custom_headers",
":custom_headers",
")... | Update passwordCredentials associated with an application.
@param application_object_id [String] Application object ID.
@param parameters [PasswordCredentialsUpdateParameters] Parameters to update
passwordCredentials of an existing application.
@param custom_headers [Hash{String => String}] A hash of custom header... | [
"Update",
"passwordCredentials",
"associated",
"with",
"an",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_graph_rbac/lib/1.6/generated/azure_graph_rbac/applications.rb#L939-L942 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_authorization/lib/2018-07-01-preview/generated/azure_mgmt_authorization/deny_assignments.rb | Azure::Authorization::Mgmt::V2018_07_01_preview.DenyAssignments.get_by_id | def get_by_id(deny_assignment_id, custom_headers:nil)
response = get_by_id_async(deny_assignment_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_by_id(deny_assignment_id, custom_headers:nil)
response = get_by_id_async(deny_assignment_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_by_id",
"(",
"deny_assignment_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_by_id_async",
"(",
"deny_assignment_id",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"response",
".",
... | Gets a deny assignment by ID.
@param deny_assignment_id [String] The fully qualified deny assignment ID.
For example, use the format,
/subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId}
for subscription level deny assignments, or
/providers/Microsoft.Authorization/denyAssign... | [
"Gets",
"a",
"deny",
"assignment",
"by",
"ID",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_authorization/lib/2018-07-01-preview/generated/azure_mgmt_authorization/deny_assignments.rb#L525-L528 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_iot_central/lib/2018-09-01/generated/azure_mgmt_iot_central/apps.rb | Azure::IotCentral::Mgmt::V2018_09_01.Apps.check_subdomain_availability | def check_subdomain_availability(operation_inputs, custom_headers:nil)
response = check_subdomain_availability_async(operation_inputs, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def check_subdomain_availability(operation_inputs, custom_headers:nil)
response = check_subdomain_availability_async(operation_inputs, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"check_subdomain_availability",
"(",
"operation_inputs",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"check_subdomain_availability_async",
"(",
"operation_inputs",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
... | Check if an IoT Central application subdomain is available.
@param operation_inputs [OperationInputs] Set the name parameter in the
OperationInputs structure to the subdomain of the IoT Central application to
check.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the ... | [
"Check",
"if",
"an",
"IoT",
"Central",
"application",
"subdomain",
"is",
"available",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_iot_central/lib/2018-09-01/generated/azure_mgmt_iot_central/apps.rb#L552-L555 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/notification_recipient_email.rb | Azure::ApiManagement::Mgmt::V2018_01_01.NotificationRecipientEmail.check_entity_exists_with_http_info | def check_entity_exists_with_http_info(resource_group_name, service_name, notification_name, email, custom_headers:nil)
check_entity_exists_async(resource_group_name, service_name, notification_name, email, custom_headers:custom_headers).value!
end | ruby | def check_entity_exists_with_http_info(resource_group_name, service_name, notification_name, email, custom_headers:nil)
check_entity_exists_async(resource_group_name, service_name, notification_name, email, custom_headers:custom_headers).value!
end | [
"def",
"check_entity_exists_with_http_info",
"(",
"resource_group_name",
",",
"service_name",
",",
"notification_name",
",",
"email",
",",
"custom_headers",
":",
"nil",
")",
"check_entity_exists_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"notification_nam... | Determine if Notification Recipient Email subscribed to the notification.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param notification_name [NotificationName] Notification Name Identifier.
Possible values include: 'Requ... | [
"Determine",
"if",
"Notification",
"Recipient",
"Email",
"subscribed",
"to",
"the",
"notification",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/notification_recipient_email.rb#L175-L177 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/notification_recipient_email.rb | Azure::ApiManagement::Mgmt::V2018_01_01.NotificationRecipientEmail.create_or_update_with_http_info | def create_or_update_with_http_info(resource_group_name, service_name, notification_name, email, custom_headers:nil)
create_or_update_async(resource_group_name, service_name, notification_name, email, custom_headers:custom_headers).value!
end | ruby | def create_or_update_with_http_info(resource_group_name, service_name, notification_name, email, custom_headers:nil)
create_or_update_async(resource_group_name, service_name, notification_name, email, custom_headers:custom_headers).value!
end | [
"def",
"create_or_update_with_http_info",
"(",
"resource_group_name",
",",
"service_name",
",",
"notification_name",
",",
"email",
",",
"custom_headers",
":",
"nil",
")",
"create_or_update_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"notification_name",
... | Adds the Email address to the list of Recipients for the Notification.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param notification_name [NotificationName] Notification Name Identifier.
Possible values include: 'Request... | [
"Adds",
"the",
"Email",
"address",
"to",
"the",
"list",
"of",
"Recipients",
"for",
"the",
"Notification",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/notification_recipient_email.rb#L281-L283 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/notification_recipient_email.rb | Azure::ApiManagement::Mgmt::V2018_01_01.NotificationRecipientEmail.delete_with_http_info | def delete_with_http_info(resource_group_name, service_name, notification_name, email, custom_headers:nil)
delete_async(resource_group_name, service_name, notification_name, email, custom_headers:custom_headers).value!
end | ruby | def delete_with_http_info(resource_group_name, service_name, notification_name, email, custom_headers:nil)
delete_async(resource_group_name, service_name, notification_name, email, custom_headers:custom_headers).value!
end | [
"def",
"delete_with_http_info",
"(",
"resource_group_name",
",",
"service_name",
",",
"notification_name",
",",
"email",
",",
"custom_headers",
":",
"nil",
")",
"delete_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"notification_name",
",",
"email",
",... | Removes the email from the list of Notification.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param notification_name [NotificationName] Notification Name Identifier.
Possible values include: 'RequestPublisherNotificationM... | [
"Removes",
"the",
"email",
"from",
"the",
"list",
"of",
"Notification",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/notification_recipient_email.rb#L405-L407 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/network_interfaces.rb | Azure::Network::Mgmt::V2018_07_01.NetworkInterfaces.begin_update_tags_with_http_info | def begin_update_tags_with_http_info(resource_group_name, network_interface_name, parameters, custom_headers:nil)
begin_update_tags_async(resource_group_name, network_interface_name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_update_tags_with_http_info(resource_group_name, network_interface_name, parameters, custom_headers:nil)
begin_update_tags_async(resource_group_name, network_interface_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_update_tags_with_http_info",
"(",
"resource_group_name",
",",
"network_interface_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_update_tags_async",
"(",
"resource_group_name",
",",
"network_interface_name",
",",
"parameters",
",",
"cu... | Updates a network interface tags.
@param resource_group_name [String] The name of the resource group.
@param network_interface_name [String] The name of the network interface.
@param parameters [TagsObject] Parameters supplied to update network
interface tags.
@param custom_headers [Hash{String => String}] A hash... | [
"Updates",
"a",
"network",
"interface",
"tags",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/network_interfaces.rb#L731-L733 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_resources/lib/2016-02-01/generated/azure_mgmt_resources/providers.rb | Azure::Resources::Mgmt::V2016_02_01.Providers.unregister | def unregister(resource_provider_namespace, custom_headers:nil)
response = unregister_async(resource_provider_namespace, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def unregister(resource_provider_namespace, custom_headers:nil)
response = unregister_async(resource_provider_namespace, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"unregister",
"(",
"resource_provider_namespace",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"unregister_async",
"(",
"resource_provider_namespace",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"... | Unregisters provider from a subscription.
@param resource_provider_namespace [String] Namespace of the resource
provider.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Provider] operation results. | [
"Unregisters",
"provider",
"from",
"a",
"subscription",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_resources/lib/2016-02-01/generated/azure_mgmt_resources/providers.rb#L34-L37 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_resources/lib/2016-02-01/generated/azure_mgmt_resources/providers.rb | Azure::Resources::Mgmt::V2016_02_01.Providers.register | def register(resource_provider_namespace, custom_headers:nil)
response = register_async(resource_provider_namespace, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def register(resource_provider_namespace, custom_headers:nil)
response = register_async(resource_provider_namespace, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"register",
"(",
"resource_provider_namespace",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"register_async",
"(",
"resource_provider_namespace",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"resp... | Registers provider to be used with a subscription.
@param resource_provider_namespace [String] Namespace of the resource
provider.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Provider] operation results. | [
"Registers",
"provider",
"to",
"be",
"used",
"with",
"a",
"subscription",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_resources/lib/2016-02-01/generated/azure_mgmt_resources/providers.rb#L125-L128 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_resources/lib/2016-02-01/generated/azure_mgmt_resources/providers.rb | Azure::Resources::Mgmt::V2016_02_01.Providers.get_with_http_info | def get_with_http_info(resource_provider_namespace, expand:nil, custom_headers:nil)
get_async(resource_provider_namespace, expand:expand, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_provider_namespace, expand:nil, custom_headers:nil)
get_async(resource_provider_namespace, expand:expand, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_provider_namespace",
",",
"expand",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_provider_namespace",
",",
"expand",
":",
"expand",
",",
"custom_headers",
":custom_headers",
")",
".",
"va... | Gets a resource provider.
@param resource_provider_namespace [String] Namespace of the resource
provider.
@param expand [String] The $expand query parameter. e.g. To include property
aliases in response, use $expand=resourceTypes/aliases.
@param custom_headers [Hash{String => String}] A hash of custom headers tha... | [
"Gets",
"a",
"resource",
"provider",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_resources/lib/2016-02-01/generated/azure_mgmt_resources/providers.rb#L331-L333 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/certificates.rb | Azure::Logic::Mgmt::V2016_06_01.Certificates.get_with_http_info | def get_with_http_info(resource_group_name, integration_account_name, certificate_name, custom_headers:nil)
get_async(resource_group_name, integration_account_name, certificate_name, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_group_name, integration_account_name, certificate_name, custom_headers:nil)
get_async(resource_group_name, integration_account_name, certificate_name, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_group_name",
",",
"integration_account_name",
",",
"certificate_name",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_group_name",
",",
"integration_account_name",
",",
"certificate_name",
",",
"custom_headers... | Gets an integration account certificate.
@param resource_group_name [String] The resource group name.
@param integration_account_name [String] The integration account name.
@param certificate_name [String] The integration account certificate name.
@param custom_headers [Hash{String => String}] A hash of custom hea... | [
"Gets",
"an",
"integration",
"account",
"certificate",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/certificates.rb#L146-L148 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/certificates.rb | Azure::Logic::Mgmt::V2016_06_01.Certificates.delete_with_http_info | def delete_with_http_info(resource_group_name, integration_account_name, certificate_name, custom_headers:nil)
delete_async(resource_group_name, integration_account_name, certificate_name, custom_headers:custom_headers).value!
end | ruby | def delete_with_http_info(resource_group_name, integration_account_name, certificate_name, custom_headers:nil)
delete_async(resource_group_name, integration_account_name, certificate_name, custom_headers:custom_headers).value!
end | [
"def",
"delete_with_http_info",
"(",
"resource_group_name",
",",
"integration_account_name",
",",
"certificate_name",
",",
"custom_headers",
":",
"nil",
")",
"delete_async",
"(",
"resource_group_name",
",",
"integration_account_name",
",",
"certificate_name",
",",
"custom_h... | Deletes an integration account certificate.
@param resource_group_name [String] The resource group name.
@param integration_account_name [String] The integration account name.
@param certificate_name [String] The integration account certificate name.
@param custom_headers [Hash{String => String}] A hash of custom ... | [
"Deletes",
"an",
"integration",
"account",
"certificate",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/certificates.rb#L361-L363 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/load_balancer_outbound_rules.rb | Azure::Network::Mgmt::V2019_02_01.LoadBalancerOutboundRules.get_with_http_info | def get_with_http_info(resource_group_name, load_balancer_name, outbound_rule_name, custom_headers:nil)
get_async(resource_group_name, load_balancer_name, outbound_rule_name, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_group_name, load_balancer_name, outbound_rule_name, custom_headers:nil)
get_async(resource_group_name, load_balancer_name, outbound_rule_name, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_group_name",
",",
"load_balancer_name",
",",
"outbound_rule_name",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_group_name",
",",
"load_balancer_name",
",",
"outbound_rule_name",
",",
"custom_headers",
":c... | Gets the specified load balancer outbound rule.
@param resource_group_name [String] The name of the resource group.
@param load_balancer_name [String] The name of the load balancer.
@param outbound_rule_name [String] The name of the outbound rule.
@param custom_headers [Hash{String => String}] A hash of custom hea... | [
"Gets",
"the",
"specified",
"load",
"balancer",
"outbound",
"rule",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/load_balancer_outbound_rules.rb#L143-L145 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_policy/lib/2015-10-01-preview/generated/azure_mgmt_policy/policy_assignments.rb | Azure::Policy::Mgmt::V2015_10_01_preview.PolicyAssignments.create_with_http_info | def create_with_http_info(scope, policy_assignment_name, parameters, custom_headers:nil)
create_async(scope, policy_assignment_name, parameters, custom_headers:custom_headers).value!
end | ruby | def create_with_http_info(scope, policy_assignment_name, parameters, custom_headers:nil)
create_async(scope, policy_assignment_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"create_with_http_info",
"(",
"scope",
",",
"policy_assignment_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"create_async",
"(",
"scope",
",",
"policy_assignment_name",
",",
"parameters",
",",
"custom_headers",
":custom_headers",
")",
".",
... | Creates a policy assignment.
Policy assignments are inherited by child resources. For example, when you
apply a policy to a resource group that policy is assigned to all resources
in the group.
@param scope [String] The scope of the policy assignment.
@param policy_assignment_name [String] The name of the policy... | [
"Creates",
"a",
"policy",
"assignment",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_policy/lib/2015-10-01-preview/generated/azure_mgmt_policy/policy_assignments.rb#L155-L157 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_policy/lib/2015-10-01-preview/generated/azure_mgmt_policy/policy_assignments.rb | Azure::Policy::Mgmt::V2015_10_01_preview.PolicyAssignments.delete_by_id | def delete_by_id(policy_assignment_id, custom_headers:nil)
response = delete_by_id_async(policy_assignment_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def delete_by_id(policy_assignment_id, custom_headers:nil)
response = delete_by_id_async(policy_assignment_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"delete_by_id",
"(",
"policy_assignment_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_by_id_async",
"(",
"policy_assignment_id",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"response",... | Deletes a policy assignment by ID.
When providing a scope for the assignment, use
'/subscriptions/{subscription-id}/' for subscriptions,
'/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for
resource groups, and
'/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers... | [
"Deletes",
"a",
"policy",
"assignment",
"by",
"ID",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_policy/lib/2015-10-01-preview/generated/azure_mgmt_policy/policy_assignments.rb#L653-L656 | train |
Azure/azure-sdk-for-ruby | management/azure_mgmt_policy/lib/2015-10-01-preview/generated/azure_mgmt_policy/policy_assignments.rb | Azure::Policy::Mgmt::V2015_10_01_preview.PolicyAssignments.get_by_id | def get_by_id(policy_assignment_id, custom_headers:nil)
response = get_by_id_async(policy_assignment_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_by_id(policy_assignment_id, custom_headers:nil)
response = get_by_id_async(policy_assignment_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_by_id",
"(",
"policy_assignment_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_by_id_async",
"(",
"policy_assignment_id",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"response",
"."... | Gets a policy assignment by ID.
When providing a scope for the assignment, use
'/subscriptions/{subscription-id}/' for subscriptions,
'/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for
resource groups, and
'/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{r... | [
"Gets",
"a",
"policy",
"assignment",
"by",
"ID",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_policy/lib/2015-10-01-preview/generated/azure_mgmt_policy/policy_assignments.rb#L898-L901 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/numeric_value.rb | RequestLogAnalyzer::Tracker.NumericValue.prepare | def prepare
fail "No value field set up for numeric tracker #{inspect}" unless options[:value]
fail "No categorizer set up for numeric tracker #{inspect}" unless options[:category]
unless options[:multiple]
@categorizer = create_lambda(options[:category])
@valueizer = create_lambda(... | ruby | def prepare
fail "No value field set up for numeric tracker #{inspect}" unless options[:value]
fail "No categorizer set up for numeric tracker #{inspect}" unless options[:category]
unless options[:multiple]
@categorizer = create_lambda(options[:category])
@valueizer = create_lambda(... | [
"def",
"prepare",
"fail",
"\"No value field set up for numeric tracker #{inspect}\"",
"unless",
"options",
"[",
":value",
"]",
"fail",
"\"No categorizer set up for numeric tracker #{inspect}\"",
"unless",
"options",
"[",
":category",
"]",
"unless",
"options",
"[",
":multiple",
... | Sets up the numeric value tracker. It will check whether the value and category
options are set that are used to extract and categorize the values during
parsing. Two lambda procedures are created for these tasks | [
"Sets",
"up",
"the",
"numeric",
"value",
"tracker",
".",
"It",
"will",
"check",
"whether",
"the",
"value",
"and",
"category",
"options",
"are",
"set",
"that",
"are",
"used",
"to",
"extract",
"and",
"categorize",
"the",
"values",
"during",
"parsing",
".",
"... | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/numeric_value.rb#L8-L25 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/numeric_value.rb | RequestLogAnalyzer::Tracker.NumericValue.update | def update(request)
if options[:multiple]
found_categories = request.every(options[:category])
found_values = request.every(options[:value])
fail 'Capture mismatch for multiple values in a request' unless found_categories.length == found_values.length
found_categories.each_wit... | ruby | def update(request)
if options[:multiple]
found_categories = request.every(options[:category])
found_values = request.every(options[:value])
fail 'Capture mismatch for multiple values in a request' unless found_categories.length == found_values.length
found_categories.each_wit... | [
"def",
"update",
"(",
"request",
")",
"if",
"options",
"[",
":multiple",
"]",
"found_categories",
"=",
"request",
".",
"every",
"(",
"options",
"[",
":category",
"]",
")",
"found_values",
"=",
"request",
".",
"every",
"(",
"options",
"[",
":value",
"]",
... | Get the value information from the request and store it in the respective categories.
If a request can contain multiple usable values for this tracker, the :multiple option
should be set to true. In this case, all the values and respective categories will be
read from the request using the #every method from the fi... | [
"Get",
"the",
"value",
"information",
"from",
"the",
"request",
"and",
"store",
"it",
"in",
"the",
"respective",
"categories",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/numeric_value.rb#L40-L54 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/numeric_value.rb | RequestLogAnalyzer::Tracker.NumericValue.display_value | def display_value(value)
return '- ' if value.nil?
return '0 ' if value.zero?
case [Math.log10(value.abs).floor, 0].max
when 0...4 then '%d ' % value
when 4...7 then '%dk' % (value / 1000)
when 7...10 then '%dM' % (value / 1_000_000)
when 10...13 then '%dG' % (val... | ruby | def display_value(value)
return '- ' if value.nil?
return '0 ' if value.zero?
case [Math.log10(value.abs).floor, 0].max
when 0...4 then '%d ' % value
when 4...7 then '%dk' % (value / 1000)
when 7...10 then '%dM' % (value / 1_000_000)
when 10...13 then '%dG' % (val... | [
"def",
"display_value",
"(",
"value",
")",
"return",
"'- '",
"if",
"value",
".",
"nil?",
"return",
"'0 '",
"if",
"value",
".",
"zero?",
"case",
"[",
"Math",
".",
"log10",
"(",
"value",
".",
"abs",
")",
".",
"floor",
",",
"0",
"]",
".",
"max",
"when... | Display a value | [
"Display",
"a",
"value"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/numeric_value.rb#L73-L85 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/numeric_value.rb | RequestLogAnalyzer::Tracker.NumericValue.title | def title
@title ||= begin
if options[:title]
options[:title]
else
title_builder = ''
title_builder << "#{options[:value]} " if options[:value].is_a?(Symbol)
title_builder << (options[:category].is_a?(Symbol) ? "per #{options[:category]}" : 'per request')
... | ruby | def title
@title ||= begin
if options[:title]
options[:title]
else
title_builder = ''
title_builder << "#{options[:value]} " if options[:value].is_a?(Symbol)
title_builder << (options[:category].is_a?(Symbol) ? "per #{options[:category]}" : 'per request')
... | [
"def",
"title",
"@title",
"||=",
"begin",
"if",
"options",
"[",
":title",
"]",
"options",
"[",
":title",
"]",
"else",
"title_builder",
"=",
"''",
"title_builder",
"<<",
"\"#{options[:value]} \"",
"if",
"options",
"[",
":value",
"]",
".",
"is_a?",
"(",
"Symbo... | Returns the title of this tracker for reports | [
"Returns",
"the",
"title",
"of",
"this",
"tracker",
"for",
"reports"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/numeric_value.rb#L104-L115 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/numeric_value.rb | RequestLogAnalyzer::Tracker.NumericValue.to_yaml_object | def to_yaml_object
return nil if @categories.empty?
@categories.each do |cat, info|
info[:stddev] = stddev(cat)
info[:median] = median(cat) if info[:buckets]
info[:interval_95_percent] = percentile_interval(cat, 95) if info[:buckets]
end
@categories
end | ruby | def to_yaml_object
return nil if @categories.empty?
@categories.each do |cat, info|
info[:stddev] = stddev(cat)
info[:median] = median(cat) if info[:buckets]
info[:interval_95_percent] = percentile_interval(cat, 95) if info[:buckets]
end
@categories
end | [
"def",
"to_yaml_object",
"return",
"nil",
"if",
"@categories",
".",
"empty?",
"@categories",
".",
"each",
"do",
"|",
"cat",
",",
"info",
"|",
"info",
"[",
":stddev",
"]",
"=",
"stddev",
"(",
"cat",
")",
"info",
"[",
":median",
"]",
"=",
"median",
"(",
... | Returns all the categories and the tracked duration as a hash than can be exported to YAML | [
"Returns",
"all",
"the",
"categories",
"and",
"the",
"tracked",
"duration",
"as",
"a",
"hash",
"than",
"can",
"be",
"exported",
"to",
"YAML"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/numeric_value.rb#L118-L126 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/numeric_value.rb | RequestLogAnalyzer::Tracker.NumericValue.bucket_index | def bucket_index(value)
return 0 if value < @min_bucket_value
return @number_of_buckets - 1 if value >= @max_bucket_value
((Math.log(value) - Math.log(@min_bucket_value)) / @bucket_size).floor
end | ruby | def bucket_index(value)
return 0 if value < @min_bucket_value
return @number_of_buckets - 1 if value >= @max_bucket_value
((Math.log(value) - Math.log(@min_bucket_value)) / @bucket_size).floor
end | [
"def",
"bucket_index",
"(",
"value",
")",
"return",
"0",
"if",
"value",
"<",
"@min_bucket_value",
"return",
"@number_of_buckets",
"-",
"1",
"if",
"value",
">=",
"@max_bucket_value",
"(",
"(",
"Math",
".",
"log",
"(",
"value",
")",
"-",
"Math",
".",
"log",
... | Returns the bucket index for a value | [
"Returns",
"the",
"bucket",
"index",
"for",
"a",
"value"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/numeric_value.rb#L129-L134 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/numeric_value.rb | RequestLogAnalyzer::Tracker.NumericValue.bucket_value | def bucket_value(index, type = nil)
case type
when :begin, :start, :lower, :lower_bound then bucket_lower_bound(index)
when :end, :finish, :upper, :upper_bound then bucket_upper_bound(index)
else bucket_average_value(index)
end
end | ruby | def bucket_value(index, type = nil)
case type
when :begin, :start, :lower, :lower_bound then bucket_lower_bound(index)
when :end, :finish, :upper, :upper_bound then bucket_upper_bound(index)
else bucket_average_value(index)
end
end | [
"def",
"bucket_value",
"(",
"index",
",",
"type",
"=",
"nil",
")",
"case",
"type",
"when",
":begin",
",",
":start",
",",
":lower",
",",
":lower_bound",
"then",
"bucket_lower_bound",
"(",
"index",
")",
"when",
":end",
",",
":finish",
",",
":upper",
",",
"... | Returns a single value representing a bucket. | [
"Returns",
"a",
"single",
"value",
"representing",
"a",
"bucket",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/numeric_value.rb#L152-L158 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/numeric_value.rb | RequestLogAnalyzer::Tracker.NumericValue.percentile_index | def percentile_index(category, x, inclusive = false)
total_encountered = 0
@categories[category][:buckets].each_with_index do |count, index|
total_encountered += count
percentage = ((total_encountered.to_f / hits(category).to_f) * 100).floor
return index if (inclusive && percentage >... | ruby | def percentile_index(category, x, inclusive = false)
total_encountered = 0
@categories[category][:buckets].each_with_index do |count, index|
total_encountered += count
percentage = ((total_encountered.to_f / hits(category).to_f) * 100).floor
return index if (inclusive && percentage >... | [
"def",
"percentile_index",
"(",
"category",
",",
"x",
",",
"inclusive",
"=",
"false",
")",
"total_encountered",
"=",
"0",
"@categories",
"[",
"category",
"]",
"[",
":buckets",
"]",
".",
"each_with_index",
"do",
"|",
"count",
",",
"index",
"|",
"total_encount... | Returns the upper bound value that would include x% of the hits. | [
"Returns",
"the",
"upper",
"bound",
"value",
"that",
"would",
"include",
"x%",
"of",
"the",
"hits",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/numeric_value.rb#L171-L178 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/numeric_value.rb | RequestLogAnalyzer::Tracker.NumericValue.percentile_interval | def percentile_interval(category, x)
case x
when Range
lower, upper = percentile_indices(category, x.begin, x.end)
Range.new(bucket_lower_bound(lower), bucket_upper_bound(upper))
when Numeric
percentile_interval(category, Range.new((100 - x) / 2, (100 - (100 - x) / 2)))
e... | ruby | def percentile_interval(category, x)
case x
when Range
lower, upper = percentile_indices(category, x.begin, x.end)
Range.new(bucket_lower_bound(lower), bucket_upper_bound(upper))
when Numeric
percentile_interval(category, Range.new((100 - x) / 2, (100 - (100 - x) / 2)))
e... | [
"def",
"percentile_interval",
"(",
"category",
",",
"x",
")",
"case",
"x",
"when",
"Range",
"lower",
",",
"upper",
"=",
"percentile_indices",
"(",
"category",
",",
"x",
".",
"begin",
",",
"x",
".",
"end",
")",
"Range",
".",
"new",
"(",
"bucket_lower_boun... | Returns a percentile interval, i.e. the lower bound and the upper bound of the values
that represent the x%-interval for the bucketized dataset.
A 90% interval means that 5% of the values would have been lower than the lower bound and
5% would have been higher than the upper bound, leaving 90% of the values within ... | [
"Returns",
"a",
"percentile",
"interval",
"i",
".",
"e",
".",
"the",
"lower",
"bound",
"and",
"the",
"upper",
"bound",
"of",
"the",
"values",
"that",
"represent",
"the",
"x%",
"-",
"interval",
"for",
"the",
"bucketized",
"dataset",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/numeric_value.rb#L209-L219 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/numeric_value.rb | RequestLogAnalyzer::Tracker.NumericValue.statistics_header | def statistics_header(options)
[
{ title: options[:title], width: :rest },
{ title: 'Hits', align: :right, highlight: (options[:highlight] == :hits), min_width: 4 },
{ title: 'Sum', align: :right, highlight: (options[:highlight] == :sum), min_width: 6 },
{ title: 'Mean', ... | ruby | def statistics_header(options)
[
{ title: options[:title], width: :rest },
{ title: 'Hits', align: :right, highlight: (options[:highlight] == :hits), min_width: 4 },
{ title: 'Sum', align: :right, highlight: (options[:highlight] == :sum), min_width: 6 },
{ title: 'Mean', ... | [
"def",
"statistics_header",
"(",
"options",
")",
"[",
"{",
"title",
":",
"options",
"[",
":title",
"]",
",",
"width",
":",
":rest",
"}",
",",
"{",
"title",
":",
"'Hits'",
",",
"align",
":",
":right",
",",
"highlight",
":",
"(",
"options",
"[",
":high... | Returns the column header for a statistics table to report on the statistics result | [
"Returns",
"the",
"column",
"header",
"for",
"a",
"statistics",
"table",
"to",
"report",
"on",
"the",
"statistics",
"result"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/numeric_value.rb#L311-L322 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/numeric_value.rb | RequestLogAnalyzer::Tracker.NumericValue.statistics_row | def statistics_row(cat)
[cat, hits(cat), display_value(sum(cat)), display_value(mean(cat)), display_value(stddev(cat)),
display_value(min(cat)), display_value(max(cat)),
display_value(percentile_interval(cat, 95).begin) + '-' + display_value(percentile_interval(cat, 95).end)]
end | ruby | def statistics_row(cat)
[cat, hits(cat), display_value(sum(cat)), display_value(mean(cat)), display_value(stddev(cat)),
display_value(min(cat)), display_value(max(cat)),
display_value(percentile_interval(cat, 95).begin) + '-' + display_value(percentile_interval(cat, 95).end)]
end | [
"def",
"statistics_row",
"(",
"cat",
")",
"[",
"cat",
",",
"hits",
"(",
"cat",
")",
",",
"display_value",
"(",
"sum",
"(",
"cat",
")",
")",
",",
"display_value",
"(",
"mean",
"(",
"cat",
")",
")",
",",
"display_value",
"(",
"stddev",
"(",
"cat",
")... | Returns a row of statistics information for a report table, given a category | [
"Returns",
"a",
"row",
"of",
"statistics",
"information",
"for",
"a",
"report",
"table",
"given",
"a",
"category"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/numeric_value.rb#L325-L329 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/source/log_parser.rb | RequestLogAnalyzer::Source.LogParser.decompress_file? | def decompress_file?(filename)
nice_command = 'nice -n 5'
return "#{nice_command} gunzip -c -d #{filename}" if filename.match(/\.tar.gz$/) || filename.match(/\.tgz$/) || filename.match(/\.gz$/)
return "#{nice_command} bunzip2 -c -d #{filename}" if filename.match(/\.bz2$/)
return "#{nice_command... | ruby | def decompress_file?(filename)
nice_command = 'nice -n 5'
return "#{nice_command} gunzip -c -d #{filename}" if filename.match(/\.tar.gz$/) || filename.match(/\.tgz$/) || filename.match(/\.gz$/)
return "#{nice_command} bunzip2 -c -d #{filename}" if filename.match(/\.bz2$/)
return "#{nice_command... | [
"def",
"decompress_file?",
"(",
"filename",
")",
"nice_command",
"=",
"'nice -n 5'",
"return",
"\"#{nice_command} gunzip -c -d #{filename}\"",
"if",
"filename",
".",
"match",
"(",
"/",
"\\.",
"/",
")",
"||",
"filename",
".",
"match",
"(",
"/",
"\\.",
"/",
")",
... | Check if a file has a compressed extention in the filename.
If recognized, return the command string used to decompress the file | [
"Check",
"if",
"a",
"file",
"has",
"a",
"compressed",
"extention",
"in",
"the",
"filename",
".",
"If",
"recognized",
"return",
"the",
"command",
"string",
"used",
"to",
"decompress",
"the",
"file"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/source/log_parser.rb#L97-L105 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/source/log_parser.rb | RequestLogAnalyzer::Source.LogParser.parse_file | def parse_file(file, options = {}, &block)
if File.directory?(file)
parse_files(Dir["#{ file }/*"], options, &block)
return
end
@current_source = File.expand_path(file)
@source_changes_handler.call(:started, @current_source) if @source_changes_handler
if decompress_file?(... | ruby | def parse_file(file, options = {}, &block)
if File.directory?(file)
parse_files(Dir["#{ file }/*"], options, &block)
return
end
@current_source = File.expand_path(file)
@source_changes_handler.call(:started, @current_source) if @source_changes_handler
if decompress_file?(... | [
"def",
"parse_file",
"(",
"file",
",",
"options",
"=",
"{",
"}",
",",
"&",
"block",
")",
"if",
"File",
".",
"directory?",
"(",
"file",
")",
"parse_files",
"(",
"Dir",
"[",
"\"#{ file }/*\"",
"]",
",",
"options",
",",
"block",
")",
"return",
"end",
"@... | Parses a log file. Creates an IO stream for the provided file, and sends it to parse_io for
further handling. This method supports progress updates that can be used to display a progressbar
If the logfile is compressed, it is uncompressed to stdout and read.
TODO: Check if IO.popen encounters problems with the give... | [
"Parses",
"a",
"log",
"file",
".",
"Creates",
"an",
"IO",
"stream",
"for",
"the",
"provided",
"file",
"and",
"sends",
"it",
"to",
"parse_io",
"for",
"further",
"handling",
".",
"This",
"method",
"supports",
"progress",
"updates",
"that",
"can",
"be",
"used... | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/source/log_parser.rb#L116-L144 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/source/log_parser.rb | RequestLogAnalyzer::Source.LogParser.update_current_request | def update_current_request(request_data, &block) # :yields: request
if alternative_header_line?(request_data)
if @current_request
@current_request << request_data
else
@current_request = @file_format.request(request_data)
end
elsif header_line?(request_data)
... | ruby | def update_current_request(request_data, &block) # :yields: request
if alternative_header_line?(request_data)
if @current_request
@current_request << request_data
else
@current_request = @file_format.request(request_data)
end
elsif header_line?(request_data)
... | [
"def",
"update_current_request",
"(",
"request_data",
",",
"&",
"block",
")",
"# :yields: request",
"if",
"alternative_header_line?",
"(",
"request_data",
")",
"if",
"@current_request",
"@current_request",
"<<",
"request_data",
"else",
"@current_request",
"=",
"@file_form... | Combines the different lines of a request into a single Request object. It will start a
new request when a header line is encountered en will emit the request when a footer line
is encountered.
Combining the lines is done using heuristics. Problems can occur in this process. The
current parse strategy defines how ... | [
"Combines",
"the",
"different",
"lines",
"of",
"a",
"request",
"into",
"a",
"single",
"Request",
"object",
".",
"It",
"will",
"start",
"a",
"new",
"request",
"when",
"a",
"header",
"line",
"is",
"encountered",
"en",
"will",
"emit",
"the",
"request",
"when"... | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/source/log_parser.rb#L285-L320 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/source/log_parser.rb | RequestLogAnalyzer::Source.LogParser.handle_request | def handle_request(request, &_block) # :yields: :request, request
@parsed_requests += 1
request.validate
accepted = block_given? ? yield(request) : true
@skipped_requests += 1 unless accepted
end | ruby | def handle_request(request, &_block) # :yields: :request, request
@parsed_requests += 1
request.validate
accepted = block_given? ? yield(request) : true
@skipped_requests += 1 unless accepted
end | [
"def",
"handle_request",
"(",
"request",
",",
"&",
"_block",
")",
"# :yields: :request, request",
"@parsed_requests",
"+=",
"1",
"request",
".",
"validate",
"accepted",
"=",
"block_given?",
"?",
"yield",
"(",
"request",
")",
":",
"true",
"@skipped_requests",
"+=",... | Handles the parsed request by sending it into the pipeline.
- It will call RequestLogAnalyzer::Request#validate on the request instance
- It will send the request into the pipeline, checking whether it was accepted by all the filters.
- It will update the parsed_requests and skipped_requests variables accordingly
... | [
"Handles",
"the",
"parsed",
"request",
"by",
"sending",
"it",
"into",
"the",
"pipeline",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/source/log_parser.rb#L329-L334 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/file_format.rb | RequestLogAnalyzer::FileFormat.CommonRegularExpressions.hostname_or_ip_address | def hostname_or_ip_address(blank = false)
regexp = Regexp.union(hostname, ip_address)
add_blank_option(regexp, blank)
end | ruby | def hostname_or_ip_address(blank = false)
regexp = Regexp.union(hostname, ip_address)
add_blank_option(regexp, blank)
end | [
"def",
"hostname_or_ip_address",
"(",
"blank",
"=",
"false",
")",
"regexp",
"=",
"Regexp",
".",
"union",
"(",
"hostname",
",",
"ip_address",
")",
"add_blank_option",
"(",
"regexp",
",",
"blank",
")",
"end"
] | Creates a regular expression to match a hostname or ip address | [
"Creates",
"a",
"regular",
"expression",
"to",
"match",
"a",
"hostname",
"or",
"ip",
"address"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/file_format.rb#L134-L137 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/file_format.rb | RequestLogAnalyzer::FileFormat.CommonRegularExpressions.timestamp | def timestamp(format_string, blank = false)
regexp = ''
format_string.scan(/([^%]*)(?:%([A-Za-z%]))?/) do |literal, variable|
regexp << Regexp.quote(literal)
if variable
if TIMESTAMP_PARTS.key?(variable)
regexp << TIMESTAMP_PARTS[variable]
else
fai... | ruby | def timestamp(format_string, blank = false)
regexp = ''
format_string.scan(/([^%]*)(?:%([A-Za-z%]))?/) do |literal, variable|
regexp << Regexp.quote(literal)
if variable
if TIMESTAMP_PARTS.key?(variable)
regexp << TIMESTAMP_PARTS[variable]
else
fai... | [
"def",
"timestamp",
"(",
"format_string",
",",
"blank",
"=",
"false",
")",
"regexp",
"=",
"''",
"format_string",
".",
"scan",
"(",
"/",
"/",
")",
"do",
"|",
"literal",
",",
"variable",
"|",
"regexp",
"<<",
"Regexp",
".",
"quote",
"(",
"literal",
")",
... | Create a regular expression for a timestamp, generated by a strftime call.
Provide the format string to construct a matching regular expression.
Set blank to true to allow and empty string, or set blank to a string to set
a substitute for the nil value. | [
"Create",
"a",
"regular",
"expression",
"for",
"a",
"timestamp",
"generated",
"by",
"a",
"strftime",
"call",
".",
"Provide",
"the",
"format",
"string",
"to",
"construct",
"a",
"matching",
"regular",
"expression",
".",
"Set",
"blank",
"to",
"true",
"to",
"all... | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/file_format.rb#L143-L157 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/file_format.rb | RequestLogAnalyzer::FileFormat.CommonRegularExpressions.add_blank_option | def add_blank_option(regexp, blank)
case blank
when String then Regexp.union(regexp, Regexp.new(Regexp.quote(blank)))
when true then Regexp.union(regexp, //)
else regexp
end
end | ruby | def add_blank_option(regexp, blank)
case blank
when String then Regexp.union(regexp, Regexp.new(Regexp.quote(blank)))
when true then Regexp.union(regexp, //)
else regexp
end
end | [
"def",
"add_blank_option",
"(",
"regexp",
",",
"blank",
")",
"case",
"blank",
"when",
"String",
"then",
"Regexp",
".",
"union",
"(",
"regexp",
",",
"Regexp",
".",
"new",
"(",
"Regexp",
".",
"quote",
"(",
"blank",
")",
")",
")",
"when",
"true",
"then",
... | Allow the field to be blank if this option is given. This can be true to
allow an empty string or a string alternative for the nil value. | [
"Allow",
"the",
"field",
"to",
"be",
"blank",
"if",
"this",
"option",
"is",
"given",
".",
"This",
"can",
"be",
"true",
"to",
"allow",
"an",
"empty",
"string",
"or",
"a",
"string",
"alternative",
"for",
"the",
"nil",
"value",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/file_format.rb#L184-L190 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/file_format.rb | RequestLogAnalyzer::FileFormat.Base.valid_line_definitions? | def valid_line_definitions?
line_definitions.any? { |(_, ld)| ld.header } && line_definitions.any? { |(_, ld)| ld.footer }
end | ruby | def valid_line_definitions?
line_definitions.any? { |(_, ld)| ld.header } && line_definitions.any? { |(_, ld)| ld.footer }
end | [
"def",
"valid_line_definitions?",
"line_definitions",
".",
"any?",
"{",
"|",
"(",
"_",
",",
"ld",
")",
"|",
"ld",
".",
"header",
"}",
"&&",
"line_definitions",
".",
"any?",
"{",
"|",
"(",
"_",
",",
"ld",
")",
"|",
"ld",
".",
"footer",
"}",
"end"
] | Checks whether the line definitions form a valid language.
A file format should have at least a header and a footer line type | [
"Checks",
"whether",
"the",
"line",
"definitions",
"form",
"a",
"valid",
"language",
".",
"A",
"file",
"format",
"should",
"have",
"at",
"least",
"a",
"header",
"and",
"a",
"footer",
"line",
"type"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/file_format.rb#L277-L279 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/file_format.rb | RequestLogAnalyzer::FileFormat.Base.parse_line | def parse_line(line, &warning_handler)
line_definitions.each do |_lt, definition|
match = definition.matches(line, &warning_handler)
return match if match
end
nil
end | ruby | def parse_line(line, &warning_handler)
line_definitions.each do |_lt, definition|
match = definition.matches(line, &warning_handler)
return match if match
end
nil
end | [
"def",
"parse_line",
"(",
"line",
",",
"&",
"warning_handler",
")",
"line_definitions",
".",
"each",
"do",
"|",
"_lt",
",",
"definition",
"|",
"match",
"=",
"definition",
".",
"matches",
"(",
"line",
",",
"warning_handler",
")",
"return",
"match",
"if",
"m... | Parses a line by trying to parse it using every line definition in this file format | [
"Parses",
"a",
"line",
"by",
"trying",
"to",
"parse",
"it",
"using",
"every",
"line",
"definition",
"in",
"this",
"file",
"format"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/file_format.rb#L297-L304 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/aggregator/summarizer.rb | RequestLogAnalyzer::Aggregator.Summarizer.to_yaml | def to_yaml
require 'yaml'
trackers_export = @trackers.reduce({}) do |export, tracker|
export[tracker.title] = tracker.to_yaml_object; export
end
YAML.dump(trackers_export)
end | ruby | def to_yaml
require 'yaml'
trackers_export = @trackers.reduce({}) do |export, tracker|
export[tracker.title] = tracker.to_yaml_object; export
end
YAML.dump(trackers_export)
end | [
"def",
"to_yaml",
"require",
"'yaml'",
"trackers_export",
"=",
"@trackers",
".",
"reduce",
"(",
"{",
"}",
")",
"do",
"|",
"export",
",",
"tracker",
"|",
"export",
"[",
"tracker",
".",
"title",
"]",
"=",
"tracker",
".",
"to_yaml_object",
";",
"export",
"e... | Exports all the tracker results to YAML. It will call the to_yaml_object method
for every tracker and combines these into a single YAML export. | [
"Exports",
"all",
"the",
"tracker",
"results",
"to",
"YAML",
".",
"It",
"will",
"call",
"the",
"to_yaml_object",
"method",
"for",
"every",
"tracker",
"and",
"combines",
"these",
"into",
"a",
"single",
"YAML",
"export",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/aggregator/summarizer.rb#L80-L86 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/frequency.rb | RequestLogAnalyzer::Tracker.Frequency.prepare | def prepare
options[:category] = options[:value] if options[:value] && !options[:category]
fail "No categorizer set up for category tracker #{inspect}" unless options[:category]
@categorizer = create_lambda(options[:category]) unless options[:multiple]
# Initialize the categories. Use the list... | ruby | def prepare
options[:category] = options[:value] if options[:value] && !options[:category]
fail "No categorizer set up for category tracker #{inspect}" unless options[:category]
@categorizer = create_lambda(options[:category]) unless options[:multiple]
# Initialize the categories. Use the list... | [
"def",
"prepare",
"options",
"[",
":category",
"]",
"=",
"options",
"[",
":value",
"]",
"if",
"options",
"[",
":value",
"]",
"&&",
"!",
"options",
"[",
":category",
"]",
"fail",
"\"No categorizer set up for category tracker #{inspect}\"",
"unless",
"options",
"[",... | Check if categories are set up | [
"Check",
"if",
"categories",
"are",
"set",
"up"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/frequency.rb#L26-L35 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker.rb | RequestLogAnalyzer::Tracker.Base.setup_should_update_checks! | def setup_should_update_checks!
@should_update_checks = []
@should_update_checks.push(lambda { |request| request.has_line_type?(options[:line_type]) }) if options[:line_type]
@should_update_checks.push(options[:if]) if options[:if].respond_to?(:call)
@should_update_checks.push(lambda { |request|... | ruby | def setup_should_update_checks!
@should_update_checks = []
@should_update_checks.push(lambda { |request| request.has_line_type?(options[:line_type]) }) if options[:line_type]
@should_update_checks.push(options[:if]) if options[:if].respond_to?(:call)
@should_update_checks.push(lambda { |request|... | [
"def",
"setup_should_update_checks!",
"@should_update_checks",
"=",
"[",
"]",
"@should_update_checks",
".",
"push",
"(",
"lambda",
"{",
"|",
"request",
"|",
"request",
".",
"has_line_type?",
"(",
"options",
"[",
":line_type",
"]",
")",
"}",
")",
"if",
"options",... | Initialize the class
Note that the options are only applicable if should_update? is not overwritten
by the inheriting class.
=== Options
* <tt>:if</tt> Handle request if this proc is true for the handled request.
* <tt>:unless</tt> Handle request if this proc is false for the handled request.
* <tt>:line_type</t... | [
"Initialize",
"the",
"class",
"Note",
"that",
"the",
"options",
"are",
"only",
"applicable",
"if",
"should_update?",
"is",
"not",
"overwritten",
"by",
"the",
"inheriting",
"class",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker.rb#L28-L35 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker.rb | RequestLogAnalyzer::Tracker.Base.create_lambda | def create_lambda(arg)
case arg
when Proc then arg
when Symbol then lambda { |request| request[arg] }
else fail "Canot create a lambda expression from this argument: #{arg.inspect}!"
end
end | ruby | def create_lambda(arg)
case arg
when Proc then arg
when Symbol then lambda { |request| request[arg] }
else fail "Canot create a lambda expression from this argument: #{arg.inspect}!"
end
end | [
"def",
"create_lambda",
"(",
"arg",
")",
"case",
"arg",
"when",
"Proc",
"then",
"arg",
"when",
"Symbol",
"then",
"lambda",
"{",
"|",
"request",
"|",
"request",
"[",
"arg",
"]",
"}",
"else",
"fail",
"\"Canot create a lambda expression from this argument: #{arg.insp... | Creates a lambda expression to return a static field from a request. If the
argument already is a lambda exprssion, it will simply return the argument. | [
"Creates",
"a",
"lambda",
"expression",
"to",
"return",
"a",
"static",
"field",
"from",
"a",
"request",
".",
"If",
"the",
"argument",
"already",
"is",
"a",
"lambda",
"exprssion",
"it",
"will",
"simply",
"return",
"the",
"argument",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker.rb#L39-L45 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/line_definition.rb | RequestLogAnalyzer.LineDefinition.match_for | def match_for(line, request, &warning_handler)
if match_info = matches(line, &warning_handler)
convert_captured_values(match_info[:captures], request)
else
false
end
end | ruby | def match_for(line, request, &warning_handler)
if match_info = matches(line, &warning_handler)
convert_captured_values(match_info[:captures], request)
else
false
end
end | [
"def",
"match_for",
"(",
"line",
",",
"request",
",",
"&",
"warning_handler",
")",
"if",
"match_info",
"=",
"matches",
"(",
"line",
",",
"warning_handler",
")",
"convert_captured_values",
"(",
"match_info",
"[",
":captures",
"]",
",",
"request",
")",
"else",
... | matches the line and converts the captured values using the request's
convert_value function. | [
"matches",
"the",
"line",
"and",
"converts",
"the",
"captured",
"values",
"using",
"the",
"request",
"s",
"convert_value",
"function",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/line_definition.rb#L104-L110 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/request.rb | RequestLogAnalyzer.Request.add_parsed_line | def add_parsed_line(parsed_line)
value_hash = parsed_line[:line_definition].convert_captured_values(parsed_line[:captures], self)
value_hash[:line_type] = parsed_line[:line_definition].name
value_hash[:lineno] = parsed_line[:lineno]
value_hash[:source] = parsed_line[:source]
value_hash[:co... | ruby | def add_parsed_line(parsed_line)
value_hash = parsed_line[:line_definition].convert_captured_values(parsed_line[:captures], self)
value_hash[:line_type] = parsed_line[:line_definition].name
value_hash[:lineno] = parsed_line[:lineno]
value_hash[:source] = parsed_line[:source]
value_hash[:co... | [
"def",
"add_parsed_line",
"(",
"parsed_line",
")",
"value_hash",
"=",
"parsed_line",
"[",
":line_definition",
"]",
".",
"convert_captured_values",
"(",
"parsed_line",
"[",
":captures",
"]",
",",
"self",
")",
"value_hash",
"[",
":line_type",
"]",
"=",
"parsed_line"... | Adds another line to the request when it is parsed in the LogParser.
The line should be provided as a hash with the attributes line_definition, :captures,
:lineno and :source set. This function is called from LogParser. | [
"Adds",
"another",
"line",
"to",
"the",
"request",
"when",
"it",
"is",
"parsed",
"in",
"the",
"LogParser",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/request.rb#L133-L140 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/request.rb | RequestLogAnalyzer.Request.add_line_hash | def add_line_hash(value_hash)
@lines << value_hash
if value_hash[:compound]
value_hash.each do |key, value|
if value_hash[:compound].include?(key)
@attributes[key] = [] if @attributes[key].nil?
@attributes[key] = [@attributes[key]] unless @attributes[key].is_a?(Arra... | ruby | def add_line_hash(value_hash)
@lines << value_hash
if value_hash[:compound]
value_hash.each do |key, value|
if value_hash[:compound].include?(key)
@attributes[key] = [] if @attributes[key].nil?
@attributes[key] = [@attributes[key]] unless @attributes[key].is_a?(Arra... | [
"def",
"add_line_hash",
"(",
"value_hash",
")",
"@lines",
"<<",
"value_hash",
"if",
"value_hash",
"[",
":compound",
"]",
"value_hash",
".",
"each",
"do",
"|",
"key",
",",
"value",
"|",
"if",
"value_hash",
"[",
":compound",
"]",
".",
"include?",
"(",
"key",... | Adds another line to the request using a plain hash.
The line should be provides as a hash of the fields parsed from the line. | [
"Adds",
"another",
"line",
"to",
"the",
"request",
"using",
"a",
"plain",
"hash",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/request.rb#L145-L160 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/request.rb | RequestLogAnalyzer.Request.has_line_type? | def has_line_type?(line_type)
return true if @lines.length == 1 && @lines[0][:line_type] == line_type.to_sym
@lines.find { |l| l[:line_type] == line_type.to_sym }
end | ruby | def has_line_type?(line_type)
return true if @lines.length == 1 && @lines[0][:line_type] == line_type.to_sym
@lines.find { |l| l[:line_type] == line_type.to_sym }
end | [
"def",
"has_line_type?",
"(",
"line_type",
")",
"return",
"true",
"if",
"@lines",
".",
"length",
"==",
"1",
"&&",
"@lines",
"[",
"0",
"]",
"[",
":line_type",
"]",
"==",
"line_type",
".",
"to_sym",
"@lines",
".",
"find",
"{",
"|",
"l",
"|",
"l",
"[",
... | Checks whether the given line type was parsed from the log file for this request | [
"Checks",
"whether",
"the",
"given",
"line",
"type",
"was",
"parsed",
"from",
"the",
"log",
"file",
"for",
"this",
"request"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/request.rb#L169-L172 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/request.rb | RequestLogAnalyzer.Request.every | def every(field)
@lines.reduce([]) { |result, fields| result << fields[field] if fields.key?(field); result }
end | ruby | def every(field)
@lines.reduce([]) { |result, fields| result << fields[field] if fields.key?(field); result }
end | [
"def",
"every",
"(",
"field",
")",
"@lines",
".",
"reduce",
"(",
"[",
"]",
")",
"{",
"|",
"result",
",",
"fields",
"|",
"result",
"<<",
"fields",
"[",
"field",
"]",
"if",
"fields",
".",
"key?",
"(",
"field",
")",
";",
"result",
"}",
"end"
] | Returns an array of all the "field" values that were captured for this request | [
"Returns",
"an",
"array",
"of",
"all",
"the",
"field",
"values",
"that",
"were",
"captured",
"for",
"this",
"request"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/request.rb#L186-L188 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/request.rb | RequestLogAnalyzer.Request.completed? | def completed?
header_found, footer_found = false, false
@lines.each do |line|
line_def = file_format.line_definitions[line[:line_type]]
header_found = true if line_def.header
footer_found = true if line_def.footer
end
header_found && footer_found
end | ruby | def completed?
header_found, footer_found = false, false
@lines.each do |line|
line_def = file_format.line_definitions[line[:line_type]]
header_found = true if line_def.header
footer_found = true if line_def.footer
end
header_found && footer_found
end | [
"def",
"completed?",
"header_found",
",",
"footer_found",
"=",
"false",
",",
"false",
"@lines",
".",
"each",
"do",
"|",
"line",
"|",
"line_def",
"=",
"file_format",
".",
"line_definitions",
"[",
"line",
"[",
":line_type",
"]",
"]",
"header_found",
"=",
"true... | Checks whether this request is completed. A completed request contains both a parsed header
line and a parsed footer line. Not that calling this function in single line mode will always
return false. | [
"Checks",
"whether",
"this",
"request",
"is",
"completed",
".",
"A",
"completed",
"request",
"contains",
"both",
"a",
"parsed",
"header",
"line",
"and",
"a",
"parsed",
"footer",
"line",
".",
"Not",
"that",
"calling",
"this",
"function",
"in",
"single",
"line... | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/request.rb#L199-L207 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/traffic.rb | RequestLogAnalyzer::Tracker.Traffic.prepare | def prepare
options[:value] = options[:traffic] if options[:traffic]
options[:total] = true
super
@number_of_buckets = options[:number_of_buckets] || 1000
@min_bucket_value = options[:min_bucket_value] ? options[:min_bucket_value].to_f : 1
@max_bucket_value = options[:max_bucket_v... | ruby | def prepare
options[:value] = options[:traffic] if options[:traffic]
options[:total] = true
super
@number_of_buckets = options[:number_of_buckets] || 1000
@min_bucket_value = options[:min_bucket_value] ? options[:min_bucket_value].to_f : 1
@max_bucket_value = options[:max_bucket_v... | [
"def",
"prepare",
"options",
"[",
":value",
"]",
"=",
"options",
"[",
":traffic",
"]",
"if",
"options",
"[",
":traffic",
"]",
"options",
"[",
":total",
"]",
"=",
"true",
"super",
"@number_of_buckets",
"=",
"options",
"[",
":number_of_buckets",
"]",
"||",
"... | Check if duration and catagory option have been received, | [
"Check",
"if",
"duration",
"and",
"catagory",
"option",
"have",
"been",
"received"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/traffic.rb#L13-L24 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/filter/field.rb | RequestLogAnalyzer::Filter.Field.filter | def filter(request)
found_field = request.every(@field).any? { |value| @value === value.to_s }
return nil if !found_field && @mode == :select
return nil if found_field && @mode == :reject
request
end | ruby | def filter(request)
found_field = request.every(@field).any? { |value| @value === value.to_s }
return nil if !found_field && @mode == :select
return nil if found_field && @mode == :reject
request
end | [
"def",
"filter",
"(",
"request",
")",
"found_field",
"=",
"request",
".",
"every",
"(",
"@field",
")",
".",
"any?",
"{",
"|",
"value",
"|",
"@value",
"===",
"value",
".",
"to_s",
"}",
"return",
"nil",
"if",
"!",
"found_field",
"&&",
"@mode",
"==",
":... | Keep request if @mode == :select and request has the field and value.
Drop request if @mode == :reject and request has the field and value.
Returns nil otherwise.
<tt>request</tt> Request Object | [
"Keep",
"request",
"if"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/filter/field.rb#L32-L37 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/output/html.rb | RequestLogAnalyzer::Output.HTML.header | def header
@io.content_type = content_type if @io.respond_to?(:content_type)
@io << '<html>'
@io << tag(:head) do |headers|
headers << tag(:title, 'Request-log-analyzer report')
headers << tag(:style, '
body {
font: normal 11px auto "Trebuchet MS", Verdana, Arial, Hel... | ruby | def header
@io.content_type = content_type if @io.respond_to?(:content_type)
@io << '<html>'
@io << tag(:head) do |headers|
headers << tag(:title, 'Request-log-analyzer report')
headers << tag(:style, '
body {
font: normal 11px auto "Trebuchet MS", Verdana, Arial, Hel... | [
"def",
"header",
"@io",
".",
"content_type",
"=",
"content_type",
"if",
"@io",
".",
"respond_to?",
"(",
":content_type",
")",
"@io",
"<<",
"'<html>'",
"@io",
"<<",
"tag",
"(",
":head",
")",
"do",
"|",
"headers",
"|",
"headers",
"<<",
"tag",
"(",
":title"... | Genrate HTML header and associated stylesheet | [
"Genrate",
"HTML",
"header",
"and",
"associated",
"stylesheet"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/output/html.rb#L76-L147 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/controller.rb | RequestLogAnalyzer.Controller.handle_source_change | def handle_source_change(change, filename)
@aggregators.each { |agg| agg.source_change(change, File.expand_path(filename, Dir.pwd)) }
end | ruby | def handle_source_change(change, filename)
@aggregators.each { |agg| agg.source_change(change, File.expand_path(filename, Dir.pwd)) }
end | [
"def",
"handle_source_change",
"(",
"change",
",",
"filename",
")",
"@aggregators",
".",
"each",
"{",
"|",
"agg",
"|",
"agg",
".",
"source_change",
"(",
"change",
",",
"File",
".",
"expand_path",
"(",
"filename",
",",
"Dir",
".",
"pwd",
")",
")",
"}",
... | Source change handler | [
"Source",
"change",
"handler"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/controller.rb#L282-L284 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/controller.rb | RequestLogAnalyzer.Controller.add_filter | def add_filter(filter, filter_options = {})
filter = RequestLogAnalyzer::Filter.const_get(RequestLogAnalyzer.to_camelcase(filter)) if filter.is_a?(Symbol)
@filters << filter.new(source.file_format, @options.merge(filter_options))
end | ruby | def add_filter(filter, filter_options = {})
filter = RequestLogAnalyzer::Filter.const_get(RequestLogAnalyzer.to_camelcase(filter)) if filter.is_a?(Symbol)
@filters << filter.new(source.file_format, @options.merge(filter_options))
end | [
"def",
"add_filter",
"(",
"filter",
",",
"filter_options",
"=",
"{",
"}",
")",
"filter",
"=",
"RequestLogAnalyzer",
"::",
"Filter",
".",
"const_get",
"(",
"RequestLogAnalyzer",
".",
"to_camelcase",
"(",
"filter",
")",
")",
"if",
"filter",
".",
"is_a?",
"(",
... | Adds a request filter to the controller. | [
"Adds",
"a",
"request",
"filter",
"to",
"the",
"controller",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/controller.rb#L296-L299 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/controller.rb | RequestLogAnalyzer.Controller.filter_request | def filter_request(request)
@filters.each do |filter|
request = filter.filter(request)
return nil if request.nil?
end
request
end | ruby | def filter_request(request)
@filters.each do |filter|
request = filter.filter(request)
return nil if request.nil?
end
request
end | [
"def",
"filter_request",
"(",
"request",
")",
"@filters",
".",
"each",
"do",
"|",
"filter",
"|",
"request",
"=",
"filter",
".",
"filter",
"(",
"request",
")",
"return",
"nil",
"if",
"request",
".",
"nil?",
"end",
"request",
"end"
] | Push a request through the entire filterchain (@filters).
<tt>request</tt> The request to filter.
Returns the filtered request or nil. | [
"Push",
"a",
"request",
"through",
"the",
"entire",
"filterchain",
"("
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/controller.rb#L304-L310 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/controller.rb | RequestLogAnalyzer.Controller.aggregate_request | def aggregate_request(request)
return false unless request
@aggregators.each { |agg| agg.aggregate(request) }
true
end | ruby | def aggregate_request(request)
return false unless request
@aggregators.each { |agg| agg.aggregate(request) }
true
end | [
"def",
"aggregate_request",
"(",
"request",
")",
"return",
"false",
"unless",
"request",
"@aggregators",
".",
"each",
"{",
"|",
"agg",
"|",
"agg",
".",
"aggregate",
"(",
"request",
")",
"}",
"true",
"end"
] | Push a request to all the aggregators (@aggregators).
<tt>request</tt> The request to push to the aggregators. | [
"Push",
"a",
"request",
"to",
"all",
"the",
"aggregators",
"("
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/controller.rb#L314-L318 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/controller.rb | RequestLogAnalyzer.Controller.run! | def run!
# @aggregators.each{|agg| p agg}
@aggregators.each { |agg| agg.prepare }
install_signal_handlers
@source.each_request do |request|
break if @interrupted
aggregate_request(filter_request(request))
end
@aggregators.each { |agg| agg.finalize }
@output.... | ruby | def run!
# @aggregators.each{|agg| p agg}
@aggregators.each { |agg| agg.prepare }
install_signal_handlers
@source.each_request do |request|
break if @interrupted
aggregate_request(filter_request(request))
end
@aggregators.each { |agg| agg.finalize }
@output.... | [
"def",
"run!",
"# @aggregators.each{|agg| p agg}",
"@aggregators",
".",
"each",
"{",
"|",
"agg",
"|",
"agg",
".",
"prepare",
"}",
"install_signal_handlers",
"@source",
".",
"each_request",
"do",
"|",
"request",
"|",
"break",
"if",
"@interrupted",
"aggregate_request"... | Runs RequestLogAnalyzer
1. Call prepare on every aggregator
2. Generate requests from source object
3. Filter out unwanted requests
4. Call aggregate for remaning requests on every aggregator
4. Call finalize on every aggregator
5. Call report on every aggregator
6. Finalize Source | [
"Runs",
"RequestLogAnalyzer",
"1",
".",
"Call",
"prepare",
"on",
"every",
"aggregator",
"2",
".",
"Generate",
"requests",
"from",
"source",
"object",
"3",
".",
"Filter",
"out",
"unwanted",
"requests",
"4",
".",
"Call",
"aggregate",
"for",
"remaning",
"requests... | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/controller.rb#L328-L359 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/duration.rb | RequestLogAnalyzer::Tracker.Duration.display_value | def display_value(time)
case time
when nil then '-'
when 0...1 then '%0ims' % (time * 1000)
when 1...60 then '%0.02fs' % time
when 60...3600 then '%dm%02ds' % [time / 60, (time % 60).round]
else '%dh%02dm%02ds' % [time / 3600, (time % 3600) / 60, (time % 6... | ruby | def display_value(time)
case time
when nil then '-'
when 0...1 then '%0ims' % (time * 1000)
when 1...60 then '%0.02fs' % time
when 60...3600 then '%dm%02ds' % [time / 60, (time % 60).round]
else '%dh%02dm%02ds' % [time / 3600, (time % 3600) / 60, (time % 6... | [
"def",
"display_value",
"(",
"time",
")",
"case",
"time",
"when",
"nil",
"then",
"'-'",
"when",
"0",
"...",
"1",
"then",
"'%0ims'",
"%",
"(",
"time",
"*",
"1000",
")",
"when",
"1",
"...",
"60",
"then",
"'%0.02fs'",
"%",
"time",
"when",
"60",
"...",
... | Display a duration | [
"Display",
"a",
"duration"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/duration.rb#L36-L44 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/aggregator/database_inserter.rb | RequestLogAnalyzer::Aggregator.DatabaseInserter.prepare | def prepare
require 'request_log_analyzer/database'
@sources = {}
@database = RequestLogAnalyzer::Database.new(options[:database])
@database.file_format = source.file_format
database.drop_database_schema! if options[:reset_database]
database.create_database_schema!
end | ruby | def prepare
require 'request_log_analyzer/database'
@sources = {}
@database = RequestLogAnalyzer::Database.new(options[:database])
@database.file_format = source.file_format
database.drop_database_schema! if options[:reset_database]
database.create_database_schema!
end | [
"def",
"prepare",
"require",
"'request_log_analyzer/database'",
"@sources",
"=",
"{",
"}",
"@database",
"=",
"RequestLogAnalyzer",
"::",
"Database",
".",
"new",
"(",
"options",
"[",
":database",
"]",
")",
"@database",
".",
"file_format",
"=",
"source",
".",
"fil... | Establishes a connection to the database and creates the necessary database schema for the
current file format | [
"Establishes",
"a",
"connection",
"to",
"the",
"database",
"and",
"creates",
"the",
"necessary",
"database",
"schema",
"for",
"the",
"current",
"file",
"format"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/aggregator/database_inserter.rb#L18-L27 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/aggregator/database_inserter.rb | RequestLogAnalyzer::Aggregator.DatabaseInserter.aggregate | def aggregate(request)
@request_object = RequestLogAnalyzer::Database::Request.new(first_lineno: request.first_lineno, last_lineno: request.last_lineno)
request.lines.each do |line|
class_columns = database.get_class(line[:line_type]).column_names.reject { |column| %w(id source_id request_id).includ... | ruby | def aggregate(request)
@request_object = RequestLogAnalyzer::Database::Request.new(first_lineno: request.first_lineno, last_lineno: request.last_lineno)
request.lines.each do |line|
class_columns = database.get_class(line[:line_type]).column_names.reject { |column| %w(id source_id request_id).includ... | [
"def",
"aggregate",
"(",
"request",
")",
"@request_object",
"=",
"RequestLogAnalyzer",
"::",
"Database",
"::",
"Request",
".",
"new",
"(",
"first_lineno",
":",
"request",
".",
"first_lineno",
",",
"last_lineno",
":",
"request",
".",
"last_lineno",
")",
"request"... | Aggregates a request into the database
This will create a record in the requests table and create a record for every line that has been parsed,
in which the captured values will be stored. | [
"Aggregates",
"a",
"request",
"into",
"the",
"database",
"This",
"will",
"create",
"a",
"record",
"in",
"the",
"requests",
"table",
"and",
"create",
"a",
"record",
"for",
"every",
"line",
"that",
"has",
"been",
"parsed",
"in",
"which",
"the",
"captured",
"... | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/aggregator/database_inserter.rb#L32-L48 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/aggregator/database_inserter.rb | RequestLogAnalyzer::Aggregator.DatabaseInserter.warning | def warning(type, message, lineno)
RequestLogAnalyzer::Database::Warning.create!(warning_type: type.to_s, message: message, lineno: lineno)
end | ruby | def warning(type, message, lineno)
RequestLogAnalyzer::Database::Warning.create!(warning_type: type.to_s, message: message, lineno: lineno)
end | [
"def",
"warning",
"(",
"type",
",",
"message",
",",
"lineno",
")",
"RequestLogAnalyzer",
"::",
"Database",
"::",
"Warning",
".",
"create!",
"(",
"warning_type",
":",
"type",
".",
"to_s",
",",
"message",
":",
"message",
",",
"lineno",
":",
"lineno",
")",
... | Records w warining in the warnings table. | [
"Records",
"w",
"warining",
"in",
"the",
"warnings",
"table",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/aggregator/database_inserter.rb#L58-L60 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/aggregator/database_inserter.rb | RequestLogAnalyzer::Aggregator.DatabaseInserter.source_change | def source_change(change, filename)
if File.exist?(filename)
case change
when :started
@sources[filename] = RequestLogAnalyzer::Database::Source.create!(filename: filename)
when :finished
@sources[filename].update_attributes!(filesize: File.size(filename), mtime: File.m... | ruby | def source_change(change, filename)
if File.exist?(filename)
case change
when :started
@sources[filename] = RequestLogAnalyzer::Database::Source.create!(filename: filename)
when :finished
@sources[filename].update_attributes!(filesize: File.size(filename), mtime: File.m... | [
"def",
"source_change",
"(",
"change",
",",
"filename",
")",
"if",
"File",
".",
"exist?",
"(",
"filename",
")",
"case",
"change",
"when",
":started",
"@sources",
"[",
"filename",
"]",
"=",
"RequestLogAnalyzer",
"::",
"Database",
"::",
"Source",
".",
"create!... | Records source changes in the sources table | [
"Records",
"source",
"changes",
"in",
"the",
"sources",
"table"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/aggregator/database_inserter.rb#L63-L72 | train |
wvanbergen/request-log-analyzer | lib/request_log_analyzer/aggregator/database_inserter.rb | RequestLogAnalyzer::Aggregator.DatabaseInserter.report | def report(output)
output.title('Request database created')
output << "A database file has been created with all parsed request information.\n"
output << "#{@request_count} requests have been added to the database.\n"
output << "\n"
output << "To open a Ruby console to inspect the data... | ruby | def report(output)
output.title('Request database created')
output << "A database file has been created with all parsed request information.\n"
output << "#{@request_count} requests have been added to the database.\n"
output << "\n"
output << "To open a Ruby console to inspect the data... | [
"def",
"report",
"(",
"output",
")",
"output",
".",
"title",
"(",
"'Request database created'",
")",
"output",
"<<",
"\"A database file has been created with all parsed request information.\\n\"",
"output",
"<<",
"\"#{@request_count} requests have been added to the database.\\n\"",
... | Prints a short report of what has been inserted into the database | [
"Prints",
"a",
"short",
"report",
"of",
"what",
"has",
"been",
"inserted",
"into",
"the",
"database"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/aggregator/database_inserter.rb#L75-L84 | train |
activescaffold/active_scaffold | lib/active_scaffold/data_structures/set.rb | ActiveScaffold::DataStructures.Set.add | def add(*args)
args.flatten! # allow [] as a param
args.each do |arg|
arg = arg.to_sym if arg.is_a? String
@set << arg unless @set.include? arg # avoid duplicates
end
end | ruby | def add(*args)
args.flatten! # allow [] as a param
args.each do |arg|
arg = arg.to_sym if arg.is_a? String
@set << arg unless @set.include? arg # avoid duplicates
end
end | [
"def",
"add",
"(",
"*",
"args",
")",
"args",
".",
"flatten!",
"# allow [] as a param",
"args",
".",
"each",
"do",
"|",
"arg",
"|",
"arg",
"=",
"arg",
".",
"to_sym",
"if",
"arg",
".",
"is_a?",
"String",
"@set",
"<<",
"arg",
"unless",
"@set",
".",
"inc... | the way to add items to the set. | [
"the",
"way",
"to",
"add",
"items",
"to",
"the",
"set",
"."
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/data_structures/set.rb#L20-L26 | train |
activescaffold/active_scaffold | lib/active_scaffold/data_structures/set.rb | ActiveScaffold::DataStructures.Set.exclude | def exclude(*args)
args.flatten! # allow [] as a param
args.collect!(&:to_sym) # symbolize the args
# check respond_to? :to_sym, ActionColumns doesn't respond to to_sym
@set.reject! { |c| c.respond_to?(:to_sym) && args.include?(c.to_sym) } # reject all items specified
end | ruby | def exclude(*args)
args.flatten! # allow [] as a param
args.collect!(&:to_sym) # symbolize the args
# check respond_to? :to_sym, ActionColumns doesn't respond to to_sym
@set.reject! { |c| c.respond_to?(:to_sym) && args.include?(c.to_sym) } # reject all items specified
end | [
"def",
"exclude",
"(",
"*",
"args",
")",
"args",
".",
"flatten!",
"# allow [] as a param",
"args",
".",
"collect!",
"(",
":to_sym",
")",
"# symbolize the args",
"# check respond_to? :to_sym, ActionColumns doesn't respond to to_sym",
"@set",
".",
"reject!",
"{",
"|",
"c"... | the way to remove items from the set. | [
"the",
"way",
"to",
"remove",
"items",
"from",
"the",
"set",
"."
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/data_structures/set.rb#L30-L35 | train |
activescaffold/active_scaffold | lib/active_scaffold/attribute_params.rb | ActiveScaffold.AttributeParams.attributes_hash_is_empty? | def attributes_hash_is_empty?(hash, klass)
hash.all? do |key, value|
# convert any possible multi-parameter attributes like 'created_at(5i)' to simply 'created_at'
column_name = key.to_s.split('(', 2)[0]
# datetimes will always have a value. so we ignore them when checking whether the has... | ruby | def attributes_hash_is_empty?(hash, klass)
hash.all? do |key, value|
# convert any possible multi-parameter attributes like 'created_at(5i)' to simply 'created_at'
column_name = key.to_s.split('(', 2)[0]
# datetimes will always have a value. so we ignore them when checking whether the has... | [
"def",
"attributes_hash_is_empty?",
"(",
"hash",
",",
"klass",
")",
"hash",
".",
"all?",
"do",
"|",
"key",
",",
"value",
"|",
"# convert any possible multi-parameter attributes like 'created_at(5i)' to simply 'created_at'",
"column_name",
"=",
"key",
".",
"to_s",
".",
"... | Determines whether the given attributes hash is "empty".
This isn't a literal emptiness - it's an attempt to discern whether the user intended it to be empty or not. | [
"Determines",
"whether",
"the",
"given",
"attributes",
"hash",
"is",
"empty",
".",
"This",
"isn",
"t",
"a",
"literal",
"emptiness",
"-",
"it",
"s",
"an",
"attempt",
"to",
"discern",
"whether",
"the",
"user",
"intended",
"it",
"to",
"be",
"empty",
"or",
"... | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/attribute_params.rb#L294-L315 | train |
activescaffold/active_scaffold | lib/active_scaffold/actions/nested.rb | ActiveScaffold::Actions::Nested.ChildMethods.do_add_existing | def do_add_existing
parent_record = nested_parent_record(:update)
@record = active_scaffold_config.model.find(params[:associated_id])
if parent_record && @record
parent_record.send(nested.association.name) << @record
parent_record.save
else
false
end
end | ruby | def do_add_existing
parent_record = nested_parent_record(:update)
@record = active_scaffold_config.model.find(params[:associated_id])
if parent_record && @record
parent_record.send(nested.association.name) << @record
parent_record.save
else
false
end
end | [
"def",
"do_add_existing",
"parent_record",
"=",
"nested_parent_record",
"(",
":update",
")",
"@record",
"=",
"active_scaffold_config",
".",
"model",
".",
"find",
"(",
"params",
"[",
":associated_id",
"]",
")",
"if",
"parent_record",
"&&",
"@record",
"parent_record",... | The actual "add_existing" algorithm | [
"The",
"actual",
"add_existing",
"algorithm"
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/actions/nested.rb#L238-L247 | train |
activescaffold/active_scaffold | lib/active_scaffold/extensions/action_view_rendering.rb | ActiveScaffold.RenderingHelper.render | def render(*args, &block)
if args.first.is_a?(Hash) && args.first[:active_scaffold]
render_embedded args.first
elsif args.first == :super
@_view_paths ||= lookup_context.view_paths.clone
@_last_template ||= lookup_context.last_template
parts = @virtual_path.split('/')
... | ruby | def render(*args, &block)
if args.first.is_a?(Hash) && args.first[:active_scaffold]
render_embedded args.first
elsif args.first == :super
@_view_paths ||= lookup_context.view_paths.clone
@_last_template ||= lookup_context.last_template
parts = @virtual_path.split('/')
... | [
"def",
"render",
"(",
"*",
"args",
",",
"&",
"block",
")",
"if",
"args",
".",
"first",
".",
"is_a?",
"(",
"Hash",
")",
"&&",
"args",
".",
"first",
"[",
":active_scaffold",
"]",
"render_embedded",
"args",
".",
"first",
"elsif",
"args",
".",
"first",
"... | Adds two rendering options.
==render :super
This syntax skips all template overrides and goes directly to the provided ActiveScaffold templates.
Useful if you want to wrap an existing template. Just call super!
==render :active_scaffold => #{controller.to_s}, options = {}+
Lets you embed an ActiveScaffold by r... | [
"Adds",
"two",
"rendering",
"options",
"."
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/extensions/action_view_rendering.rb#L38-L82 | train |
activescaffold/active_scaffold | lib/active_scaffold/data_structures/action_link.rb | ActiveScaffold::DataStructures.ActionLink.initialize_copy | def initialize_copy(action_link)
self.parameters = parameters.clone if action_link.instance_variable_get(:@parameters)
self.html_options = html_options.clone if action_link.instance_variable_get(:@html_options)
end | ruby | def initialize_copy(action_link)
self.parameters = parameters.clone if action_link.instance_variable_get(:@parameters)
self.html_options = html_options.clone if action_link.instance_variable_get(:@html_options)
end | [
"def",
"initialize_copy",
"(",
"action_link",
")",
"self",
".",
"parameters",
"=",
"parameters",
".",
"clone",
"if",
"action_link",
".",
"instance_variable_get",
"(",
":@parameters",
")",
"self",
".",
"html_options",
"=",
"html_options",
".",
"clone",
"if",
"act... | provides a quick way to set any property of the object from a hash | [
"provides",
"a",
"quick",
"way",
"to",
"set",
"any",
"property",
"of",
"the",
"object",
"from",
"a",
"hash"
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/data_structures/action_link.rb#L31-L34 | train |
activescaffold/active_scaffold | lib/active_scaffold/config/nested.rb | ActiveScaffold::Config.Nested.add_link | def add_link(attribute, options = {})
column = @core.columns[attribute.to_sym]
raise ArgumentError, "unknown column #{attribute}" if column.nil?
raise ArgumentError, "column #{attribute} is not an association" if column.association.nil?
label =
if column.association.polymorphic?
... | ruby | def add_link(attribute, options = {})
column = @core.columns[attribute.to_sym]
raise ArgumentError, "unknown column #{attribute}" if column.nil?
raise ArgumentError, "column #{attribute} is not an association" if column.association.nil?
label =
if column.association.polymorphic?
... | [
"def",
"add_link",
"(",
"attribute",
",",
"options",
"=",
"{",
"}",
")",
"column",
"=",
"@core",
".",
"columns",
"[",
"attribute",
".",
"to_sym",
"]",
"raise",
"ArgumentError",
",",
"\"unknown column #{attribute}\"",
"if",
"column",
".",
"nil?",
"raise",
"Ar... | Add a nested ActionLink | [
"Add",
"a",
"nested",
"ActionLink"
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/config/nested.rb#L26-L42 | train |
activescaffold/active_scaffold | lib/active_scaffold/actions/create.rb | ActiveScaffold::Actions.Create.do_create | def do_create(options = {})
attributes = options[:attributes] || params[:record]
active_scaffold_config.model.transaction do
@record = update_record_from_params(new_model, active_scaffold_config.create.columns, attributes)
apply_constraints_to_record(@record, :allow_autosave => true)
... | ruby | def do_create(options = {})
attributes = options[:attributes] || params[:record]
active_scaffold_config.model.transaction do
@record = update_record_from_params(new_model, active_scaffold_config.create.columns, attributes)
apply_constraints_to_record(@record, :allow_autosave => true)
... | [
"def",
"do_create",
"(",
"options",
"=",
"{",
"}",
")",
"attributes",
"=",
"options",
"[",
":attributes",
"]",
"||",
"params",
"[",
":record",
"]",
"active_scaffold_config",
".",
"model",
".",
"transaction",
"do",
"@record",
"=",
"update_record_from_params",
"... | A somewhat complex method to actually create a new record. The complexity is from support for subforms and associated records.
If you want to customize this behavior, consider using the +before_create_save+ and +after_create_save+ callbacks. | [
"A",
"somewhat",
"complex",
"method",
"to",
"actually",
"create",
"a",
"new",
"record",
".",
"The",
"complexity",
"is",
"from",
"support",
"for",
"subforms",
"and",
"associated",
"records",
".",
"If",
"you",
"want",
"to",
"customize",
"this",
"behavior",
"co... | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/actions/create.rb#L93-L108 | train |
activescaffold/active_scaffold | lib/active_scaffold/config/core.rb | ActiveScaffold::Config.Core._configure_sti | def _configure_sti
column = model.inheritance_column
if sti_create_links
columns[column].form_ui ||= :hidden
else
columns[column].form_ui ||= :select
columns[column].options ||= {}
columns[column].options[:options] = sti_children.collect do |model_name|
[model... | ruby | def _configure_sti
column = model.inheritance_column
if sti_create_links
columns[column].form_ui ||= :hidden
else
columns[column].form_ui ||= :select
columns[column].options ||= {}
columns[column].options[:options] = sti_children.collect do |model_name|
[model... | [
"def",
"_configure_sti",
"column",
"=",
"model",
".",
"inheritance_column",
"if",
"sti_create_links",
"columns",
"[",
"column",
"]",
".",
"form_ui",
"||=",
":hidden",
"else",
"columns",
"[",
"column",
"]",
".",
"form_ui",
"||=",
":select",
"columns",
"[",
"col... | To be called after your finished configuration | [
"To",
"be",
"called",
"after",
"your",
"finished",
"configuration"
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/config/core.rb#L208-L219 | train |
activescaffold/active_scaffold | lib/active_scaffold/data_structures/sorting.rb | ActiveScaffold::DataStructures.Sorting.add | def add(column_name, direction = nil)
direction ||= 'ASC'
direction = direction.to_s.upcase
column = get_column(column_name)
raise ArgumentError, "Could not find column #{column_name}" if column.nil?
raise ArgumentError, 'Sorting direction unknown' unless %i[ASC DESC].include? direction.to... | ruby | def add(column_name, direction = nil)
direction ||= 'ASC'
direction = direction.to_s.upcase
column = get_column(column_name)
raise ArgumentError, "Could not find column #{column_name}" if column.nil?
raise ArgumentError, 'Sorting direction unknown' unless %i[ASC DESC].include? direction.to... | [
"def",
"add",
"(",
"column_name",
",",
"direction",
"=",
"nil",
")",
"direction",
"||=",
"'ASC'",
"direction",
"=",
"direction",
".",
"to_s",
".",
"upcase",
"column",
"=",
"get_column",
"(",
"column_name",
")",
"raise",
"ArgumentError",
",",
"\"Could not find ... | add a clause to the sorting, assuming the column is sortable | [
"add",
"a",
"clause",
"to",
"the",
"sorting",
"assuming",
"the",
"column",
"is",
"sortable"
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/data_structures/sorting.rb#L37-L45 | train |
Subsets and Splits
SQL Console for semeru/code-text-ruby
Retrieves 20,000 non-null code samples labeled as Ruby, providing a basic overview of the dataset but without deeper analysis.