Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CSM Agents Read Endpoint #421

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-12-10 21:05:04.906060",
"spec_repo_commit": "1c4c91d4"
"regenerated": "2024-12-11 09:50:49.622090",
"spec_repo_commit": "d3653154"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-12-10 21:05:04.924927",
"spec_repo_commit": "1c4c91d4"
"regenerated": "2024-12-11 09:50:49.640853",
"spec_repo_commit": "d3653154"
}
}
}
189 changes: 189 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4293,6 +4293,34 @@ components:
from the other indexes
type: string
type: object
CSMAgentsMetadata:
description: Metadata related to the paginated response.
properties:
page_index:
description: The index of the current page in the paginated results.
example: 0
format: int64
type: integer
page_size:
description: The number of items per page in the paginated results.
example: 10
format: int64
type: integer
total_filtered:
description: Total number of items that match the filter criteria.
example: 128697
format: int64
type: integer
type: object
CSMAgentsType:
default: datadog_agent
description: The type of the resource. The value should always be `datadog_agent`.
enum:
- datadog_agent
example: datadog_agent
type: string
x-enum-varnames:
- DATADOG_AGENT
CalculatedField:
description: Calculated field.
properties:
Expand Down Expand Up @@ -6584,6 +6612,95 @@ components:
nullable: true
type: string
type: object
CsmAgentData:
description: Single Agent Data.
properties:
attributes:
$ref: '#/components/schemas/CsmAgentsAttributes'
id:
description: The ID of the Agent.
example: fffffc5505f6a006fdf7cf5aae053653
type: string
type:
$ref: '#/components/schemas/CSMAgentsType'
type: object
CsmAgentsAttributes:
description: A CSM Agent returned by the API.
properties:
Agent_version:
description: Version of the Datadog Agent.
type: string
aws_fargate:
description: AWS Fargate details.
type: string
cluster_name:
description: List of cluster names associated with the Agent.
items:
type: string
type: array
datadog_agent:
description: Unique identifier for the Datadog Agent.
type: string
ecs_fargate_task_arn:
description: ARN of the ECS Fargate task.
type: string
envs:
description: List of environments associated with the Agent.
items:
type: string
type: array
host_id:
description: ID of the host.
format: int64
type: integer
hostname:
description: Name of the host.
type: string
install_method_installer_version:
description: Version of the installer used for installing the Datadog Agent.
type: string
install_method_tool:
description: Tool used for installing the Datadog Agent.
type: string
is_csm_vm_containers_enabled:
description: Indicates if CSM VM Containers is enabled.
nullable: true
type: boolean
is_csm_vm_hosts_enabled:
description: Indicates if CSM VM Hosts is enabled.
nullable: true
type: boolean
is_cspm_enabled:
description: Indicates if CSPM is enabled.
nullable: true
type: boolean
is_cws_enabled:
description: Indicates if CWS is enabled.
nullable: true
type: boolean
is_cws_remote_configuration_enabled:
description: Indicates if CWS Remote Configuration is enabled.
nullable: true
type: boolean
is_remote_configuration_enabled:
description: Indicates if Remote Configuration is enabled.
nullable: true
type: boolean
os:
description: Operating system of the host.
type: string
type: object
CsmAgentsResponse:
description: Response object that includes a list of CSM Agents.
properties:
data:
description: A list of Agents.
items:
$ref: '#/components/schemas/CsmAgentData'
type: array
meta:
$ref: '#/components/schemas/CSMAgentsMetadata'
type: object
CustomCostGetResponseMeta:
description: Meta for the response from the Get Custom Costs endpoints.
properties:
Expand Down Expand Up @@ -17595,6 +17712,16 @@ components:
required:
- data
type: object
OrderDirection:
description: The sort direction for results.
enum:
- asc
- desc
example: asc
type: string
x-enum-varnames:
- ASC
- DESC
OrgConfigGetResponse:
description: A response with a single Org Config.
properties:
Expand Down Expand Up @@ -30805,6 +30932,59 @@ paths:
x-unstable: '**Note**: This endpoint is in public beta.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/csm/onboarding/agents:
get:
description: Get the list of all CSM Agents running on your hosts and containers.
operationId: ListAllCSMAgents
parameters:
- description: The page index for pagination (zero-based).
in: query
name: page
required: false
schema:
example: 2
format: int32
maximum: 1000000
minimum: 0
type: integer
- description: The number of items to include in a single page.
in: query
name: size
required: false
schema:
example: 12
format: int32
maximum: 100
minimum: 0
type: integer
- description: A search query string to filter results (for example, `hostname:COMP-T2H4J27423`).
in: query
name: query
required: false
schema:
example: hostname:COMP-T2H4J27423
type: string
- description: The sort direction for results. Use `asc` for ascending or `desc`
for descending.
in: query
name: order_direction
required: false
schema:
$ref: '#/components/schemas/OrderDirection'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/CsmAgentsResponse'
description: OK
'403':
$ref: '#/components/responses/NotAuthorizedResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
summary: Get all CSM Agents
tags:
- CSM Agents
/api/v2/current_user/application_keys:
get:
description: List all application keys available for current user
Expand Down Expand Up @@ -44468,6 +44648,15 @@ tags:
[Test Visibility in Datadog page](https://docs.datadoghq.com/tests/) for more
information.
name: CI Visibility Tests
- description: 'Datadog Cloud Security Management (CSM) delivers real-time threat
detection

and continuous configuration audits across your entire cloud infrastructure,

all in a unified view for seamless collaboration and faster remediation.

Go to https://docs.datadoghq.com/security/cloud_security_management to learn more'
name: CSM Agents
- description: Cloud Security Management Threats (CSM Threats) monitors file, network,
and process activity across your environment to detect real-time threats to your
infrastructure. See [Cloud Security Management Threats](https://docs.datadoghq.com/security/threats/)
Expand Down
18 changes: 18 additions & 0 deletions examples/v2_csm-agents_ListAllCSMAgents.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Get all CSM Agents returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_csm_agents::CSMAgentsAPI;
use datadog_api_client::datadogV2::api_csm_agents::ListAllCSMAgentsOptionalParams;

#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = CSMAgentsAPI::with_config(configuration);
let resp = api
.list_all_csm_agents(ListAllCSMAgentsOptionalParams::default())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Loading
Loading