Class: Openlayer::Resources::Governance::Frameworks
- Inherits:
-
Object
- Object
- Openlayer::Resources::Governance::Frameworks
- Defined in:
- lib/openlayer/resources/governance/frameworks.rb,
lib/openlayer/resources/governance/frameworks/sections.rb,
lib/openlayer/resources/governance/frameworks/documents.rb,
lib/openlayer/resources/governance/frameworks/subsections.rb,
sig/openlayer/resources/governance/frameworks.rbs,
sig/openlayer/resources/governance/frameworks/sections.rbs,
sig/openlayer/resources/governance/frameworks/documents.rbs,
sig/openlayer/resources/governance/frameworks/subsections.rbs
Defined Under Namespace
Classes: Documents, Sections, Subsections
Instance Attribute Summary collapse
- #documents ⇒ Openlayer::Resources::Governance::Frameworks::Documents readonly
- #sections ⇒ Openlayer::Resources::Governance::Frameworks::Sections readonly
- #subsections ⇒ Openlayer::Resources::Governance::Frameworks::Subsections readonly
Instance Method Summary collapse
-
#create(workspace_id, name:, description: nil, enabled: nil, project_selector: nil, tags: nil, request_options: {}) ⇒ Openlayer::Models::Governance::FrameworkCreateResponse
Some parameter documentations has been truncated, see Models::Governance::FrameworkCreateParams for more details.
-
#export(framework_id, project_id: nil, request_options: {}) ⇒ Openlayer::Models::Governance::FrameworkExportResponse
Export a framework's evidence and progress as an audit-ready zip archive.
-
#initialize(client:) ⇒ Frameworks
constructor
private
A new instance of Frameworks.
-
#list(workspace_id, asc: nil, completion_operator: nil, completion_value: nil, enabled: nil, include_rule_stats: nil, page: nil, per_page: nil, project_id: nil, search_query: nil, sort_column: nil, tags: nil, request_options: {}) ⇒ Openlayer::Models::Governance::FrameworkListResponse
Some parameter documentations has been truncated, see Models::Governance::FrameworkListParams for more details.
-
#list_project_rule_stats(framework_id, asc: nil, page: nil, per_page: nil, sort_column: nil, request_options: {}) ⇒ Openlayer::Models::Governance::FrameworkListProjectRuleStatsResponse
Get a compliance roll-up for a framework, one row per project it applies to.
-
#list_projects(framework_id, page: nil, per_page: nil, request_options: {}) ⇒ Openlayer::Models::Governance::FrameworkListProjectsResponse
List the projects a framework applies to.
-
#list_rules(framework_id, page: nil, per_page: nil, request_options: {}) ⇒ Openlayer::Models::Governance::FrameworkListRulesResponse
List the rules that belong to a framework.
-
#retrieve(framework_id, request_options: {}) ⇒ Openlayer::Models::Governance::FrameworkRetrieveResponse
Retrieve a governance framework by its id.
-
#update(framework_id, avatar: nil, description: nil, enabled: nil, extended_description: nil, href: nil, name: nil, project_selector: nil, tags: nil, request_options: {}) ⇒ Openlayer::Models::Governance::FrameworkUpdateResponse
Some parameter documentations has been truncated, see Models::Governance::FrameworkUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Frameworks
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 Frameworks.
335 336 337 338 339 340 |
# File 'lib/openlayer/resources/governance/frameworks.rb', line 335 def initialize(client:) @client = client @documents = Openlayer::Resources::Governance::Frameworks::Documents.new(client: client) @sections = Openlayer::Resources::Governance::Frameworks::Sections.new(client: client) @subsections = Openlayer::Resources::Governance::Frameworks::Subsections.new(client: client) end |
Instance Attribute Details
#documents ⇒ Openlayer::Resources::Governance::Frameworks::Documents (readonly)
8 9 10 |
# File 'lib/openlayer/resources/governance/frameworks.rb', line 8 def documents @documents end |
#sections ⇒ Openlayer::Resources::Governance::Frameworks::Sections (readonly)
11 12 13 |
# File 'lib/openlayer/resources/governance/frameworks.rb', line 11 def sections @sections end |
#subsections ⇒ Openlayer::Resources::Governance::Frameworks::Subsections (readonly)
14 15 16 |
# File 'lib/openlayer/resources/governance/frameworks.rb', line 14 def subsections @subsections end |
Instance Method Details
#create(workspace_id, name:, description: nil, enabled: nil, project_selector: nil, tags: nil, request_options: {}) ⇒ Openlayer::Models::Governance::FrameworkCreateResponse
Some parameter documentations has been truncated, see Models::Governance::FrameworkCreateParams for more details.
Create a custom governance framework in a workspace.
Use this to track compliance against an internal policy, or against a standard Openlayer does not ship as a built-in framework. A new framework starts with no rules -- add them from the Openlayer app, or map an existing rule to it.
A framework is created disabled unless you pass enabled: true. While it is
disabled its rules are not evaluated and do not count towards compliance.
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/openlayer/resources/governance/frameworks.rb', line 47 def create(workspace_id, params) parsed, = Openlayer::Governance::FrameworkCreateParams.dump_request(params) @client.request( method: :post, path: ["workspaces/%1$s/frameworks", workspace_id], body: parsed, model: Openlayer::Models::Governance::FrameworkCreateResponse, options: ) end |
#export(framework_id, project_id: nil, request_options: {}) ⇒ Openlayer::Models::Governance::FrameworkExportResponse
Export a framework's evidence and progress as an audit-ready zip archive.
The archive holds every evidence file uploaded against the framework's evidence-based rules, a markdown report of the framework's progress and the status of all its rules (broken down by documentation section when the framework has documents), and CSV manifests of rules and evidence with SHA-256 checksums.
Send projectId to export one project's compliance with the framework. Omit it
for the workspace-wide view across every project in the framework, including
workspace-scoped rules.
The export runs as a background task, so this returns 202 immediately. To
collect the archive:
- Poll
GET /background-tasks/{taskId}with the returnedtaskResultIduntilcompleteistrue. - Read
outputs.storageUrioff that task. - Exchange it for a download link at
GET /storage/presigned-url?storageUri=<uri>.
Rate limited to 2 requests per minute per framework. Asking for an export while an identical one is still queued returns that task rather than starting a second one.
225 226 227 228 229 230 231 232 233 234 |
# File 'lib/openlayer/resources/governance/frameworks.rb', line 225 def export(framework_id, params = {}) parsed, = Openlayer::Governance::FrameworkExportParams.dump_request(params) @client.request( method: :post, path: ["frameworks/%1$s/export", framework_id], body: parsed, model: Openlayer::Models::Governance::FrameworkExportResponse, options: ) end |
#list(workspace_id, asc: nil, completion_operator: nil, completion_value: nil, enabled: nil, include_rule_stats: nil, page: nil, per_page: nil, project_id: nil, search_query: nil, sort_column: nil, tags: nil, request_options: {}) ⇒ Openlayer::Models::Governance::FrameworkListResponse
Some parameter documentations has been truncated, see Models::Governance::FrameworkListParams for more details.
List the governance frameworks in a workspace.
A framework is a set of rules -- drawn from a regulation, a standard, or your own internal policy -- that Openlayer tracks compliance against. Use this endpoint to find the framework you want to report on, then read its rules and rule results.
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
# File 'lib/openlayer/resources/governance/frameworks.rb', line 170 def list(workspace_id, params = {}) parsed, = Openlayer::Governance::FrameworkListParams.dump_request(params) query = Openlayer::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["workspaces/%1$s/frameworks", workspace_id], query: query.transform_keys( completion_operator: "completionOperator", completion_value: "completionValue", include_rule_stats: "includeRuleStats", per_page: "perPage", project_id: "projectId", search_query: "searchQuery", sort_column: "sortColumn" ), model: Openlayer::Models::Governance::FrameworkListResponse, options: ) end |
#list_project_rule_stats(framework_id, asc: nil, page: nil, per_page: nil, sort_column: nil, request_options: {}) ⇒ Openlayer::Models::Governance::FrameworkListProjectRuleStatsResponse
Get a compliance roll-up for a framework, one row per project it applies to.
Each row counts the project's rule results by status, so you can report on where a framework is complete and where it is not without fetching every individual rule result.
259 260 261 262 263 264 265 266 267 268 269 |
# File 'lib/openlayer/resources/governance/frameworks.rb', line 259 def list_project_rule_stats(framework_id, params = {}) parsed, = Openlayer::Governance::FrameworkListProjectRuleStatsParams.dump_request(params) query = Openlayer::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["frameworks/%1$s/project-rule-stats", framework_id], query: query.transform_keys(per_page: "perPage", sort_column: "sortColumn"), model: Openlayer::Models::Governance::FrameworkListProjectRuleStatsResponse, options: ) end |
#list_projects(framework_id, page: nil, per_page: nil, request_options: {}) ⇒ Openlayer::Models::Governance::FrameworkListProjectsResponse
List the projects a framework applies to.
Which projects a framework covers is determined by its projectSelector. A
framework with an empty selector applies to every project in the workspace.
289 290 291 292 293 294 295 296 297 298 299 |
# File 'lib/openlayer/resources/governance/frameworks.rb', line 289 def list_projects(framework_id, params = {}) parsed, = Openlayer::Governance::FrameworkListProjectsParams.dump_request(params) query = Openlayer::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["frameworks/%1$s/projects", framework_id], query: query.transform_keys(per_page: "perPage"), model: Openlayer::Models::Governance::FrameworkListProjectsResponse, options: ) end |
#list_rules(framework_id, page: nil, per_page: nil, request_options: {}) ⇒ Openlayer::Models::Governance::FrameworkListRulesResponse
List the rules that belong to a framework.
To read the compliance status of these rules, use
List rule results with the
frameworkId filter, or fetch the results of an individual rule.
320 321 322 323 324 325 326 327 328 329 330 |
# File 'lib/openlayer/resources/governance/frameworks.rb', line 320 def list_rules(framework_id, params = {}) parsed, = Openlayer::Governance::FrameworkListRulesParams.dump_request(params) query = Openlayer::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["frameworks/%1$s/rules", framework_id], query: query.transform_keys(per_page: "perPage"), model: Openlayer::Models::Governance::FrameworkListRulesResponse, options: ) end |
#retrieve(framework_id, request_options: {}) ⇒ Openlayer::Models::Governance::FrameworkRetrieveResponse
Retrieve a governance framework by its id.
69 70 71 72 73 74 75 76 |
# File 'lib/openlayer/resources/governance/frameworks.rb', line 69 def retrieve(framework_id, params = {}) @client.request( method: :get, path: ["frameworks/%1$s", framework_id], model: Openlayer::Models::Governance::FrameworkRetrieveResponse, options: params[:request_options] ) end |
#update(framework_id, avatar: nil, description: nil, enabled: nil, extended_description: nil, href: nil, name: nil, project_selector: nil, tags: nil, request_options: {}) ⇒ Openlayer::Models::Governance::FrameworkUpdateResponse
Some parameter documentations has been truncated, see Models::Governance::FrameworkUpdateParams for more details.
Update a governance framework.
The most common use is activating or deactivating a framework for the workspace
by setting enabled. Rules of a disabled framework are not evaluated and do not
count towards compliance.
Frameworks that ship with Openlayer report immutable: true. For those, only
enabled, tags, and projectSelector can be changed -- their name and
definition are managed by Openlayer.
Only the fields you send are changed.
118 119 120 121 122 123 124 125 126 127 |
# File 'lib/openlayer/resources/governance/frameworks.rb', line 118 def update(framework_id, params = {}) parsed, = Openlayer::Governance::FrameworkUpdateParams.dump_request(params) @client.request( method: :put, path: ["frameworks/%1$s", framework_id], body: parsed, model: Openlayer::Models::Governance::FrameworkUpdateResponse, options: ) end |