Skip to content
Merged
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
7 changes: 2 additions & 5 deletions datadog_sync/model/synthetics_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class SyntheticsTests(BaseResource):
resource_connections={
"synthetics_tests": ["steps.params.subtestPublicId"],
"synthetics_private_locations": ["locations"],
# "synthetics_global_variables": ["config.configVariables.id"],
"synthetics_global_variables": ["config.configVariables.id"],
},
base_path="/api/v1/synthetics/tests",
excluded_attributes=["deleted_at", "org_id", "public_id", "monitor_id", "modified_at", "created_at", "creator"],
Expand Down Expand Up @@ -52,19 +52,17 @@ def import_resource(self, _id: Optional[str] = None, resource: Optional[Dict] =
elif resource.get("type") == "api":
resource = source_client.get(self.api_test_path.format(_id)).json()

self.remove_global_variables_from_config(resource)
self.resource_config.source_resources[f"{resource['public_id']}#{resource['monitor_id']}"] = resource

def pre_resource_action_hook(self, _id, resource: Dict) -> None:
pass
self.remove_global_variables_from_config(resource)

def pre_apply_hook(self) -> None:
pass

def create_resource(self, _id: str, resource: Dict) -> None:
destination_client = self.config.destination_client
resp = destination_client.post(self.resource_config.base_path, resource).json()
self.remove_global_variables_from_config(resp)

self.resource_config.destination_resources[_id] = resp

Expand All @@ -74,7 +72,6 @@ def update_resource(self, _id: str, resource: Dict) -> None:
self.resource_config.base_path + f"/{self.resource_config.destination_resources[_id]['public_id']}",
resource,
).json()
self.remove_global_variables_from_config(resp)

self.resource_config.destination_resources[_id] = resp

Expand Down