Class: Google::Apis::WebsecurityscannerV1::WebSecurityScannerService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
generated/google/apis/websecurityscanner_v1/service.rb

Overview

Web Security Scanner API

Scans your Compute and App Engine apps for common web vulnerabilities.

Examples:

require 'google/apis/websecurityscanner_v1'

Websecurityscanner = Google::Apis::WebsecurityscannerV1 # Alias the module
service = Websecurityscanner::WebSecurityScannerService.new

See Also:

Instance Attribute Summary collapse

Attributes inherited from Core::BaseService

#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path

Instance Method Summary collapse

Methods inherited from Core::BaseService

#batch, #batch_upload, #fetch_all, #http

Methods included from Core::Logging

#logger

Constructor Details

#initializeWebSecurityScannerService


45
46
47
48
# File 'generated/google/apis/websecurityscanner_v1/service.rb', line 45

def initialize
  super('https://websecurityscanner.googleapis.com/', '')
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString


38
39
40
# File 'generated/google/apis/websecurityscanner_v1/service.rb', line 38

def key
  @key
end

#quota_userString


43
44
45
# File 'generated/google/apis/websecurityscanner_v1/service.rb', line 43

def quota_user
  @quota_user
end

Instance Method Details

#create_project_scan_config(parent, scan_config_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebsecurityscannerV1::ScanConfig

Creates a new ScanConfig.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


73
74
75
76
77
78
79
80
81
82
83
# File 'generated/google/apis/websecurityscanner_v1/service.rb', line 73

