-
Notifications
You must be signed in to change notification settings - Fork 21
Add specs for Cloud Network Monitoring API #2310
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2025-03-31T18:18:50.338Z |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2025-03-31T18:18:50.770Z |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Get aggregated connections returns "OK" response | ||
|
||
require "datadog_api_client" | ||
DatadogAPIClient.configure do |config| | ||
config.unstable_operations["v2.get_aggregated_connections".to_sym] = true | ||
end | ||
api_instance = DatadogAPIClient::V2::CloudNetworkMonitoringAPI.new | ||
p api_instance.get_aggregated_connections() | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1765,6 +1765,13 @@ | |
"device_id" => "String", | ||
"body" => "ListTagsResponse", | ||
}, | ||
"v2.GetAggregatedConnections" => { | ||
"from" => "Integer", | ||
"to" => "Integer", | ||
"group_by" => "String", | ||
"tags" => "String", | ||
"limit" => "Integer", | ||
}, | ||
Comment on lines
+1768
to
+1774
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ⚪ Code Quality ViolationConsider using symbols instead of string hash keys (...read more)In Ruby, it is a best practice to use symbols instead of strings as hash keys. This rule emphasizes that it's more efficient and idiomatic to use symbols for this purpose. Symbols are immutable and unique, which makes them ideal for identifying things, whereas strings are mutable and can create multiple objects for the same sequence of characters. The importance of this rule lies in the performance and memory usage of your Ruby application. Using symbols as hash keys reduces memory usage because they are stored in memory only once during a Ruby process. This can make a significant difference in the efficiency of your application, especially when dealing with large data sets. To ensure you're following good coding practices, always use symbols for hash keys unless there's a specific reason to use a string. A simple refactoring from |
||
"v2.GetOrgConfig" => { | ||
"org_config_name" => "String", | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
@endpoint(cloud-network-monitoring) @endpoint(cloud-network-monitoring-v2) | ||
Feature: Cloud Network Monitoring | ||
The Cloud Network Monitoring API allows you to fetch aggregated | ||
connections and their attributes. See the [Cloud Network Monitoring page]( | ||
https://docs.datadoghq.com/network_monitoring/cloud_network_monitoring/) | ||
for more information. | ||
|
||
Background: | ||
Given a valid "apiKeyAuth" key in the system | ||
And a valid "appKeyAuth" key in the system | ||
And an instance of "CloudNetworkMonitoring" API | ||
And operation "GetAggregatedConnections" enabled | ||
And new "GetAggregatedConnections" request | ||
|
||
@generated @skip @team:Datadog/networks | ||
Scenario: Get aggregated connections returns "Bad Request" response | ||
When the request is sent | ||
Then the response status is 400 Bad Request | ||
|
||
@team:Datadog/networks | ||
Scenario: Get aggregated connections returns "OK" response | ||
When the request is sent | ||
Then the response status is 200 OK | ||
|
||
@skip-python @skip-ruby @team:Datadog/networks | ||
Scenario: Get all aggregated connections returns "Bad Request" response | ||
Given request contains "limit" parameter with value 6000 | ||
When the request is sent | ||
Then the response status is 400 Bad Request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚪ Code Quality Violation
Do not use parentheses with methods that take no arguments (...read more)
The rule "Avoid parentheses when methods take no arguments" is part of the Ruby style guide. It suggests that when a method takes no arguments, you should not use parentheses. This is because the use of parentheses in such a case is redundant and unnecessary, and it can make your code more difficult to read and understand.
This rule is important because it promotes cleaner, more readable code. In Ruby, clean and readable code is highly valued. By following this rule, you can ensure your code is easier to understand and maintain, which is crucial for long-term project success.
To adhere to this rule, remove the parentheses when calling a method that does not require any arguments. For example, instead of writing
'test'.upcase()
, you should write'test'.upcase
. Similarly, instead ofKernel.exit!()
, writeKernel.exit!
. However, note that there is an exception forsuper
-super
by itself is different fromsuper()
, so in this case, parentheses may be necessary.