Skip to content

Commit

Permalink
Move extension.py to configuration_v1
Browse files Browse the repository at this point in the history
  • Loading branch information
dlopes7 committed Apr 26, 2021
1 parent 2fa43a4 commit 3f4220d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 19 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ActiveGates | :heavy_check_mark: | `dt.activegates
ActiveGates - Auto-update configuration | :warning: | `dt.activegates_autoupdate` |
ActiveGates - Auto-update jobs | :x: | |
Audit Logs | :x: | |
Extensions 2.0 | :warning: | `dt.extensions` |
Extensions 2.0 | :x: | |
Metrics | :warning: | `dt.metrics` |
Monitored entities | :warning: | `dt.entities` |
Monitored entities - Custom tags | :x: | |
Expand Down Expand Up @@ -91,7 +91,7 @@ Conditional naming | :x: | |
Credential vault | :x: | |
Dashboards | :warning: |`dt.dashboards` |
Data privacy and security | :x: | |
Extensions | :x: | |
Extensions | :warning: | `dt.extensions` |
Frequent issue detection | :x: | |
Kubernetes credentials configuration | :x: | |
Maintenance windows | :x: | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from dynatrace.environment_v2.configuration import ConfigurationMetadata
from dynatrace.dynatrace_object import DynatraceObject
from dynatrace.configuration_v1.endpoint import EndpointShortRepresentation
from dynatrace.environment_v2.entity import EntityShortRepresentation
from dynatrace.http_client import HttpClient
from dynatrace.pagination import PaginatedList
Expand All @@ -15,12 +14,6 @@ def __init__(self, http_client: HttpClient):
self.__http_client = http_client
pass

def list_endpoints(self, plugin_id: str) -> PaginatedList[EndpointShortRepresentation]:
"""
Lists endpoints of the specified ActiveGate plugin
"""
return PaginatedList("EndpointShortRepresentation", self.__http_client, f"/api/config/v1/plugins/{plugin_id}/endpoints", list_item="values")

def list(self, page_size: int = 200) -> PaginatedList["ExtensionDto"]:
"""
List all uploaded extensions
Expand Down Expand Up @@ -223,13 +216,13 @@ def get_full_extension(self) -> Extension:
return Extension(self._http_client, None, response)

@property
def instances(self) -> PaginatedList[ExtensionShortRepresentation]:
return PaginatedList(
ExtensionShortRepresentation,
self._http_client,
f"/api/config/v1/extensions/{self.id}/instances",
list_item="configurationsList",
)
def instances(self, page_size: int = 200) -> PaginatedList["ExtensionShortRepresentation"]:
"""
Returns the list of instances for this extension
:param page_size: Page size, default 200
"""
params = {"pageSize": page_size}
return PaginatedList(ExtensionShortRepresentation, self._http_client, f"/api/config/v1/extensions/{self.id}/instances", list_item="configurationsList", target_params=params)

def delete(self) -> Response:
"""
Expand Down
4 changes: 2 additions & 2 deletions dynatrace/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from typing import Dict, Optional

from dynatrace.configuration_v1.dashboard import DashboardService
from dynatrace.configuration_v1.extension import ExtensionService
from dynatrace.configuration_v1.maintenance_windows import MaintenanceWindowService
from dynatrace.configuration_v1.plugins import PluginService
from dynatrace.environment_v1.cluster_time import ClusterTimeService
from dynatrace.environment_v1.custom_device import CustomDeviceService
Expand All @@ -10,10 +12,8 @@
from dynatrace.environment_v2.activegate import ActiveGateService
from dynatrace.environment_v2.activegate_autoupdate import ActiveGateAutoUpdateService
from dynatrace.environment_v2.entity import EntityService
from dynatrace.environment_v2.extension import ExtensionService
from dynatrace.environment_v2.metric import MetricService
from dynatrace.environment_v2.token import TokenService
from dynatrace.configuration_v1.maintenance_windows import MaintenanceWindowService
from dynatrace.http_client import HttpClient


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="dtapi",
version="1.1.7",
version="1.1.8",
packages=find_packages(),
install_requires=["requests>=2.21"],
python_requires=">=3.6",
Expand Down

0 comments on commit 3f4220d

Please sign in to comment.