def create_project_scan_config(parent, scan_config_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/scanConfigs', options)
  command.request_representation = Google::Apis::WebsecurityscannerV1::ScanConfig::Representation
  command.request_object = scan_config_object
  command.response_representation = Google::Apis::WebsecurityscannerV1::ScanConfig::Representation
  command.response_class = Google::Apis::WebsecurityscannerV1::ScanConfig
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_project_scan_config(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebsecurityscannerV1::Empty

Deletes an existing ScanConfig and its child resources.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


107
108
109
110
111
112
113
114
115
# File 'generated/google/apis/websecurityscanner_v1/service.rb', line 107

def delete_project_scan_config(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1/{+name}', options)
  command.response_representation = Google::Apis::WebsecurityscannerV1::Empty::Representation
  command.response_class = Google::Apis::WebsecurityscannerV1::Empty
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_scan_config(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebsecurityscannerV1::ScanConfig

Gets a ScanConfig.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


139
140
141
142
143
144
145
146
147
# File 'generated/google/apis/websecurityscanner_v1/service.rb', line 139

def get_project_scan_config(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::WebsecurityscannerV1::ScanConfig::Representation
  command.response_class = Google::Apis::WebsecurityscannerV1::ScanConfig
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_scan_config_scan_run(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebsecurityscannerV1::ScanRun

Gets a ScanRun.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


290
291
292
293
294
295
296
297
298
# File 'generated/google/apis/websecurityscanner_v1/service.rb', line 290

def get_project_scan_config_scan_run(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::WebsecurityscannerV1::ScanRun::Representation
  command.response_class = Google::Apis::WebsecurityscannerV1::ScanRun
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_scan_config_scan_run_finding(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebsecurityscannerV1::Finding

Gets a Finding.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


478
479
480
481
482
483
484
485
486
# File 'generated/google/apis/websecurityscanner_v1/service.rb', line 478

def get_project_scan_config_scan_run_finding(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::WebsecurityscannerV1::Finding::Representation
  command.response_class = Google::Apis::WebsecurityscannerV1::Finding
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_scan_config_scan_run_crawled_urls(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebsecurityscannerV1::ListCrawledUrlsResponse

List CrawledUrls under a given ScanRun.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


409
410
411
412
413
414
415
416
417
418
419
# File 'generated/google/apis/websecurityscanner_v1/service.rb', line 409

def list_project_scan_config_scan_run_crawled_urls(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/crawledUrls', options)
  command.response_representation = Google::Apis::WebsecurityscannerV1::ListCrawledUrlsResponse::Representation
  command.response_class = Google::Apis::WebsecurityscannerV1::ListCrawledUrlsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_scan_config_scan_run_finding_type_stats(parent, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebsecurityscannerV1::ListFindingTypeStatsResponse

List all FindingTypeStats under a given ScanRun.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


444
445
446
447
448
449
450
451
452
# File 'generated/google/apis/websecurityscanner_v1/service.rb', line 444

def list_project_scan_config_scan_run_finding_type_stats(parent, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/findingTypeStats', options)
  command.response_representation = Google::Apis::WebsecurityscannerV1::ListFindingTypeStatsResponse::Representation
  command.response_class = Google::Apis::WebsecurityscannerV1::ListFindingTypeStatsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_scan_config_scan_run_findings(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebsecurityscannerV1::ListFindingsResponse

List Findings under a given ScanRun.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


524
525
526
527
528
529
530
531
532
533
534
535
# File 'generated/google/apis/websecurityscanner_v1/service.rb', line 524

def list_project_scan_config_scan_run_findings(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/findings', options)
  command.response_representation = Google::Apis::WebsecurityscannerV1::ListFindingsResponse::Representation
  command.response_class = Google::Apis::WebsecurityscannerV1::ListFindingsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_scan_config_scan_runs(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebsecurityscannerV1::ListScanRunsResponse

Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


331
332
333
334
335
336
337
338
339
340
341
# File 'generated/google/apis/websecurityscanner_v1/service.rb', line 331

def list_project_scan_config_scan_runs(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/scanRuns', options)
  command.response_representation = Google::Apis::WebsecurityscannerV1::ListScanRunsResponse::Representation
  command.response_class = Google::Apis::WebsecurityscannerV1::ListScanRunsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_scan_configs(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebsecurityscannerV1::ListScanConfigsResponse

Lists ScanConfigs under a given project.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


179
180
181
182
183
184
185
186
187
188
189
# File 'generated/google/apis/websecurityscanner_v1/service.rb', line 179

def list_project_scan_configs(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/scanConfigs', options)
  command.response_representation = Google::Apis::WebsecurityscannerV1::ListScanConfigsResponse::Representation
  command.response_class = Google::Apis::WebsecurityscannerV1::ListScanConfigsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_project_scan_config(name, scan_config_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebsecurityscannerV1::ScanConfig

Updates a ScanConfig. This method support partial update of a ScanConfig.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


220
221
222
223
224
225
226
227
228
229
230
231
# File 'generated/google/apis/websecurityscanner_v1/service.rb', line 220

def patch_project_scan_config(name, scan_config_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v1/{+name}', options)
  command.request_representation = Google::Apis::WebsecurityscannerV1::ScanConfig::Representation
  command.request_object = scan_config_object
  command.response_representation = Google::Apis::WebsecurityscannerV1::ScanConfig::Representation
  command.response_class = Google::Apis::WebsecurityscannerV1::ScanConfig
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#start_scan_config_scan_run(name, start_scan_run_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebsecurityscannerV1::ScanRun

Start a ScanRun according to the given ScanConfig.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


255
256
257
258
259
260
261
262
263
264
265
# File 'generated/google/apis/websecurityscanner_v1/service.rb', line 255

def start_scan_config_scan_run(name, start_scan_run_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}:start', options)
  command.request_representation = Google::Apis::WebsecurityscannerV1::StartScanRunRequest::Representation
  command.request_object = start_scan_run_request_object
  command.response_representation = Google::Apis::WebsecurityscannerV1::ScanRun::Representation
  command.response_class = Google::Apis::WebsecurityscannerV1::ScanRun
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#stop_scan_run(name, stop_scan_run_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebsecurityscannerV1::ScanRun

Stops a ScanRun. The stopped ScanRun is returned.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


366
367
368
369
370
371
372
373
374
375
376
# File 'generated/google/apis/websecurityscanner_v1/service.rb', line 366

def stop_scan_run(name, stop_scan_run_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}:stop', options)
  command.request_representation = Google::Apis::WebsecurityscannerV1::StopScanRunRequest::Representation
  command.request_object = stop_scan_run_request_object
  command.response_representation = Google::Apis::WebsecurityscannerV1::ScanRun::Representation
  command.response_class = Google::Apis::WebsecurityscannerV1::ScanRun
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end