Class: Openlayer::Resources::Governance::RuleStats

Inherits:
Object
  • Object
show all
Defined in:
lib/openlayer/resources/governance/rule_stats.rb,
sig/openlayer/resources/governance/rule_stats.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ RuleStats

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of RuleStats.

Parameters:



41
42
43
# File 'lib/openlayer/resources/governance/rule_stats.rb', line 41

def initialize(client:)
  @client = client
end

Instance Method Details

#retrieve(workspace_id, framework_id: nil, project_id: nil, request_options: {}) ⇒ Openlayer::Models::Governance::RuleStatRetrieveResponse

Get a compliance roll-up for a workspace: how many rules exist, and how many of their results are passing, failing, pending, or due for renewal.

Counts respect the filters you pass, so frameworkId gives you a single framework's overall compliance and projectId gives you a single project's.

Parameters:

  • workspace_id (String) —

    The workspace id.

  • framework_id (String) —

    Only include items belonging to this framework.

  • project_id (String) —

    Only include items that apply to this project.

  • request_options (Openlayer::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/openlayer/resources/governance/rule_stats.rb', line 26

def retrieve(workspace_id, params = {})
  parsed, options = Openlayer::Governance::RuleStatRetrieveParams.dump_request(params)
  query = Openlayer::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["workspaces/%1$s/rule-stats", workspace_id],
    query: query.transform_keys(framework_id: "frameworkId", project_id: "projectId"),
    model: Openlayer::Models::Governance::RuleStatRetrieveResponse,
    options: options
  )
end