Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
cloudreactor_api_client
Advanced tools
This Ruby gem consists of 2 parts:
The CloudReactor API client allows ruby applications to programmatically create, monitor, and manage Tasks and Workflows in CloudReactor. Most notably, you can start and stop Tasks and Workflows by creating Task Executions and Workflow Executions.
The Wrapper I/O module allows ruby applications to communicate with the CloudReactor process wrapper which is the parent process.
To install this gem, include:
gem 'cloudreactor_api_client'
in your Gemfile
.
See the CloudReactor landing page to see the benefits of monitoring and managing your tasks with CloudReactor.
The API client allows your program to control various entities in CloudReactor, most notably, Tasks and Workflows. The code and documentation are generated by OpenAPI generator.
To start an existing Task, create a TaskExecution linked to the Task, with a
status of CloudReactorAPIClient::TaskExecutionStatus::MANUALLY_STARTED
:
config = CloudReactorAPIClient::Configuration.new
config.access_token = 'YOUR API KEY'
api_client = CloudReactorAPIClient::ApiClient.new(config)
task = CloudReactorAPIClient::NameAndUuid.new
task.name = 'Sample Task'
task_execution = CloudReactorAPIClient::TaskExecution.new
task_execution.task = task
task_execution.status = CloudReactorAPIClient::TaskExecutionStatus::MANUALLY_STARTED
te_api = CloudReactorAPIClient::TaskExecutionsApi.new(api_client)
te_api.task_executions_create(task_execution)
While running a ruby process that is wrapped by a CloudReactor process wrapper,
you can use CloudReactorWrapperIO::StatusUpdater
to
send updates about your process to the wrapper. The wrapper will send those
updates to the CloudReactor API server during its next heartbeat.
Updates can include:
Updates are communicated via a local UDP socket which means they are theoretically unreliable. However, in practice, updates are almost always picked up correctly.
# This is necessary even in Rails, due to the module name not matching the
# package name.
require 'cloudreactor_wrapper_io'
# Use the environment variables
# PROC_WRAPPER_ENABLE_STATUS_UPDATE_LISTENER (set to TRUE or FALSE)
# PROC_WRAPPER_STATUS_UPDATE_SOCKET_PORT (set to an integer)
# to determine configuration. These environment variables are typically passed
# to the process wrapper which then passes them on to your process.
status_updater = CloudReactorWrapperIO::StatusUpdater.new()
begin
status_updater.send_update(
success_count: 1,
error_count: 2,
last_status_message: 'running'
)
ensure
status_updater.close()
end
This project is covered by the BSD 2-clause license.
FAQs
Unknown package
We found that cloudreactor_api_client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.