diff --git a/.gitignore b/.gitignore index e9dc222d..d9baeffe 100644 --- a/.gitignore +++ b/.gitignore @@ -104,3 +104,10 @@ venv.bak/ .mypy_cache/ sandbox + +# PyCharm +**/.idea +**/*.iml + +# OpenAPI-generator +/.openapi-generator* \ No newline at end of file diff --git a/README.md b/README.md index 2f1496d5..11c6f50b 100644 --- a/README.md +++ b/README.md @@ -50,15 +50,15 @@ bucket = "test_bucket" client = InfluxDBClient(url="http://localhost:9999/api/v2", token="my-token-123", org="my-org") -write_client = client.write_client() -query_client = client.query_client() +write_api = client.write_api() +query_api = client.query_api() p = Point("my_measurement").tag("location", "Prague").field("temperature", 25.3) -write_client.write(bucket=bucket, org="my-org", record=p) +write_api.write(bucket=bucket, org="my-org", record=p) ## using Table structure -tables = query_client.query('from(bucket:"my-bucket") |> range(start: -10m)') +tables = query_api.query('from(bucket:"my-bucket") |> range(start: -10m)') for table in tables: print(table) @@ -67,7 +67,7 @@ for table in tables: ## using csv library -csv_result = query_client.query_csv('from(bucket:"my-bucket") |> range(start: -10m)') +csv_result = query_api.query_csv('from(bucket:"my-bucket") |> range(start: -10m)') val_count = 0 for row in csv_result: for cell in row: diff --git a/git_push.sh b/git_push.sh deleted file mode 100644 index 8442b80b..00000000 --- a/git_push.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/influxdb2/__init__.py b/influxdb2/__init__.py index b054d0ae..e4f28c24 100644 --- a/influxdb2/__init__.py +++ b/influxdb2/__init__.py @@ -17,228 +17,260 @@ __version__ = "1.0.0" # import apis into sdk package -from influxdb2.api.authorizations_api import AuthorizationsApi -from influxdb2.api.buckets_api import BucketsApi -from influxdb2.api.cells_api import CellsApi -from influxdb2.api.dashboards_api import DashboardsApi -from influxdb2.api.health_api import HealthApi -from influxdb2.api.labels_api import LabelsApi -from influxdb2.api.operation_logs_api import OperationLogsApi -from influxdb2.api.organizations_api import OrganizationsApi -from influxdb2.api.query_api import QueryApi -from influxdb2.api.ready_api import ReadyApi -from influxdb2.api.scraper_targets_api import ScraperTargetsApi -from influxdb2.api.secrets_api import SecretsApi -from influxdb2.api.setup_api import SetupApi -from influxdb2.api.sources_api import SourcesApi -from influxdb2.api.tasks_api import TasksApi -from influxdb2.api.telegrafs_api import TelegrafsApi -from influxdb2.api.templates_api import TemplatesApi -from influxdb2.api.users_api import UsersApi -from influxdb2.api.variables_api import VariablesApi -from influxdb2.api.views_api import ViewsApi -from influxdb2.api.write_api import WriteApi -from influxdb2.api.default_api import DefaultApi +from influxdb2.service.authorizations_service import AuthorizationsService +from influxdb2.service.buckets_service import BucketsService +from influxdb2.service.cells_service import CellsService +from influxdb2.service.checks_service import ChecksService +from influxdb2.service.dashboards_service import DashboardsService +from influxdb2.service.health_service import HealthService +from influxdb2.service.labels_service import LabelsService +from influxdb2.service.notification_endpoints_service import NotificationEndpointsService +from influxdb2.service.notification_rules_service import NotificationRulesService +from influxdb2.service.operation_logs_service import OperationLogsService +from influxdb2.service.organizations_service import OrganizationsService +from influxdb2.service.query_service import QueryService +from influxdb2.service.ready_service import ReadyService +from influxdb2.service.scraper_targets_service import ScraperTargetsService +from influxdb2.service.secrets_service import SecretsService +from influxdb2.service.setup_service import SetupService +from influxdb2.service.sources_service import SourcesService +from influxdb2.service.tasks_service import TasksService +from influxdb2.service.telegrafs_service import TelegrafsService +from influxdb2.service.templates_service import TemplatesService +from influxdb2.service.users_service import UsersService +from influxdb2.service.variables_service import VariablesService +from influxdb2.service.views_service import ViewsService +from influxdb2.service.write_service import WriteService +from influxdb2.service.default_service import DefaultService # import ApiClient from influxdb2.api_client import ApiClient from influxdb2.configuration import Configuration # import models into sdk package -from influxdb2.models.ast_response import ASTResponse -from influxdb2.models.add_resource_member_request_body import AddResourceMemberRequestBody -from influxdb2.models.analyze_query_response import AnalyzeQueryResponse -from influxdb2.models.analyze_query_response_errors import AnalyzeQueryResponseErrors -from influxdb2.models.array_expression import ArrayExpression -from influxdb2.models.authorization import Authorization -from influxdb2.models.authorization_update_request import AuthorizationUpdateRequest -from influxdb2.models.authorizations import Authorizations -from influxdb2.models.axes import Axes -from influxdb2.models.axis import Axis -from influxdb2.models.bad_statement import BadStatement -from influxdb2.models.binary_expression import BinaryExpression -from influxdb2.models.block import Block -from influxdb2.models.boolean_literal import BooleanLiteral -from influxdb2.models.bucket import Bucket -from influxdb2.models.bucket_links import BucketLinks -from influxdb2.models.bucket_retention_rules import BucketRetentionRules -from influxdb2.models.buckets import Buckets -from influxdb2.models.builtin_statement import BuiltinStatement -from influxdb2.models.call_expression import CallExpression -from influxdb2.models.cell import Cell -from influxdb2.models.cell_links import CellLinks -from influxdb2.models.cell_update import CellUpdate -from influxdb2.models.check import Check -from influxdb2.models.conditional_expression import ConditionalExpression -from influxdb2.models.constant_variable_properties import ConstantVariableProperties -from influxdb2.models.create_cell import CreateCell -from influxdb2.models.create_dashboard_request import CreateDashboardRequest -from influxdb2.models.dashboard import Dashboard -from influxdb2.models.dashboard_color import DashboardColor -from influxdb2.models.dashboard_query import DashboardQuery -from influxdb2.models.dashboard_query_range import DashboardQueryRange -from influxdb2.models.dashboards import Dashboards -from influxdb2.models.date_time_literal import DateTimeLiteral -from influxdb2.models.decimal_places import DecimalPlaces -from influxdb2.models.dialect import Dialect -from influxdb2.models.document import Document -from influxdb2.models.document_create import DocumentCreate -from influxdb2.models.document_links import DocumentLinks -from influxdb2.models.document_list_entry import DocumentListEntry -from influxdb2.models.document_meta import DocumentMeta -from influxdb2.models.document_update import DocumentUpdate -from influxdb2.models.documents import Documents -from influxdb2.models.duration import Duration -from influxdb2.models.duration_literal import DurationLiteral -from influxdb2.models.empty_view_properties import EmptyViewProperties -from influxdb2.models.error import Error -from influxdb2.models.expression import Expression -from influxdb2.models.expression_statement import ExpressionStatement -from influxdb2.models.field import Field -from influxdb2.models.file import File -from influxdb2.models.float_literal import FloatLiteral -from influxdb2.models.flux_suggestion import FluxSuggestion -from influxdb2.models.flux_suggestions import FluxSuggestions -from influxdb2.models.function_expression import FunctionExpression -from influxdb2.models.gauge_view_properties import GaugeViewProperties -from influxdb2.models.histogram_view_properties import HistogramViewProperties -from influxdb2.models.identifier import Identifier -from influxdb2.models.import_declaration import ImportDeclaration -from influxdb2.models.index_expression import IndexExpression -from influxdb2.models.integer_literal import IntegerLiteral -from influxdb2.models.is_onboarding import IsOnboarding -from influxdb2.models.label import Label -from influxdb2.models.label_create_request import LabelCreateRequest -from influxdb2.models.label_mapping import LabelMapping -from influxdb2.models.label_response import LabelResponse -from influxdb2.models.label_update import LabelUpdate -from influxdb2.models.labels_response import LabelsResponse -from influxdb2.models.language_request import LanguageRequest -from influxdb2.models.legend import Legend -from influxdb2.models.line_plus_single_stat_properties import LinePlusSingleStatProperties -from influxdb2.models.line_protocol_error import LineProtocolError -from influxdb2.models.line_protocol_length_error import LineProtocolLengthError -from influxdb2.models.links import Links -from influxdb2.models.log_event import LogEvent -from influxdb2.models.log_view_properties import LogViewProperties -from influxdb2.models.log_viewer_column import LogViewerColumn -from influxdb2.models.log_viewer_column_settings import LogViewerColumnSettings -from influxdb2.models.logical_expression import LogicalExpression -from influxdb2.models.logs import Logs -from influxdb2.models.map_variable_properties import MapVariableProperties -from influxdb2.models.markdown_view_properties import MarkdownViewProperties -from influxdb2.models.member_assignment import MemberAssignment -from influxdb2.models.member_expression import MemberExpression -from influxdb2.models.model_property import ModelProperty -from influxdb2.models.node import Node -from influxdb2.models.object_expression import ObjectExpression -from influxdb2.models.onboarding_request import OnboardingRequest -from influxdb2.models.onboarding_response import OnboardingResponse -from influxdb2.models.operation_log import OperationLog -from influxdb2.models.operation_log_links import OperationLogLinks -from influxdb2.models.operation_logs import OperationLogs -from influxdb2.models.option_statement import OptionStatement -from influxdb2.models.organization import Organization -from influxdb2.models.organization_links import OrganizationLinks -from influxdb2.models.organizations import Organizations -from influxdb2.models.package import Package -from influxdb2.models.package_clause import PackageClause -from influxdb2.models.password_reset_body import PasswordResetBody -from influxdb2.models.permission import Permission -from influxdb2.models.permission_resource import PermissionResource -from influxdb2.models.pipe_expression import PipeExpression -from influxdb2.models.pipe_literal import PipeLiteral -from influxdb2.models.property_key import PropertyKey -from influxdb2.models.query import Query -from influxdb2.models.query_config import QueryConfig -from influxdb2.models.query_config_group_by import QueryConfigGroupBy -from influxdb2.models.query_config_range import QueryConfigRange -from influxdb2.models.query_variable_properties import QueryVariableProperties -from influxdb2.models.query_variable_properties_values import QueryVariablePropertiesValues -from influxdb2.models.ready import Ready -from influxdb2.models.regexp_literal import RegexpLiteral -from influxdb2.models.renamable_field import RenamableField -from influxdb2.models.resource_member import ResourceMember -from influxdb2.models.resource_members import ResourceMembers -from influxdb2.models.resource_owner import ResourceOwner -from influxdb2.models.resource_owners import ResourceOwners -from influxdb2.models.return_statement import ReturnStatement -from influxdb2.models.routes import Routes -from influxdb2.models.routes_external import RoutesExternal -from influxdb2.models.routes_query import RoutesQuery -from influxdb2.models.routes_system import RoutesSystem -from influxdb2.models.run import Run -from influxdb2.models.run_links import RunLinks -from influxdb2.models.run_log import RunLog -from influxdb2.models.run_manually import RunManually -from influxdb2.models.runs import Runs -from influxdb2.models.scraper_target_request import ScraperTargetRequest -from influxdb2.models.scraper_target_response import ScraperTargetResponse -from influxdb2.models.scraper_target_responses import ScraperTargetResponses -from influxdb2.models.secret_keys import SecretKeys -from influxdb2.models.secret_keys_response import SecretKeysResponse -from influxdb2.models.single_stat_view_properties import SingleStatViewProperties -from influxdb2.models.source import Source -from influxdb2.models.source_links import SourceLinks -from influxdb2.models.sources import Sources -from influxdb2.models.statement import Statement -from influxdb2.models.string_literal import StringLiteral -from influxdb2.models.table_view_properties import TableViewProperties -from influxdb2.models.task import Task -from influxdb2.models.task_create_request import TaskCreateRequest -from influxdb2.models.task_links import TaskLinks -from influxdb2.models.task_update_request import TaskUpdateRequest -from influxdb2.models.tasks import Tasks -from influxdb2.models.telegraf import Telegraf -from influxdb2.models.telegraf_plugin_input_cpu import TelegrafPluginInputCpu -from influxdb2.models.telegraf_plugin_input_disk import TelegrafPluginInputDisk -from influxdb2.models.telegraf_plugin_input_diskio import TelegrafPluginInputDiskio -from influxdb2.models.telegraf_plugin_input_docker import TelegrafPluginInputDocker -from influxdb2.models.telegraf_plugin_input_docker_config import TelegrafPluginInputDockerConfig -from influxdb2.models.telegraf_plugin_input_file import TelegrafPluginInputFile -from influxdb2.models.telegraf_plugin_input_file_config import TelegrafPluginInputFileConfig -from influxdb2.models.telegraf_plugin_input_kernel import TelegrafPluginInputKernel -from influxdb2.models.telegraf_plugin_input_kubernetes import TelegrafPluginInputKubernetes -from influxdb2.models.telegraf_plugin_input_kubernetes_config import TelegrafPluginInputKubernetesConfig -from influxdb2.models.telegraf_plugin_input_log_parser import TelegrafPluginInputLogParser -from influxdb2.models.telegraf_plugin_input_log_parser_config import TelegrafPluginInputLogParserConfig -from influxdb2.models.telegraf_plugin_input_mem import TelegrafPluginInputMem -from influxdb2.models.telegraf_plugin_input_net import TelegrafPluginInputNet -from influxdb2.models.telegraf_plugin_input_net_response import TelegrafPluginInputNetResponse -from influxdb2.models.telegraf_plugin_input_nginx import TelegrafPluginInputNginx -from influxdb2.models.telegraf_plugin_input_processes import TelegrafPluginInputProcesses -from influxdb2.models.telegraf_plugin_input_procstat import TelegrafPluginInputProcstat -from influxdb2.models.telegraf_plugin_input_procstat_config import TelegrafPluginInputProcstatConfig -from influxdb2.models.telegraf_plugin_input_prometheus import TelegrafPluginInputPrometheus -from influxdb2.models.telegraf_plugin_input_prometheus_config import TelegrafPluginInputPrometheusConfig -from influxdb2.models.telegraf_plugin_input_redis import TelegrafPluginInputRedis -from influxdb2.models.telegraf_plugin_input_redis_config import TelegrafPluginInputRedisConfig -from influxdb2.models.telegraf_plugin_input_swap import TelegrafPluginInputSwap -from influxdb2.models.telegraf_plugin_input_syslog import TelegrafPluginInputSyslog -from influxdb2.models.telegraf_plugin_input_syslog_config import TelegrafPluginInputSyslogConfig -from influxdb2.models.telegraf_plugin_input_system import TelegrafPluginInputSystem -from influxdb2.models.telegraf_plugin_input_tail import TelegrafPluginInputTail -from influxdb2.models.telegraf_plugin_output_file import TelegrafPluginOutputFile -from influxdb2.models.telegraf_plugin_output_file_config import TelegrafPluginOutputFileConfig -from influxdb2.models.telegraf_plugin_output_file_config_files import TelegrafPluginOutputFileConfigFiles -from influxdb2.models.telegraf_plugin_output_influx_dbv2 import TelegrafPluginOutputInfluxDBV2 -from influxdb2.models.telegraf_plugin_output_influx_dbv2_config import TelegrafPluginOutputInfluxDBV2Config -from influxdb2.models.telegraf_request import TelegrafRequest -from influxdb2.models.telegraf_request_agent import TelegrafRequestAgent -from influxdb2.models.telegraf_request_plugin import TelegrafRequestPlugin -from influxdb2.models.telegrafs import Telegrafs -from influxdb2.models.test_statement import TestStatement -from influxdb2.models.unary_expression import UnaryExpression -from influxdb2.models.unsigned_integer_literal import UnsignedIntegerLiteral -from influxdb2.models.user import User -from influxdb2.models.user_links import UserLinks -from influxdb2.models.users import Users -from influxdb2.models.users_links import UsersLinks -from influxdb2.models.variable import Variable -from influxdb2.models.variable_assignment import VariableAssignment -from influxdb2.models.variable_links import VariableLinks -from influxdb2.models.variables import Variables -from influxdb2.models.view import View -from influxdb2.models.view_links import ViewLinks -from influxdb2.models.view_properties import ViewProperties -from influxdb2.models.write_precision import WritePrecision -from influxdb2.models.xy_view_properties import XYViewProperties +from influxdb2.domain.ast_response import ASTResponse +from influxdb2.domain.add_resource_member_request_body import AddResourceMemberRequestBody +from influxdb2.domain.analyze_query_response import AnalyzeQueryResponse +from influxdb2.domain.analyze_query_response_errors import AnalyzeQueryResponseErrors +from influxdb2.domain.array_expression import ArrayExpression +from influxdb2.domain.authorization import Authorization +from influxdb2.domain.authorization_update_request import AuthorizationUpdateRequest +from influxdb2.domain.authorizations import Authorizations +from influxdb2.domain.axes import Axes +from influxdb2.domain.axis import Axis +from influxdb2.domain.axis_scale import AxisScale +from influxdb2.domain.bad_statement import BadStatement +from influxdb2.domain.binary_expression import BinaryExpression +from influxdb2.domain.block import Block +from influxdb2.domain.boolean_literal import BooleanLiteral +from influxdb2.domain.bucket import Bucket +from influxdb2.domain.bucket_links import BucketLinks +from influxdb2.domain.bucket_retention_rules import BucketRetentionRules +from influxdb2.domain.buckets import Buckets +from influxdb2.domain.builder_config import BuilderConfig +from influxdb2.domain.builder_config_aggregate_window import BuilderConfigAggregateWindow +from influxdb2.domain.builder_functions_type import BuilderFunctionsType +from influxdb2.domain.builder_tags_type import BuilderTagsType +from influxdb2.domain.builtin_statement import BuiltinStatement +from influxdb2.domain.call_expression import CallExpression +from influxdb2.domain.cell import Cell +from influxdb2.domain.cell_links import CellLinks +from influxdb2.domain.cell_update import CellUpdate +from influxdb2.domain.check import Check +from influxdb2.domain.check_base import CheckBase +from influxdb2.domain.check_base_tags import CheckBaseTags +from influxdb2.domain.check_status_level import CheckStatusLevel +from influxdb2.domain.check_view_properties import CheckViewProperties +from influxdb2.domain.checks import Checks +from influxdb2.domain.conditional_expression import ConditionalExpression +from influxdb2.domain.constant_variable_properties import ConstantVariableProperties +from influxdb2.domain.create_cell import CreateCell +from influxdb2.domain.create_dashboard_request import CreateDashboardRequest +from influxdb2.domain.dashboard import Dashboard +from influxdb2.domain.dashboard_color import DashboardColor +from influxdb2.domain.dashboard_query import DashboardQuery +from influxdb2.domain.dashboards import Dashboards +from influxdb2.domain.date_time_literal import DateTimeLiteral +from influxdb2.domain.deadman_check import DeadmanCheck +from influxdb2.domain.decimal_places import DecimalPlaces +from influxdb2.domain.dialect import Dialect +from influxdb2.domain.document import Document +from influxdb2.domain.document_create import DocumentCreate +from influxdb2.domain.document_links import DocumentLinks +from influxdb2.domain.document_list_entry import DocumentListEntry +from influxdb2.domain.document_meta import DocumentMeta +from influxdb2.domain.document_update import DocumentUpdate +from influxdb2.domain.documents import Documents +from influxdb2.domain.duration import Duration +from influxdb2.domain.duration_literal import DurationLiteral +from influxdb2.domain.error import Error +from influxdb2.domain.expression import Expression +from influxdb2.domain.expression_statement import ExpressionStatement +from influxdb2.domain.field import Field +from influxdb2.domain.file import File +from influxdb2.domain.float_literal import FloatLiteral +from influxdb2.domain.flux_suggestion import FluxSuggestion +from influxdb2.domain.flux_suggestions import FluxSuggestions +from influxdb2.domain.function_expression import FunctionExpression +from influxdb2.domain.gauge_view_properties import GaugeViewProperties +from influxdb2.domain.health_check import HealthCheck +from influxdb2.domain.heatmap_view_properties import HeatmapViewProperties +from influxdb2.domain.histogram_view_properties import HistogramViewProperties +from influxdb2.domain.identifier import Identifier +from influxdb2.domain.import_declaration import ImportDeclaration +from influxdb2.domain.index_expression import IndexExpression +from influxdb2.domain.integer_literal import IntegerLiteral +from influxdb2.domain.is_onboarding import IsOnboarding +from influxdb2.domain.label import Label +from influxdb2.domain.label_create_request import LabelCreateRequest +from influxdb2.domain.label_mapping import LabelMapping +from influxdb2.domain.label_response import LabelResponse +from influxdb2.domain.label_update import LabelUpdate +from influxdb2.domain.labels_response import LabelsResponse +from influxdb2.domain.language_request import LanguageRequest +from influxdb2.domain.legend import Legend +from influxdb2.domain.level_rule import LevelRule +from influxdb2.domain.line_plus_single_stat_properties import LinePlusSingleStatProperties +from influxdb2.domain.line_protocol_error import LineProtocolError +from influxdb2.domain.line_protocol_length_error import LineProtocolLengthError +from influxdb2.domain.links import Links +from influxdb2.domain.log_event import LogEvent +from influxdb2.domain.logical_expression import LogicalExpression +from influxdb2.domain.logs import Logs +from influxdb2.domain.map_variable_properties import MapVariableProperties +from influxdb2.domain.markdown_view_properties import MarkdownViewProperties +from influxdb2.domain.member_assignment import MemberAssignment +from influxdb2.domain.member_expression import MemberExpression +from influxdb2.domain.model_property import ModelProperty +from influxdb2.domain.node import Node +from influxdb2.domain.notification_endpoint import NotificationEndpoint +from influxdb2.domain.notification_endpoint_base import NotificationEndpointBase +from influxdb2.domain.notification_endpoints import NotificationEndpoints +from influxdb2.domain.notification_rule import NotificationRule +from influxdb2.domain.notification_rule_base import NotificationRuleBase +from influxdb2.domain.notification_rule_update import NotificationRuleUpdate +from influxdb2.domain.notification_rules import NotificationRules +from influxdb2.domain.object_expression import ObjectExpression +from influxdb2.domain.onboarding_request import OnboardingRequest +from influxdb2.domain.onboarding_response import OnboardingResponse +from influxdb2.domain.operation_log import OperationLog +from influxdb2.domain.operation_log_links import OperationLogLinks +from influxdb2.domain.operation_logs import OperationLogs +from influxdb2.domain.option_statement import OptionStatement +from influxdb2.domain.organization import Organization +from influxdb2.domain.organization_links import OrganizationLinks +from influxdb2.domain.organizations import Organizations +from influxdb2.domain.package import Package +from influxdb2.domain.package_clause import PackageClause +from influxdb2.domain.pager_duty_notification_endpoint import PagerDutyNotificationEndpoint +from influxdb2.domain.pager_duty_notification_rule import PagerDutyNotificationRule +from influxdb2.domain.password_reset_body import PasswordResetBody +from influxdb2.domain.permission import Permission +from influxdb2.domain.permission_resource import PermissionResource +from influxdb2.domain.pipe_expression import PipeExpression +from influxdb2.domain.pipe_literal import PipeLiteral +from influxdb2.domain.property_key import PropertyKey +from influxdb2.domain.query import Query +from influxdb2.domain.query_edit_mode import QueryEditMode +from influxdb2.domain.query_variable_properties import QueryVariableProperties +from influxdb2.domain.query_variable_properties_values import QueryVariablePropertiesValues +from influxdb2.domain.ready import Ready +from influxdb2.domain.regexp_literal import RegexpLiteral +from influxdb2.domain.renamable_field import RenamableField +from influxdb2.domain.resource_member import ResourceMember +from influxdb2.domain.resource_members import ResourceMembers +from influxdb2.domain.resource_owner import ResourceOwner +from influxdb2.domain.resource_owners import ResourceOwners +from influxdb2.domain.return_statement import ReturnStatement +from influxdb2.domain.routes import Routes +from influxdb2.domain.routes_external import RoutesExternal +from influxdb2.domain.routes_query import RoutesQuery +from influxdb2.domain.routes_system import RoutesSystem +from influxdb2.domain.run import Run +from influxdb2.domain.run_links import RunLinks +from influxdb2.domain.run_log import RunLog +from influxdb2.domain.run_manually import RunManually +from influxdb2.domain.runs import Runs +from influxdb2.domain.smtp_notification_endpoint import SMTPNotificationEndpoint +from influxdb2.domain.smtp_notification_rule import SMTPNotificationRule +from influxdb2.domain.scatter_view_properties import ScatterViewProperties +from influxdb2.domain.scraper_target_request import ScraperTargetRequest +from influxdb2.domain.scraper_target_response import ScraperTargetResponse +from influxdb2.domain.scraper_target_responses import ScraperTargetResponses +from influxdb2.domain.secret_keys import SecretKeys +from influxdb2.domain.secret_keys_response import SecretKeysResponse +from influxdb2.domain.single_stat_view_properties import SingleStatViewProperties +from influxdb2.domain.slack_notification_endpoint import SlackNotificationEndpoint +from influxdb2.domain.slack_notification_rule import SlackNotificationRule +from influxdb2.domain.source import Source +from influxdb2.domain.source_links import SourceLinks +from influxdb2.domain.sources import Sources +from influxdb2.domain.statement import Statement +from influxdb2.domain.status_rule import StatusRule +from influxdb2.domain.string_literal import StringLiteral +from influxdb2.domain.table_view_properties import TableViewProperties +from influxdb2.domain.tag_rule import TagRule +from influxdb2.domain.task import Task +from influxdb2.domain.task_create_request import TaskCreateRequest +from influxdb2.domain.task_links import TaskLinks +from influxdb2.domain.task_status_type import TaskStatusType +from influxdb2.domain.task_update_request import TaskUpdateRequest +from influxdb2.domain.tasks import Tasks +from influxdb2.domain.telegraf import Telegraf +from influxdb2.domain.telegraf_plugin_input_cpu import TelegrafPluginInputCpu +from influxdb2.domain.telegraf_plugin_input_disk import TelegrafPluginInputDisk +from influxdb2.domain.telegraf_plugin_input_diskio import TelegrafPluginInputDiskio +from influxdb2.domain.telegraf_plugin_input_docker import TelegrafPluginInputDocker +from influxdb2.domain.telegraf_plugin_input_docker_config import TelegrafPluginInputDockerConfig +from influxdb2.domain.telegraf_plugin_input_file import TelegrafPluginInputFile +from influxdb2.domain.telegraf_plugin_input_file_config import TelegrafPluginInputFileConfig +from influxdb2.domain.telegraf_plugin_input_kernel import TelegrafPluginInputKernel +from influxdb2.domain.telegraf_plugin_input_kubernetes import TelegrafPluginInputKubernetes +from influxdb2.domain.telegraf_plugin_input_kubernetes_config import TelegrafPluginInputKubernetesConfig +from influxdb2.domain.telegraf_plugin_input_log_parser import TelegrafPluginInputLogParser +from influxdb2.domain.telegraf_plugin_input_log_parser_config import TelegrafPluginInputLogParserConfig +from influxdb2.domain.telegraf_plugin_input_mem import TelegrafPluginInputMem +from influxdb2.domain.telegraf_plugin_input_net import TelegrafPluginInputNet +from influxdb2.domain.telegraf_plugin_input_net_response import TelegrafPluginInputNetResponse +from influxdb2.domain.telegraf_plugin_input_nginx import TelegrafPluginInputNginx +from influxdb2.domain.telegraf_plugin_input_processes import TelegrafPluginInputProcesses +from influxdb2.domain.telegraf_plugin_input_procstat import TelegrafPluginInputProcstat +from influxdb2.domain.telegraf_plugin_input_procstat_config import TelegrafPluginInputProcstatConfig +from influxdb2.domain.telegraf_plugin_input_prometheus import TelegrafPluginInputPrometheus +from influxdb2.domain.telegraf_plugin_input_prometheus_config import TelegrafPluginInputPrometheusConfig +from influxdb2.domain.telegraf_plugin_input_redis import TelegrafPluginInputRedis +from influxdb2.domain.telegraf_plugin_input_redis_config import TelegrafPluginInputRedisConfig +from influxdb2.domain.telegraf_plugin_input_swap import TelegrafPluginInputSwap +from influxdb2.domain.telegraf_plugin_input_syslog import TelegrafPluginInputSyslog +from influxdb2.domain.telegraf_plugin_input_syslog_config import TelegrafPluginInputSyslogConfig +from influxdb2.domain.telegraf_plugin_input_system import TelegrafPluginInputSystem +from influxdb2.domain.telegraf_plugin_input_tail import TelegrafPluginInputTail +from influxdb2.domain.telegraf_plugin_output_file import TelegrafPluginOutputFile +from influxdb2.domain.telegraf_plugin_output_file_config import TelegrafPluginOutputFileConfig +from influxdb2.domain.telegraf_plugin_output_file_config_files import TelegrafPluginOutputFileConfigFiles +from influxdb2.domain.telegraf_plugin_output_influx_dbv2 import TelegrafPluginOutputInfluxDBV2 +from influxdb2.domain.telegraf_plugin_output_influx_dbv2_config import TelegrafPluginOutputInfluxDBV2Config +from influxdb2.domain.telegraf_request import TelegrafRequest +from influxdb2.domain.telegraf_request_agent import TelegrafRequestAgent +from influxdb2.domain.telegraf_request_plugin import TelegrafRequestPlugin +from influxdb2.domain.telegrafs import Telegrafs +from influxdb2.domain.test_statement import TestStatement +from influxdb2.domain.threshold import Threshold +from influxdb2.domain.threshold_check import ThresholdCheck +from influxdb2.domain.unary_expression import UnaryExpression +from influxdb2.domain.unsigned_integer_literal import UnsignedIntegerLiteral +from influxdb2.domain.user import User +from influxdb2.domain.user_links import UserLinks +from influxdb2.domain.users import Users +from influxdb2.domain.users_links import UsersLinks +from influxdb2.domain.variable import Variable +from influxdb2.domain.variable_assignment import VariableAssignment +from influxdb2.domain.variable_links import VariableLinks +from influxdb2.domain.variables import Variables +from influxdb2.domain.view import View +from influxdb2.domain.view_links import ViewLinks +from influxdb2.domain.view_properties import ViewProperties +from influxdb2.domain.views import Views +from influxdb2.domain.webhook_notification_endpoint import WebhookNotificationEndpoint +from influxdb2.domain.write_precision import WritePrecision +from influxdb2.domain.xy_geom import XYGeom +from influxdb2.domain.xy_view_properties import XYViewProperties diff --git a/influxdb2/api/__init__.py b/influxdb2/api/__init__.py deleted file mode 100644 index 128c3877..00000000 --- a/influxdb2/api/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -from __future__ import absolute_import - -# flake8: noqa - -# import apis into api package -from influxdb2.api.authorizations_api import AuthorizationsApi -from influxdb2.api.buckets_api import BucketsApi -from influxdb2.api.cells_api import CellsApi -from influxdb2.api.dashboards_api import DashboardsApi -from influxdb2.api.health_api import HealthApi -from influxdb2.api.labels_api import LabelsApi -from influxdb2.api.operation_logs_api import OperationLogsApi -from influxdb2.api.organizations_api import OrganizationsApi -from influxdb2.api.query_api import QueryApi -from influxdb2.api.ready_api import ReadyApi -from influxdb2.api.scraper_targets_api import ScraperTargetsApi -from influxdb2.api.secrets_api import SecretsApi -from influxdb2.api.setup_api import SetupApi -from influxdb2.api.sources_api import SourcesApi -from influxdb2.api.tasks_api import TasksApi -from influxdb2.api.telegrafs_api import TelegrafsApi -from influxdb2.api.templates_api import TemplatesApi -from influxdb2.api.users_api import UsersApi -from influxdb2.api.variables_api import VariablesApi -from influxdb2.api.views_api import ViewsApi -from influxdb2.api.write_api import WriteApi -from influxdb2.api.default_api import DefaultApi diff --git a/influxdb2/api_client.py b/influxdb2/api_client.py index 95296112..0e1fe9e0 100644 --- a/influxdb2/api_client.py +++ b/influxdb2/api_client.py @@ -23,7 +23,7 @@ from six.moves.urllib.parse import quote from influxdb2.configuration import Configuration -import influxdb2.models +import influxdb2.domain from influxdb2 import rest @@ -271,7 +271,7 @@ def __deserialize(self, data, klass): if klass in self.NATIVE_TYPES_MAPPING: klass = self.NATIVE_TYPES_MAPPING[klass] else: - klass = getattr(influxdb2.models, klass) + klass = getattr(influxdb2.domain, klass) if klass in self.PRIMITIVE_TYPES: return self.__deserialize_primitive(data, klass) diff --git a/influxdb2/client/__init__.py b/influxdb2/client/__init__.py index 128c3877..d109302f 100644 --- a/influxdb2/client/__init__.py +++ b/influxdb2/client/__init__.py @@ -3,25 +3,28 @@ # flake8: noqa # import apis into api package -from influxdb2.api.authorizations_api import AuthorizationsApi -from influxdb2.api.buckets_api import BucketsApi -from influxdb2.api.cells_api import CellsApi -from influxdb2.api.dashboards_api import DashboardsApi -from influxdb2.api.health_api import HealthApi -from influxdb2.api.labels_api import LabelsApi -from influxdb2.api.operation_logs_api import OperationLogsApi -from influxdb2.api.organizations_api import OrganizationsApi -from influxdb2.api.query_api import QueryApi -from influxdb2.api.ready_api import ReadyApi -from influxdb2.api.scraper_targets_api import ScraperTargetsApi -from influxdb2.api.secrets_api import SecretsApi -from influxdb2.api.setup_api import SetupApi -from influxdb2.api.sources_api import SourcesApi -from influxdb2.api.tasks_api import TasksApi -from influxdb2.api.telegrafs_api import TelegrafsApi -from influxdb2.api.templates_api import TemplatesApi -from influxdb2.api.users_api import UsersApi -from influxdb2.api.variables_api import VariablesApi -from influxdb2.api.views_api import ViewsApi -from influxdb2.api.write_api import WriteApi -from influxdb2.api.default_api import DefaultApi +from influxdb2.service.authorizations_service import AuthorizationsService +from influxdb2.service.buckets_service import BucketsService +from influxdb2.service.cells_service import CellsService +from influxdb2.service.checks_service import ChecksService +from influxdb2.service.dashboards_service import DashboardsService +from influxdb2.service.health_service import HealthService +from influxdb2.service.labels_service import LabelsService +from influxdb2.service.notification_endpoints_service import NotificationEndpointsService +from influxdb2.service.notification_rules_service import NotificationRulesService +from influxdb2.service.operation_logs_service import OperationLogsService +from influxdb2.service.organizations_service import OrganizationsService +from influxdb2.service.query_service import QueryService +from influxdb2.service.ready_service import ReadyService +from influxdb2.service.scraper_targets_service import ScraperTargetsService +from influxdb2.service.secrets_service import SecretsService +from influxdb2.service.setup_service import SetupService +from influxdb2.service.sources_service import SourcesService +from influxdb2.service.tasks_service import TasksService +from influxdb2.service.telegrafs_service import TelegrafsService +from influxdb2.service.templates_service import TemplatesService +from influxdb2.service.users_service import UsersService +from influxdb2.service.variables_service import VariablesService +from influxdb2.service.views_service import ViewsService +from influxdb2.service.write_service import WriteService +from influxdb2.service.default_service import DefaultService diff --git a/influxdb2/client/authorizations_client.py b/influxdb2/client/authorizations_api.py similarity index 80% rename from influxdb2/client/authorizations_client.py rename to influxdb2/client/authorizations_api.py index 8dbac550..a49cd31d 100644 --- a/influxdb2/client/authorizations_client.py +++ b/influxdb2/client/authorizations_api.py @@ -1,11 +1,11 @@ -from influxdb2 import Authorization, AuthorizationsApi, User, Organization +from influxdb2 import Authorization, AuthorizationsService, User, Organization -class AuthorizationsClient(object): +class AuthorizationsApi(object): def __init__(self, influxdb_client): self._influxdb_client = influxdb_client - self._authorizations_client = AuthorizationsApi(influxdb_client.api_client) + self._authorizations_service = AuthorizationsService(influxdb_client.api_client) def create_authorization(self, org_id=None, permissions: list = None, authorization: Authorization = None) -> Authorization: @@ -18,11 +18,11 @@ def create_authorization(self, org_id=None, permissions: list = None, """ if authorization is not None: - return self._authorizations_client.post_authorizations(authorization=authorization) + return self._authorizations_service.post_authorizations(authorization=authorization) # if org_id is not None and permissions is not None: authorization = Authorization(org_id=org_id, permissions=permissions) - return self._authorizations_client.post_authorizations(authorization=authorization) + return self._authorizations_service.post_authorizations(authorization=authorization) def find_authorization_by_id(self, auth_id: str) -> Authorization: """ @@ -30,7 +30,7 @@ def find_authorization_by_id(self, auth_id: str) -> Authorization: :param auth_id: authorization id :return: Authorization """ - return self._authorizations_client.get_authorizations_id(auth_id=auth_id) + return self._authorizations_service.get_authorizations_id(auth_id=auth_id) def find_authorizations(self, **kwargs): """ @@ -41,7 +41,7 @@ def find_authorizations(self, **kwargs): :param str org: filter authorizations belonging to a org name :return: Authorizations """ - authorizations = self._authorizations_client.get_authorizations(**kwargs) + authorizations = self._authorizations_service.get_authorizations(**kwargs) return authorizations.authorizations @@ -95,7 +95,7 @@ def update_authorization(self, auth): :param auth: :return: """ - return self._authorizations_client.patch_authorizations_id(auth_id=auth.id, authorization_update_request=auth) + return self._authorizations_service.patch_authorizations_id(auth_id=auth.id, authorization_update_request=auth) def clone_authorization(self, auth) -> Authorization: @@ -113,8 +113,8 @@ def clone_authorization(self, auth) -> Authorization: def delete_authorization(self, auth): if isinstance(auth, Authorization): - return self._authorizations_client.delete_authorizations_id(auth_id=auth.id) + return self._authorizations_service.delete_authorizations_id(auth_id=auth.id) if isinstance(auth, str): - return self._authorizations_client.delete_authorizations_id(auth_id=auth) + return self._authorizations_service.delete_authorizations_id(auth_id=auth) raise ValueError("Invalid argument") diff --git a/influxdb2/client/bucket_client.py b/influxdb2/client/bucket_api.py similarity index 81% rename from influxdb2/client/bucket_client.py rename to influxdb2/client/bucket_api.py index ea71e191..04186d89 100644 --- a/influxdb2/client/bucket_client.py +++ b/influxdb2/client/bucket_api.py @@ -1,11 +1,11 @@ -from influxdb2 import BucketsApi, Bucket +from influxdb2 import BucketsService, Bucket -class BucketsClient(object): +class BucketsApi(object): def __init__(self, influxdb_client): self._influxdb_client = influxdb_client - self._buckets_api = BucketsApi(influxdb_client.api_client) + self._buckets_service = BucketsService(influxdb_client.api_client) def create_bucket(self, bucket=None, bucket_name=None, org_id=None, retention_rules=None, description=None) -> Bucket: @@ -40,7 +40,7 @@ def create_bucket(self, bucket=None, bucket_name=None, org_id=None, retention_ru org_id = self._influxdb_client.org_id bucket.org_id = org_id - return self._buckets_api.post_buckets(bucket=bucket) + return self._buckets_service.post_buckets(bucket=bucket) def delete_bucket(self, bucket): """Delete a bucket # noqa: E501 @@ -56,7 +56,7 @@ def delete_bucket(self, bucket): else: bucket_id = bucket - return self._buckets_api.delete_buckets_id(bucket_id=bucket_id) + return self._buckets_service.delete_buckets_id(bucket_id=bucket_id) def find_bucket_by_id(self, id): """Find bucket by ID @@ -64,7 +64,7 @@ def find_bucket_by_id(self, id): :param id: :return: """ - return self._buckets_api.get_buckets_id(id) + return self._buckets_service.get_buckets_id(id) def find_bucket_by_name(self, bucket_name): """Find bucket by name @@ -73,7 +73,7 @@ def find_bucket_by_name(self, bucket_name): :return: Bucket """ - buckets = self._buckets_api.get_buckets(name=bucket_name) + buckets = self._buckets_service.get_buckets(name=bucket_name) if len(buckets.buckets) > 0: return buckets.buckets[0] @@ -83,4 +83,4 @@ def find_bucket_by_name(self, bucket_name): def find_buckets(self): """Gets all buckets """ - return self._buckets_api.get_buckets() + return self._buckets_service.get_buckets() diff --git a/influxdb2/client/influxdb_client.py b/influxdb2/client/influxdb_client.py index cdce87cf..4725c0ba 100644 --- a/influxdb2/client/influxdb_client.py +++ b/influxdb2/client/influxdb_client.py @@ -1,11 +1,11 @@ from __future__ import absolute_import import influxdb2 -from influxdb2.client.authorizations_client import AuthorizationsClient -from influxdb2.client.bucket_client import BucketsClient -from influxdb2.client.organizations_client import OrganizationsClient -from influxdb2.client.query_client import QueryClient -from influxdb2.client.users_client import UsersClient +from influxdb2.client.authorizations_api import AuthorizationsApi +from influxdb2.client.bucket_api import BucketsApi +from influxdb2.client.organizations_api import OrganizationsApi +from influxdb2.client.query_api import QueryApi +from influxdb2.client.users_api import UsersApi from influxdb2.client.write_api import WriteApiClient @@ -38,25 +38,25 @@ def __init__(self, self.api_client = influxdb2.ApiClient(configuration=conf, header_name=auth_header_name, header_value=auth_header_value) - def write_client(self): - service = influxdb2.api.write_api.WriteApi(self.api_client) + def write_api(self): + service = influxdb2.service.write_service.WriteService(self.api_client) return WriteApiClient(service=service) # return - def query_client(self): - return QueryClient(self) + def query_api(self): + return QueryApi(self) def __del__(self): self.api_client.__del__() - def buckets_client(self) -> BucketsClient: - return BucketsClient(self) + def buckets_api(self) -> BucketsApi: + return BucketsApi(self) - def authorizations_client(self) -> AuthorizationsClient: - return AuthorizationsClient(self) + def authorizations_api(self) -> AuthorizationsApi: + return AuthorizationsApi(self) - def users_client(self) -> UsersClient: - return UsersClient(self) + def users_api(self) -> UsersApi: + return UsersApi(self) - def organizations_client(self) -> OrganizationsClient: - return OrganizationsClient(self) + def organizations_api(self) -> OrganizationsApi: + return OrganizationsApi(self) diff --git a/influxdb2/client/organizations_api.py b/influxdb2/client/organizations_api.py new file mode 100644 index 00000000..d001871f --- /dev/null +++ b/influxdb2/client/organizations_api.py @@ -0,0 +1,24 @@ +from influxdb2 import OrganizationsService, UsersService, Organization + + +class OrganizationsApi(object): + + def __init__(self, influxdb_client): + self._influxdb_client = influxdb_client + self._organizations_service = OrganizationsService(influxdb_client.api_client) + self._users_service = UsersService(influxdb_client.api_client) + + def me(self): + user = self._users_service.get_me() + return user + + def find_organization(self, id): + return self._organizations_service.get_orgs_id(org_id=id) + + def find_organizations(self): + return self._organizations_service.get_orgs() + + def create_organization(self, name=None, organization=None) -> Organization: + if organization is None: + organization = Organization(name=name) + return self._organizations_service.post_orgs(organization) diff --git a/influxdb2/client/organizations_client.py b/influxdb2/client/organizations_client.py deleted file mode 100644 index 5938372e..00000000 --- a/influxdb2/client/organizations_client.py +++ /dev/null @@ -1,23 +0,0 @@ -from influxdb2 import OrganizationsApi, Organization - - -class OrganizationsClient(object): - - def __init__(self, influxdb_client): - self._influxdb_client = influxdb_client - self._organizations_api = OrganizationsApi(influxdb_client.api_client) - - def me(self): - user = self._users_api.get_me() - return user - - def find_organization(self, id): - return self._organizations_api.get_orgs_id(org_id=id) - - def find_organizations(self): - return self._organizations_api.get_orgs() - - def create_organization(self, name=None, organization=None) -> Organization: - if organization is None: - organization = Organization(name=name) - return self._organizations_api.post_orgs(organization) diff --git a/influxdb2/client/query_client.py b/influxdb2/client/query_api.py similarity index 90% rename from influxdb2/client/query_client.py rename to influxdb2/client/query_api.py index 4b005d6f..b3aea103 100644 --- a/influxdb2/client/query_client.py +++ b/influxdb2/client/query_api.py @@ -1,4 +1,4 @@ -from influxdb2 import Query, QueryApi +from influxdb2 import Query, QueryService import codecs import csv @@ -6,13 +6,13 @@ from influxdb2.client.flux_csv_parser import FluxCsvParser, FluxResponseConsumerTable -class QueryClient(object): +class QueryApi(object): default_dialect = Dialect(header=True, delimiter=",", comment_prefix="#", annotations=["datatype", "group", "default"], date_time_format="RFC3339") def __init__(self, influxdb_client): self._influxdb_client = influxdb_client - self._query_api = QueryApi(influxdb_client.api_client) + self._query_api = QueryService(influxdb_client.api_client) def query_csv(self, query, org=None, dialect=default_dialect): if org is None: @@ -25,7 +25,7 @@ def query_raw(self, query, org=None, dialect=default_dialect): if org is None: org = self._influxdb_client.org result = self._query_api.post_query(org=org, query=self._create_query(query, dialect), async_req=False, - _preload_content=False) + _preload_content=False) return result # return codecs.iterdecode(result, 'utf-8') diff --git a/influxdb2/client/users_client.py b/influxdb2/client/users_api.py similarity index 57% rename from influxdb2/client/users_client.py rename to influxdb2/client/users_api.py index cb31ef6a..7aad9067 100644 --- a/influxdb2/client/users_client.py +++ b/influxdb2/client/users_api.py @@ -1,11 +1,11 @@ -from influxdb2 import UsersApi +from influxdb2 import UsersService -class UsersClient(object): +class UsersApi(object): def __init__(self, influxdb_client): self._influxdb_client = influxdb_client - self._users_api = UsersApi(influxdb_client.api_client) + self._users_api = UsersService(influxdb_client.api_client) def me(self): user = self._users_api.get_me() diff --git a/influxdb2/client/write/__init__.py b/influxdb2/client/write/__init__.py index 128c3877..d109302f 100644 --- a/influxdb2/client/write/__init__.py +++ b/influxdb2/client/write/__init__.py @@ -3,25 +3,28 @@ # flake8: noqa # import apis into api package -from influxdb2.api.authorizations_api import AuthorizationsApi -from influxdb2.api.buckets_api import BucketsApi -from influxdb2.api.cells_api import CellsApi -from influxdb2.api.dashboards_api import DashboardsApi -from influxdb2.api.health_api import HealthApi -from influxdb2.api.labels_api import LabelsApi -from influxdb2.api.operation_logs_api import OperationLogsApi -from influxdb2.api.organizations_api import OrganizationsApi -from influxdb2.api.query_api import QueryApi -from influxdb2.api.ready_api import ReadyApi -from influxdb2.api.scraper_targets_api import ScraperTargetsApi -from influxdb2.api.secrets_api import SecretsApi -from influxdb2.api.setup_api import SetupApi -from influxdb2.api.sources_api import SourcesApi -from influxdb2.api.tasks_api import TasksApi -from influxdb2.api.telegrafs_api import TelegrafsApi -from influxdb2.api.templates_api import TemplatesApi -from influxdb2.api.users_api import UsersApi -from influxdb2.api.variables_api import VariablesApi -from influxdb2.api.views_api import ViewsApi -from influxdb2.api.write_api import WriteApi -from influxdb2.api.default_api import DefaultApi +from influxdb2.service.authorizations_service import AuthorizationsService +from influxdb2.service.buckets_service import BucketsService +from influxdb2.service.cells_service import CellsService +from influxdb2.service.checks_service import ChecksService +from influxdb2.service.dashboards_service import DashboardsService +from influxdb2.service.health_service import HealthService +from influxdb2.service.labels_service import LabelsService +from influxdb2.service.notification_endpoints_service import NotificationEndpointsService +from influxdb2.service.notification_rules_service import NotificationRulesService +from influxdb2.service.operation_logs_service import OperationLogsService +from influxdb2.service.organizations_service import OrganizationsService +from influxdb2.service.query_service import QueryService +from influxdb2.service.ready_service import ReadyService +from influxdb2.service.scraper_targets_service import ScraperTargetsService +from influxdb2.service.secrets_service import SecretsService +from influxdb2.service.setup_service import SetupService +from influxdb2.service.sources_service import SourcesService +from influxdb2.service.tasks_service import TasksService +from influxdb2.service.telegrafs_service import TelegrafsService +from influxdb2.service.templates_service import TemplatesService +from influxdb2.service.users_service import UsersService +from influxdb2.service.variables_service import VariablesService +from influxdb2.service.views_service import ViewsService +from influxdb2.service.write_service import WriteService +from influxdb2.service.default_service import DefaultService diff --git a/influxdb2/client/write/point.py b/influxdb2/client/write/point.py index c47e7606..b6622863 100644 --- a/influxdb2/client/write/point.py +++ b/influxdb2/client/write/point.py @@ -6,7 +6,7 @@ from pytz import UTC from six import iteritems, binary_type, PY2 -from influxdb2.models.write_precision import WritePrecision +from influxdb2.domain.write_precision import WritePrecision EPOCH = UTC.localize(datetime.utcfromtimestamp(0)) diff --git a/influxdb2/client/write_api.py b/influxdb2/client/write_api.py index 07e669b5..cdec888d 100644 --- a/influxdb2/client/write_api.py +++ b/influxdb2/client/write_api.py @@ -25,7 +25,7 @@ def __init__(self, batch_size=5000, flush_interval=1000, jitter_interval=0, retr class WriteApiClient(AbstractClient): def __init__(self, service, write_options=None) -> None: - self._write_api = service + self._write_service = service self.write_options = write_options _subject = Subject @@ -52,7 +52,7 @@ def write(self, bucket, org, record, write_precision=None): lines.append(item.to_line_protocol()) final_string = '\n'.join(lines) - return self._write_api.post_write(org=org, bucket=bucket, body=final_string, precision=write_precision) + return self._write_service.post_write(org=org, bucket=bucket, body=final_string, precision=write_precision) def flush(self): # TODO diff --git a/influxdb2/domain/__init__.py b/influxdb2/domain/__init__.py new file mode 100644 index 00000000..35ad0747 --- /dev/null +++ b/influxdb2/domain/__init__.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +# flake8: noqa +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +# import models into model package +from influxdb2.domain.ast_response import ASTResponse +from influxdb2.domain.add_resource_member_request_body import AddResourceMemberRequestBody +from influxdb2.domain.analyze_query_response import AnalyzeQueryResponse +from influxdb2.domain.analyze_query_response_errors import AnalyzeQueryResponseErrors +from influxdb2.domain.array_expression import ArrayExpression +from influxdb2.domain.authorization import Authorization +from influxdb2.domain.authorization_update_request import AuthorizationUpdateRequest +from influxdb2.domain.authorizations import Authorizations +from influxdb2.domain.axes import Axes +from influxdb2.domain.axis import Axis +from influxdb2.domain.axis_scale import AxisScale +from influxdb2.domain.bad_statement import BadStatement +from influxdb2.domain.binary_expression import BinaryExpression +from influxdb2.domain.block import Block +from influxdb2.domain.boolean_literal import BooleanLiteral +from influxdb2.domain.bucket import Bucket +from influxdb2.domain.bucket_links import BucketLinks +from influxdb2.domain.bucket_retention_rules import BucketRetentionRules +from influxdb2.domain.buckets import Buckets +from influxdb2.domain.builder_config import BuilderConfig +from influxdb2.domain.builder_config_aggregate_window import BuilderConfigAggregateWindow +from influxdb2.domain.builder_functions_type import BuilderFunctionsType +from influxdb2.domain.builder_tags_type import BuilderTagsType +from influxdb2.domain.builtin_statement import BuiltinStatement +from influxdb2.domain.call_expression import CallExpression +from influxdb2.domain.cell import Cell +from influxdb2.domain.cell_links import CellLinks +from influxdb2.domain.cell_update import CellUpdate +from influxdb2.domain.check import Check +from influxdb2.domain.check_base import CheckBase +from influxdb2.domain.check_base_tags import CheckBaseTags +from influxdb2.domain.check_status_level import CheckStatusLevel +from influxdb2.domain.check_view_properties import CheckViewProperties +from influxdb2.domain.checks import Checks +from influxdb2.domain.conditional_expression import ConditionalExpression +from influxdb2.domain.constant_variable_properties import ConstantVariableProperties +from influxdb2.domain.create_cell import CreateCell +from influxdb2.domain.create_dashboard_request import CreateDashboardRequest +from influxdb2.domain.dashboard import Dashboard +from influxdb2.domain.dashboard_color import DashboardColor +from influxdb2.domain.dashboard_query import DashboardQuery +from influxdb2.domain.dashboards import Dashboards +from influxdb2.domain.date_time_literal import DateTimeLiteral +from influxdb2.domain.deadman_check import DeadmanCheck +from influxdb2.domain.decimal_places import DecimalPlaces +from influxdb2.domain.dialect import Dialect +from influxdb2.domain.document import Document +from influxdb2.domain.document_create import DocumentCreate +from influxdb2.domain.document_links import DocumentLinks +from influxdb2.domain.document_list_entry import DocumentListEntry +from influxdb2.domain.document_meta import DocumentMeta +from influxdb2.domain.document_update import DocumentUpdate +from influxdb2.domain.documents import Documents +from influxdb2.domain.duration import Duration +from influxdb2.domain.duration_literal import DurationLiteral +from influxdb2.domain.error import Error +from influxdb2.domain.expression import Expression +from influxdb2.domain.expression_statement import ExpressionStatement +from influxdb2.domain.field import Field +from influxdb2.domain.file import File +from influxdb2.domain.float_literal import FloatLiteral +from influxdb2.domain.flux_suggestion import FluxSuggestion +from influxdb2.domain.flux_suggestions import FluxSuggestions +from influxdb2.domain.function_expression import FunctionExpression +from influxdb2.domain.gauge_view_properties import GaugeViewProperties +from influxdb2.domain.health_check import HealthCheck +from influxdb2.domain.heatmap_view_properties import HeatmapViewProperties +from influxdb2.domain.histogram_view_properties import HistogramViewProperties +from influxdb2.domain.identifier import Identifier +from influxdb2.domain.import_declaration import ImportDeclaration +from influxdb2.domain.index_expression import IndexExpression +from influxdb2.domain.integer_literal import IntegerLiteral +from influxdb2.domain.is_onboarding import IsOnboarding +from influxdb2.domain.label import Label +from influxdb2.domain.label_create_request import LabelCreateRequest +from influxdb2.domain.label_mapping import LabelMapping +from influxdb2.domain.label_response import LabelResponse +from influxdb2.domain.label_update import LabelUpdate +from influxdb2.domain.labels_response import LabelsResponse +from influxdb2.domain.language_request import LanguageRequest +from influxdb2.domain.legend import Legend +from influxdb2.domain.level_rule import LevelRule +from influxdb2.domain.line_plus_single_stat_properties import LinePlusSingleStatProperties +from influxdb2.domain.line_protocol_error import LineProtocolError +from influxdb2.domain.line_protocol_length_error import LineProtocolLengthError +from influxdb2.domain.links import Links +from influxdb2.domain.log_event import LogEvent +from influxdb2.domain.logical_expression import LogicalExpression +from influxdb2.domain.logs import Logs +from influxdb2.domain.map_variable_properties import MapVariableProperties +from influxdb2.domain.markdown_view_properties import MarkdownViewProperties +from influxdb2.domain.member_assignment import MemberAssignment +from influxdb2.domain.member_expression import MemberExpression +from influxdb2.domain.model_property import ModelProperty +from influxdb2.domain.node import Node +from influxdb2.domain.notification_endpoint import NotificationEndpoint +from influxdb2.domain.notification_endpoint_base import NotificationEndpointBase +from influxdb2.domain.notification_endpoints import NotificationEndpoints +from influxdb2.domain.notification_rule import NotificationRule +from influxdb2.domain.notification_rule_base import NotificationRuleBase +from influxdb2.domain.notification_rule_update import NotificationRuleUpdate +from influxdb2.domain.notification_rules import NotificationRules +from influxdb2.domain.object_expression import ObjectExpression +from influxdb2.domain.onboarding_request import OnboardingRequest +from influxdb2.domain.onboarding_response import OnboardingResponse +from influxdb2.domain.operation_log import OperationLog +from influxdb2.domain.operation_log_links import OperationLogLinks +from influxdb2.domain.operation_logs import OperationLogs +from influxdb2.domain.option_statement import OptionStatement +from influxdb2.domain.organization import Organization +from influxdb2.domain.organization_links import OrganizationLinks +from influxdb2.domain.organizations import Organizations +from influxdb2.domain.package import Package +from influxdb2.domain.package_clause import PackageClause +from influxdb2.domain.pager_duty_notification_endpoint import PagerDutyNotificationEndpoint +from influxdb2.domain.pager_duty_notification_rule import PagerDutyNotificationRule +from influxdb2.domain.password_reset_body import PasswordResetBody +from influxdb2.domain.permission import Permission +from influxdb2.domain.permission_resource import PermissionResource +from influxdb2.domain.pipe_expression import PipeExpression +from influxdb2.domain.pipe_literal import PipeLiteral +from influxdb2.domain.property_key import PropertyKey +from influxdb2.domain.query import Query +from influxdb2.domain.query_edit_mode import QueryEditMode +from influxdb2.domain.query_variable_properties import QueryVariableProperties +from influxdb2.domain.query_variable_properties_values import QueryVariablePropertiesValues +from influxdb2.domain.ready import Ready +from influxdb2.domain.regexp_literal import RegexpLiteral +from influxdb2.domain.renamable_field import RenamableField +from influxdb2.domain.resource_member import ResourceMember +from influxdb2.domain.resource_members import ResourceMembers +from influxdb2.domain.resource_owner import ResourceOwner +from influxdb2.domain.resource_owners import ResourceOwners +from influxdb2.domain.return_statement import ReturnStatement +from influxdb2.domain.routes import Routes +from influxdb2.domain.routes_external import RoutesExternal +from influxdb2.domain.routes_query import RoutesQuery +from influxdb2.domain.routes_system import RoutesSystem +from influxdb2.domain.run import Run +from influxdb2.domain.run_links import RunLinks +from influxdb2.domain.run_log import RunLog +from influxdb2.domain.run_manually import RunManually +from influxdb2.domain.runs import Runs +from influxdb2.domain.smtp_notification_endpoint import SMTPNotificationEndpoint +from influxdb2.domain.smtp_notification_rule import SMTPNotificationRule +from influxdb2.domain.scatter_view_properties import ScatterViewProperties +from influxdb2.domain.scraper_target_request import ScraperTargetRequest +from influxdb2.domain.scraper_target_response import ScraperTargetResponse +from influxdb2.domain.scraper_target_responses import ScraperTargetResponses +from influxdb2.domain.secret_keys import SecretKeys +from influxdb2.domain.secret_keys_response import SecretKeysResponse +from influxdb2.domain.single_stat_view_properties import SingleStatViewProperties +from influxdb2.domain.slack_notification_endpoint import SlackNotificationEndpoint +from influxdb2.domain.slack_notification_rule import SlackNotificationRule +from influxdb2.domain.source import Source +from influxdb2.domain.source_links import SourceLinks +from influxdb2.domain.sources import Sources +from influxdb2.domain.statement import Statement +from influxdb2.domain.status_rule import StatusRule +from influxdb2.domain.string_literal import StringLiteral +from influxdb2.domain.table_view_properties import TableViewProperties +from influxdb2.domain.tag_rule import TagRule +from influxdb2.domain.task import Task +from influxdb2.domain.task_create_request import TaskCreateRequest +from influxdb2.domain.task_links import TaskLinks +from influxdb2.domain.task_status_type import TaskStatusType +from influxdb2.domain.task_update_request import TaskUpdateRequest +from influxdb2.domain.tasks import Tasks +from influxdb2.domain.telegraf import Telegraf +from influxdb2.domain.telegraf_plugin_input_cpu import TelegrafPluginInputCpu +from influxdb2.domain.telegraf_plugin_input_disk import TelegrafPluginInputDisk +from influxdb2.domain.telegraf_plugin_input_diskio import TelegrafPluginInputDiskio +from influxdb2.domain.telegraf_plugin_input_docker import TelegrafPluginInputDocker +from influxdb2.domain.telegraf_plugin_input_docker_config import TelegrafPluginInputDockerConfig +from influxdb2.domain.telegraf_plugin_input_file import TelegrafPluginInputFile +from influxdb2.domain.telegraf_plugin_input_file_config import TelegrafPluginInputFileConfig +from influxdb2.domain.telegraf_plugin_input_kernel import TelegrafPluginInputKernel +from influxdb2.domain.telegraf_plugin_input_kubernetes import TelegrafPluginInputKubernetes +from influxdb2.domain.telegraf_plugin_input_kubernetes_config import TelegrafPluginInputKubernetesConfig +from influxdb2.domain.telegraf_plugin_input_log_parser import TelegrafPluginInputLogParser +from influxdb2.domain.telegraf_plugin_input_log_parser_config import TelegrafPluginInputLogParserConfig +from influxdb2.domain.telegraf_plugin_input_mem import TelegrafPluginInputMem +from influxdb2.domain.telegraf_plugin_input_net import TelegrafPluginInputNet +from influxdb2.domain.telegraf_plugin_input_net_response import TelegrafPluginInputNetResponse +from influxdb2.domain.telegraf_plugin_input_nginx import TelegrafPluginInputNginx +from influxdb2.domain.telegraf_plugin_input_processes import TelegrafPluginInputProcesses +from influxdb2.domain.telegraf_plugin_input_procstat import TelegrafPluginInputProcstat +from influxdb2.domain.telegraf_plugin_input_procstat_config import TelegrafPluginInputProcstatConfig +from influxdb2.domain.telegraf_plugin_input_prometheus import TelegrafPluginInputPrometheus +from influxdb2.domain.telegraf_plugin_input_prometheus_config import TelegrafPluginInputPrometheusConfig +from influxdb2.domain.telegraf_plugin_input_redis import TelegrafPluginInputRedis +from influxdb2.domain.telegraf_plugin_input_redis_config import TelegrafPluginInputRedisConfig +from influxdb2.domain.telegraf_plugin_input_swap import TelegrafPluginInputSwap +from influxdb2.domain.telegraf_plugin_input_syslog import TelegrafPluginInputSyslog +from influxdb2.domain.telegraf_plugin_input_syslog_config import TelegrafPluginInputSyslogConfig +from influxdb2.domain.telegraf_plugin_input_system import TelegrafPluginInputSystem +from influxdb2.domain.telegraf_plugin_input_tail import TelegrafPluginInputTail +from influxdb2.domain.telegraf_plugin_output_file import TelegrafPluginOutputFile +from influxdb2.domain.telegraf_plugin_output_file_config import TelegrafPluginOutputFileConfig +from influxdb2.domain.telegraf_plugin_output_file_config_files import TelegrafPluginOutputFileConfigFiles +from influxdb2.domain.telegraf_plugin_output_influx_dbv2 import TelegrafPluginOutputInfluxDBV2 +from influxdb2.domain.telegraf_plugin_output_influx_dbv2_config import TelegrafPluginOutputInfluxDBV2Config +from influxdb2.domain.telegraf_request import TelegrafRequest +from influxdb2.domain.telegraf_request_agent import TelegrafRequestAgent +from influxdb2.domain.telegraf_request_plugin import TelegrafRequestPlugin +from influxdb2.domain.telegrafs import Telegrafs +from influxdb2.domain.test_statement import TestStatement +from influxdb2.domain.threshold import Threshold +from influxdb2.domain.threshold_check import ThresholdCheck +from influxdb2.domain.unary_expression import UnaryExpression +from influxdb2.domain.unsigned_integer_literal import UnsignedIntegerLiteral +from influxdb2.domain.user import User +from influxdb2.domain.user_links import UserLinks +from influxdb2.domain.users import Users +from influxdb2.domain.users_links import UsersLinks +from influxdb2.domain.variable import Variable +from influxdb2.domain.variable_assignment import VariableAssignment +from influxdb2.domain.variable_links import VariableLinks +from influxdb2.domain.variables import Variables +from influxdb2.domain.view import View +from influxdb2.domain.view_links import ViewLinks +from influxdb2.domain.view_properties import ViewProperties +from influxdb2.domain.views import Views +from influxdb2.domain.webhook_notification_endpoint import WebhookNotificationEndpoint +from influxdb2.domain.write_precision import WritePrecision +from influxdb2.domain.xy_geom import XYGeom +from influxdb2.domain.xy_view_properties import XYViewProperties diff --git a/influxdb2/models/add_resource_member_request_body.py b/influxdb2/domain/add_resource_member_request_body.py similarity index 100% rename from influxdb2/models/add_resource_member_request_body.py rename to influxdb2/domain/add_resource_member_request_body.py diff --git a/influxdb2/models/analyze_query_response.py b/influxdb2/domain/analyze_query_response.py similarity index 100% rename from influxdb2/models/analyze_query_response.py rename to influxdb2/domain/analyze_query_response.py diff --git a/influxdb2/models/analyze_query_response_errors.py b/influxdb2/domain/analyze_query_response_errors.py similarity index 100% rename from influxdb2/models/analyze_query_response_errors.py rename to influxdb2/domain/analyze_query_response_errors.py diff --git a/influxdb2/models/array_expression.py b/influxdb2/domain/array_expression.py similarity index 100% rename from influxdb2/models/array_expression.py rename to influxdb2/domain/array_expression.py diff --git a/influxdb2/models/ast_response.py b/influxdb2/domain/ast_response.py similarity index 100% rename from influxdb2/models/ast_response.py rename to influxdb2/domain/ast_response.py diff --git a/influxdb2/models/authorization.py b/influxdb2/domain/authorization.py similarity index 100% rename from influxdb2/models/authorization.py rename to influxdb2/domain/authorization.py diff --git a/influxdb2/models/authorization_update_request.py b/influxdb2/domain/authorization_update_request.py similarity index 100% rename from influxdb2/models/authorization_update_request.py rename to influxdb2/domain/authorization_update_request.py diff --git a/influxdb2/models/authorizations.py b/influxdb2/domain/authorizations.py similarity index 100% rename from influxdb2/models/authorizations.py rename to influxdb2/domain/authorizations.py diff --git a/influxdb2/models/axes.py b/influxdb2/domain/axes.py similarity index 81% rename from influxdb2/models/axes.py rename to influxdb2/domain/axes.py index b797230a..bcc200e9 100644 --- a/influxdb2/models/axes.py +++ b/influxdb2/domain/axes.py @@ -32,30 +32,23 @@ class Axes(object): """ openapi_types = { 'x': 'Axis', - 'y': 'Axis', - 'y2': 'Axis' + 'y': 'Axis' } attribute_map = { 'x': 'x', - 'y': 'y', - 'y2': 'y2' + 'y': 'y' } - def __init__(self, x=None, y=None, y2=None): # noqa: E501 + def __init__(self, x=None, y=None): # noqa: E501 """Axes - a model defined in OpenAPI""" # noqa: E501 self._x = None self._y = None - self._y2 = None self.discriminator = None - if x is not None: - self.x = x - if y is not None: - self.y = y - if y2 is not None: - self.y2 = y2 + self.x = x + self.y = y @property def x(self): @@ -75,6 +68,8 @@ def x(self, x): :param x: The x of this Axes. # noqa: E501 :type: Axis """ + if x is None: + raise ValueError("Invalid value for `x`, must not be `None`") # noqa: E501 self._x = x @@ -96,30 +91,11 @@ def y(self, y): :param y: The y of this Axes. # noqa: E501 :type: Axis """ + if y is None: + raise ValueError("Invalid value for `y`, must not be `None`") # noqa: E501 self._y = y - @property - def y2(self): - """Gets the y2 of this Axes. # noqa: E501 - - - :return: The y2 of this Axes. # noqa: E501 - :rtype: Axis - """ - return self._y2 - - @y2.setter - def y2(self, y2): - """Sets the y2 of this Axes. - - - :param y2: The y2 of this Axes. # noqa: E501 - :type: Axis - """ - - self._y2 = y2 - def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/influxdb2/models/axis.py b/influxdb2/domain/axis.py similarity index 93% rename from influxdb2/models/axis.py rename to influxdb2/domain/axis.py index 6af446ca..37594cbd 100644 --- a/influxdb2/models/axis.py +++ b/influxdb2/domain/axis.py @@ -31,12 +31,12 @@ class Axis(object): and the value is json key in definition. """ openapi_types = { - 'bounds': 'list[int]', + 'bounds': 'list[str]', 'label': 'str', 'prefix': 'str', 'suffix': 'str', 'base': 'str', - 'scale': 'str' + 'scale': 'AxisScale' } attribute_map = { @@ -79,7 +79,7 @@ def bounds(self): The extents of an axis in the form [lower, upper]. Clients determine whether bounds are to be inclusive or exclusive of their limits # noqa: E501 :return: The bounds of this Axis. # noqa: E501 - :rtype: list[int] + :rtype: list[str] """ return self._bounds @@ -90,7 +90,7 @@ def bounds(self, bounds): The extents of an axis in the form [lower, upper]. Clients determine whether bounds are to be inclusive or exclusive of their limits # noqa: E501 :param bounds: The bounds of this Axis. # noqa: E501 - :type: list[int] + :type: list[str] """ self._bounds = bounds @@ -184,6 +184,12 @@ def base(self, base): :param base: The base of this Axis. # noqa: E501 :type: str """ + allowed_values = ["", "2", "10"] # noqa: E501 + if base not in allowed_values: + raise ValueError( + "Invalid value for `base` ({0}), must be one of {1}" # noqa: E501 + .format(base, allowed_values) + ) self._base = base @@ -191,10 +197,9 @@ def base(self, base): def scale(self): """Gets the scale of this Axis. # noqa: E501 - Scale is the axis formatting scale. Supported: \"log\", \"linear\" # noqa: E501 :return: The scale of this Axis. # noqa: E501 - :rtype: str + :rtype: AxisScale """ return self._scale @@ -202,10 +207,9 @@ def scale(self): def scale(self, scale): """Sets the scale of this Axis. - Scale is the axis formatting scale. Supported: \"log\", \"linear\" # noqa: E501 :param scale: The scale of this Axis. # noqa: E501 - :type: str + :type: AxisScale """ self._scale = scale diff --git a/influxdb2/domain/axis_scale.py b/influxdb2/domain/axis_scale.py new file mode 100644 index 00000000..d0b1a9a9 --- /dev/null +++ b/influxdb2/domain/axis_scale.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class AxisScale(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + LOG = "log" + LINEAR = "linear" + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """AxisScale - a model defined in OpenAPI""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AxisScale): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/models/bad_statement.py b/influxdb2/domain/bad_statement.py similarity index 100% rename from influxdb2/models/bad_statement.py rename to influxdb2/domain/bad_statement.py diff --git a/influxdb2/models/binary_expression.py b/influxdb2/domain/binary_expression.py similarity index 100% rename from influxdb2/models/binary_expression.py rename to influxdb2/domain/binary_expression.py diff --git a/influxdb2/models/block.py b/influxdb2/domain/block.py similarity index 100% rename from influxdb2/models/block.py rename to influxdb2/domain/block.py diff --git a/influxdb2/models/boolean_literal.py b/influxdb2/domain/boolean_literal.py similarity index 100% rename from influxdb2/models/boolean_literal.py rename to influxdb2/domain/boolean_literal.py diff --git a/influxdb2/models/bucket.py b/influxdb2/domain/bucket.py similarity index 100% rename from influxdb2/models/bucket.py rename to influxdb2/domain/bucket.py diff --git a/influxdb2/models/bucket_links.py b/influxdb2/domain/bucket_links.py similarity index 100% rename from influxdb2/models/bucket_links.py rename to influxdb2/domain/bucket_links.py diff --git a/influxdb2/models/bucket_retention_rules.py b/influxdb2/domain/bucket_retention_rules.py similarity index 100% rename from influxdb2/models/bucket_retention_rules.py rename to influxdb2/domain/bucket_retention_rules.py diff --git a/influxdb2/models/buckets.py b/influxdb2/domain/buckets.py similarity index 100% rename from influxdb2/models/buckets.py rename to influxdb2/domain/buckets.py diff --git a/influxdb2/domain/builder_config.py b/influxdb2/domain/builder_config.py new file mode 100644 index 00000000..64d1b878 --- /dev/null +++ b/influxdb2/domain/builder_config.py @@ -0,0 +1,190 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class BuilderConfig(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'buckets': 'list[str]', + 'tags': 'list[BuilderTagsType]', + 'functions': 'list[BuilderFunctionsType]', + 'aggregate_window': 'BuilderConfigAggregateWindow' + } + + attribute_map = { + 'buckets': 'buckets', + 'tags': 'tags', + 'functions': 'functions', + 'aggregate_window': 'aggregateWindow' + } + + def __init__(self, buckets=None, tags=None, functions=None, aggregate_window=None): # noqa: E501 + """BuilderConfig - a model defined in OpenAPI""" # noqa: E501 + + self._buckets = None + self._tags = None + self._functions = None + self._aggregate_window = None + self.discriminator = None + + if buckets is not None: + self.buckets = buckets + if tags is not None: + self.tags = tags + if functions is not None: + self.functions = functions + if aggregate_window is not None: + self.aggregate_window = aggregate_window + + @property + def buckets(self): + """Gets the buckets of this BuilderConfig. # noqa: E501 + + + :return: The buckets of this BuilderConfig. # noqa: E501 + :rtype: list[str] + """ + return self._buckets + + @buckets.setter + def buckets(self, buckets): + """Sets the buckets of this BuilderConfig. + + + :param buckets: The buckets of this BuilderConfig. # noqa: E501 + :type: list[str] + """ + + self._buckets = buckets + + @property + def tags(self): + """Gets the tags of this BuilderConfig. # noqa: E501 + + + :return: The tags of this BuilderConfig. # noqa: E501 + :rtype: list[BuilderTagsType] + """ + return self._tags + + @tags.setter + def tags(self, tags): + """Sets the tags of this BuilderConfig. + + + :param tags: The tags of this BuilderConfig. # noqa: E501 + :type: list[BuilderTagsType] + """ + + self._tags = tags + + @property + def functions(self): + """Gets the functions of this BuilderConfig. # noqa: E501 + + + :return: The functions of this BuilderConfig. # noqa: E501 + :rtype: list[BuilderFunctionsType] + """ + return self._functions + + @functions.setter + def functions(self, functions): + """Sets the functions of this BuilderConfig. + + + :param functions: The functions of this BuilderConfig. # noqa: E501 + :type: list[BuilderFunctionsType] + """ + + self._functions = functions + + @property + def aggregate_window(self): + """Gets the aggregate_window of this BuilderConfig. # noqa: E501 + + + :return: The aggregate_window of this BuilderConfig. # noqa: E501 + :rtype: BuilderConfigAggregateWindow + """ + return self._aggregate_window + + @aggregate_window.setter + def aggregate_window(self, aggregate_window): + """Sets the aggregate_window of this BuilderConfig. + + + :param aggregate_window: The aggregate_window of this BuilderConfig. # noqa: E501 + :type: BuilderConfigAggregateWindow + """ + + self._aggregate_window = aggregate_window + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BuilderConfig): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/domain/builder_config_aggregate_window.py b/influxdb2/domain/builder_config_aggregate_window.py new file mode 100644 index 00000000..07749eb2 --- /dev/null +++ b/influxdb2/domain/builder_config_aggregate_window.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class BuilderConfigAggregateWindow(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'period': 'str' + } + + attribute_map = { + 'period': 'period' + } + + def __init__(self, period=None): # noqa: E501 + """BuilderConfigAggregateWindow - a model defined in OpenAPI""" # noqa: E501 + + self._period = None + self.discriminator = None + + if period is not None: + self.period = period + + @property + def period(self): + """Gets the period of this BuilderConfigAggregateWindow. # noqa: E501 + + + :return: The period of this BuilderConfigAggregateWindow. # noqa: E501 + :rtype: str + """ + return self._period + + @period.setter + def period(self, period): + """Sets the period of this BuilderConfigAggregateWindow. + + + :param period: The period of this BuilderConfigAggregateWindow. # noqa: E501 + :type: str + """ + + self._period = period + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BuilderConfigAggregateWindow): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/domain/builder_functions_type.py b/influxdb2/domain/builder_functions_type.py new file mode 100644 index 00000000..533975f3 --- /dev/null +++ b/influxdb2/domain/builder_functions_type.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class BuilderFunctionsType(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'name': 'str' + } + + attribute_map = { + 'name': 'name' + } + + def __init__(self, name=None): # noqa: E501 + """BuilderFunctionsType - a model defined in OpenAPI""" # noqa: E501 + + self._name = None + self.discriminator = None + + if name is not None: + self.name = name + + @property + def name(self): + """Gets the name of this BuilderFunctionsType. # noqa: E501 + + + :return: The name of this BuilderFunctionsType. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this BuilderFunctionsType. + + + :param name: The name of this BuilderFunctionsType. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BuilderFunctionsType): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/models/query_config_group_by.py b/influxdb2/domain/builder_tags_type.py similarity index 62% rename from influxdb2/models/query_config_group_by.py rename to influxdb2/domain/builder_tags_type.py index ab34ed94..8040bf3c 100644 --- a/influxdb2/models/query_config_group_by.py +++ b/influxdb2/domain/builder_tags_type.py @@ -16,7 +16,7 @@ import six -class QueryConfigGroupBy(object): +class BuilderTagsType(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -31,70 +31,68 @@ class QueryConfigGroupBy(object): and the value is json key in definition. """ openapi_types = { - 'time': 'str', - 'tags': 'list[str]' + 'key': 'str', + 'values': 'list[str]' } attribute_map = { - 'time': 'time', - 'tags': 'tags' + 'key': 'key', + 'values': 'values' } - def __init__(self, time=None, tags=None): # noqa: E501 - """QueryConfigGroupBy - a model defined in OpenAPI""" # noqa: E501 + def __init__(self, key=None, values=None): # noqa: E501 + """BuilderTagsType - a model defined in OpenAPI""" # noqa: E501 - self._time = None - self._tags = None + self._key = None + self._values = None self.discriminator = None - self.time = time - self.tags = tags + if key is not None: + self.key = key + if values is not None: + self.values = values @property - def time(self): - """Gets the time of this QueryConfigGroupBy. # noqa: E501 + def key(self): + """Gets the key of this BuilderTagsType. # noqa: E501 - :return: The time of this QueryConfigGroupBy. # noqa: E501 + :return: The key of this BuilderTagsType. # noqa: E501 :rtype: str """ - return self._time + return self._key - @time.setter - def time(self, time): - """Sets the time of this QueryConfigGroupBy. + @key.setter + def key(self, key): + """Sets the key of this BuilderTagsType. - :param time: The time of this QueryConfigGroupBy. # noqa: E501 + :param key: The key of this BuilderTagsType. # noqa: E501 :type: str """ - if time is None: - raise ValueError("Invalid value for `time`, must not be `None`") # noqa: E501 - self._time = time + self._key = key @property - def tags(self): - """Gets the tags of this QueryConfigGroupBy. # noqa: E501 + def values(self): + """Gets the values of this BuilderTagsType. # noqa: E501 - :return: The tags of this QueryConfigGroupBy. # noqa: E501 + :return: The values of this BuilderTagsType. # noqa: E501 :rtype: list[str] """ - return self._tags + return self._values - @tags.setter - def tags(self, tags): - """Sets the tags of this QueryConfigGroupBy. + @values.setter + def values(self, values): + """Sets the values of this BuilderTagsType. - :param tags: The tags of this QueryConfigGroupBy. # noqa: E501 + :param values: The values of this BuilderTagsType. # noqa: E501 :type: list[str] """ - if tags is None: - raise ValueError("Invalid value for `tags`, must not be `None`") # noqa: E501 - self._tags = tags + self._values = values def to_dict(self): """Returns the model properties as a dict""" @@ -130,7 +128,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, QueryConfigGroupBy): + if not isinstance(other, BuilderTagsType): return False return self.__dict__ == other.__dict__ diff --git a/influxdb2/models/builtin_statement.py b/influxdb2/domain/builtin_statement.py similarity index 100% rename from influxdb2/models/builtin_statement.py rename to influxdb2/domain/builtin_statement.py diff --git a/influxdb2/models/call_expression.py b/influxdb2/domain/call_expression.py similarity index 100% rename from influxdb2/models/call_expression.py rename to influxdb2/domain/call_expression.py diff --git a/influxdb2/models/cell.py b/influxdb2/domain/cell.py similarity index 100% rename from influxdb2/models/cell.py rename to influxdb2/domain/cell.py diff --git a/influxdb2/models/cell_links.py b/influxdb2/domain/cell_links.py similarity index 100% rename from influxdb2/models/cell_links.py rename to influxdb2/domain/cell_links.py diff --git a/influxdb2/models/cell_update.py b/influxdb2/domain/cell_update.py similarity index 100% rename from influxdb2/models/cell_update.py rename to influxdb2/domain/cell_update.py diff --git a/influxdb2/domain/check.py b/influxdb2/domain/check.py new file mode 100644 index 00000000..60b4d3c1 --- /dev/null +++ b/influxdb2/domain/check.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Check(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """Check - a model defined in OpenAPI""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Check): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/domain/check_base.py b/influxdb2/domain/check_base.py new file mode 100644 index 00000000..7b2bc6a9 --- /dev/null +++ b/influxdb2/domain/check_base.py @@ -0,0 +1,495 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class CheckBase(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'str', + 'name': 'str', + 'org_id': 'str', + 'authorization_id': 'str', + 'created_at': 'datetime', + 'updated_at': 'datetime', + 'query': 'DashboardQuery', + 'status': 'TaskStatusType', + 'every': 'str', + 'offset': 'str', + 'cron': 'str', + 'tags': 'list[CheckBaseTags]', + 'description': 'str', + 'status_message_template': 'str', + 'labels': 'list[Label]' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'org_id': 'orgID', + 'authorization_id': 'authorizationID', + 'created_at': 'createdAt', + 'updated_at': 'updatedAt', + 'query': 'query', + 'status': 'status', + 'every': 'every', + 'offset': 'offset', + 'cron': 'cron', + 'tags': 'tags', + 'description': 'description', + 'status_message_template': 'statusMessageTemplate', + 'labels': 'labels' + } + + def __init__(self, id=None, name=None, org_id=None, authorization_id=None, created_at=None, updated_at=None, query=None, status=None, every=None, offset=None, cron=None, tags=None, description=None, status_message_template=None, labels=None): # noqa: E501 + """CheckBase - a model defined in OpenAPI""" # noqa: E501 + + self._id = None + self._name = None + self._org_id = None + self._authorization_id = None + self._created_at = None + self._updated_at = None + self._query = None + self._status = None + self._every = None + self._offset = None + self._cron = None + self._tags = None + self._description = None + self._status_message_template = None + self._labels = None + self.discriminator = None + + if id is not None: + self.id = id + self.name = name + self.org_id = org_id + if authorization_id is not None: + self.authorization_id = authorization_id + if created_at is not None: + self.created_at = created_at + if updated_at is not None: + self.updated_at = updated_at + self.query = query + if status is not None: + self.status = status + if every is not None: + self.every = every + if offset is not None: + self.offset = offset + if cron is not None: + self.cron = cron + if tags is not None: + self.tags = tags + if description is not None: + self.description = description + if status_message_template is not None: + self.status_message_template = status_message_template + if labels is not None: + self.labels = labels + + @property + def id(self): + """Gets the id of this CheckBase. # noqa: E501 + + + :return: The id of this CheckBase. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this CheckBase. + + + :param id: The id of this CheckBase. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def name(self): + """Gets the name of this CheckBase. # noqa: E501 + + + :return: The name of this CheckBase. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this CheckBase. + + + :param name: The name of this CheckBase. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def org_id(self): + """Gets the org_id of this CheckBase. # noqa: E501 + + the ID of the organization that owns this check. # noqa: E501 + + :return: The org_id of this CheckBase. # noqa: E501 + :rtype: str + """ + return self._org_id + + @org_id.setter + def org_id(self, org_id): + """Sets the org_id of this CheckBase. + + the ID of the organization that owns this check. # noqa: E501 + + :param org_id: The org_id of this CheckBase. # noqa: E501 + :type: str + """ + if org_id is None: + raise ValueError("Invalid value for `org_id`, must not be `None`") # noqa: E501 + + self._org_id = org_id + + @property + def authorization_id(self): + """Gets the authorization_id of this CheckBase. # noqa: E501 + + The ID of the authorization used to create this check. # noqa: E501 + + :return: The authorization_id of this CheckBase. # noqa: E501 + :rtype: str + """ + return self._authorization_id + + @authorization_id.setter + def authorization_id(self, authorization_id): + """Sets the authorization_id of this CheckBase. + + The ID of the authorization used to create this check. # noqa: E501 + + :param authorization_id: The authorization_id of this CheckBase. # noqa: E501 + :type: str + """ + + self._authorization_id = authorization_id + + @property + def created_at(self): + """Gets the created_at of this CheckBase. # noqa: E501 + + + :return: The created_at of this CheckBase. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this CheckBase. + + + :param created_at: The created_at of this CheckBase. # noqa: E501 + :type: datetime + """ + + self._created_at = created_at + + @property + def updated_at(self): + """Gets the updated_at of this CheckBase. # noqa: E501 + + + :return: The updated_at of this CheckBase. # noqa: E501 + :rtype: datetime + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this CheckBase. + + + :param updated_at: The updated_at of this CheckBase. # noqa: E501 + :type: datetime + """ + + self._updated_at = updated_at + + @property + def query(self): + """Gets the query of this CheckBase. # noqa: E501 + + + :return: The query of this CheckBase. # noqa: E501 + :rtype: DashboardQuery + """ + return self._query + + @query.setter + def query(self, query): + """Sets the query of this CheckBase. + + + :param query: The query of this CheckBase. # noqa: E501 + :type: DashboardQuery + """ + if query is None: + raise ValueError("Invalid value for `query`, must not be `None`") # noqa: E501 + + self._query = query + + @property + def status(self): + """Gets the status of this CheckBase. # noqa: E501 + + + :return: The status of this CheckBase. # noqa: E501 + :rtype: TaskStatusType + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this CheckBase. + + + :param status: The status of this CheckBase. # noqa: E501 + :type: TaskStatusType + """ + + self._status = status + + @property + def every(self): + """Gets the every of this CheckBase. # noqa: E501 + + Check repetition interval # noqa: E501 + + :return: The every of this CheckBase. # noqa: E501 + :rtype: str + """ + return self._every + + @every.setter + def every(self, every): + """Sets the every of this CheckBase. + + Check repetition interval # noqa: E501 + + :param every: The every of this CheckBase. # noqa: E501 + :type: str + """ + + self._every = every + + @property + def offset(self): + """Gets the offset of this CheckBase. # noqa: E501 + + Duration to delay after the schedule, before executing check. # noqa: E501 + + :return: The offset of this CheckBase. # noqa: E501 + :rtype: str + """ + return self._offset + + @offset.setter + def offset(self, offset): + """Sets the offset of this CheckBase. + + Duration to delay after the schedule, before executing check. # noqa: E501 + + :param offset: The offset of this CheckBase. # noqa: E501 + :type: str + """ + + self._offset = offset + + @property + def cron(self): + """Gets the cron of this CheckBase. # noqa: E501 + + Check repetition interval in the form '* * * * * *'; # noqa: E501 + + :return: The cron of this CheckBase. # noqa: E501 + :rtype: str + """ + return self._cron + + @cron.setter + def cron(self, cron): + """Sets the cron of this CheckBase. + + Check repetition interval in the form '* * * * * *'; # noqa: E501 + + :param cron: The cron of this CheckBase. # noqa: E501 + :type: str + """ + + self._cron = cron + + @property + def tags(self): + """Gets the tags of this CheckBase. # noqa: E501 + + tags to write to each status # noqa: E501 + + :return: The tags of this CheckBase. # noqa: E501 + :rtype: list[CheckBaseTags] + """ + return self._tags + + @tags.setter + def tags(self, tags): + """Sets the tags of this CheckBase. + + tags to write to each status # noqa: E501 + + :param tags: The tags of this CheckBase. # noqa: E501 + :type: list[CheckBaseTags] + """ + + self._tags = tags + + @property + def description(self): + """Gets the description of this CheckBase. # noqa: E501 + + An optional description of the check # noqa: E501 + + :return: The description of this CheckBase. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this CheckBase. + + An optional description of the check # noqa: E501 + + :param description: The description of this CheckBase. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def status_message_template(self): + """Gets the status_message_template of this CheckBase. # noqa: E501 + + template that is used to generate and write a status message # noqa: E501 + + :return: The status_message_template of this CheckBase. # noqa: E501 + :rtype: str + """ + return self._status_message_template + + @status_message_template.setter + def status_message_template(self, status_message_template): + """Sets the status_message_template of this CheckBase. + + template that is used to generate and write a status message # noqa: E501 + + :param status_message_template: The status_message_template of this CheckBase. # noqa: E501 + :type: str + """ + + self._status_message_template = status_message_template + + @property + def labels(self): + """Gets the labels of this CheckBase. # noqa: E501 + + + :return: The labels of this CheckBase. # noqa: E501 + :rtype: list[Label] + """ + return self._labels + + @labels.setter + def labels(self, labels): + """Sets the labels of this CheckBase. + + + :param labels: The labels of this CheckBase. # noqa: E501 + :type: list[Label] + """ + + self._labels = labels + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CheckBase): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/models/query_config_range.py b/influxdb2/domain/check_base_tags.py similarity index 62% rename from influxdb2/models/query_config_range.py rename to influxdb2/domain/check_base_tags.py index 09985987..020d8ed6 100644 --- a/influxdb2/models/query_config_range.py +++ b/influxdb2/domain/check_base_tags.py @@ -16,7 +16,7 @@ import six -class QueryConfigRange(object): +class CheckBaseTags(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -31,70 +31,68 @@ class QueryConfigRange(object): and the value is json key in definition. """ openapi_types = { - 'lower': 'str', - 'upper': 'str' + 'key': 'str', + 'value': 'str' } attribute_map = { - 'lower': 'lower', - 'upper': 'upper' + 'key': 'key', + 'value': 'value' } - def __init__(self, lower=None, upper=None): # noqa: E501 - """QueryConfigRange - a model defined in OpenAPI""" # noqa: E501 + def __init__(self, key=None, value=None): # noqa: E501 + """CheckBaseTags - a model defined in OpenAPI""" # noqa: E501 - self._lower = None - self._upper = None + self._key = None + self._value = None self.discriminator = None - self.lower = lower - self.upper = upper + if key is not None: + self.key = key + if value is not None: + self.value = value @property - def lower(self): - """Gets the lower of this QueryConfigRange. # noqa: E501 + def key(self): + """Gets the key of this CheckBaseTags. # noqa: E501 - :return: The lower of this QueryConfigRange. # noqa: E501 + :return: The key of this CheckBaseTags. # noqa: E501 :rtype: str """ - return self._lower + return self._key - @lower.setter - def lower(self, lower): - """Sets the lower of this QueryConfigRange. + @key.setter + def key(self, key): + """Sets the key of this CheckBaseTags. - :param lower: The lower of this QueryConfigRange. # noqa: E501 + :param key: The key of this CheckBaseTags. # noqa: E501 :type: str """ - if lower is None: - raise ValueError("Invalid value for `lower`, must not be `None`") # noqa: E501 - self._lower = lower + self._key = key @property - def upper(self): - """Gets the upper of this QueryConfigRange. # noqa: E501 + def value(self): + """Gets the value of this CheckBaseTags. # noqa: E501 - :return: The upper of this QueryConfigRange. # noqa: E501 + :return: The value of this CheckBaseTags. # noqa: E501 :rtype: str """ - return self._upper + return self._value - @upper.setter - def upper(self, upper): - """Sets the upper of this QueryConfigRange. + @value.setter + def value(self, value): + """Sets the value of this CheckBaseTags. - :param upper: The upper of this QueryConfigRange. # noqa: E501 + :param value: The value of this CheckBaseTags. # noqa: E501 :type: str """ - if upper is None: - raise ValueError("Invalid value for `upper`, must not be `None`") # noqa: E501 - self._upper = upper + self._value = value def to_dict(self): """Returns the model properties as a dict""" @@ -130,7 +128,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, QueryConfigRange): + if not isinstance(other, CheckBaseTags): return False return self.__dict__ == other.__dict__ diff --git a/influxdb2/domain/check_status_level.py b/influxdb2/domain/check_status_level.py new file mode 100644 index 00000000..e4b91022 --- /dev/null +++ b/influxdb2/domain/check_status_level.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class CheckStatusLevel(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + UNKNOWN = "UNKNOWN" + OK = "OK" + INFO = "INFO" + CRIT = "CRIT" + WARN = "WARN" + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """CheckStatusLevel - a model defined in OpenAPI""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CheckStatusLevel): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/models/log_view_properties.py b/influxdb2/domain/check_view_properties.py similarity index 62% rename from influxdb2/models/log_view_properties.py rename to influxdb2/domain/check_view_properties.py index 1a1afbf1..6935ad3b 100644 --- a/influxdb2/models/log_view_properties.py +++ b/influxdb2/domain/check_view_properties.py @@ -16,7 +16,7 @@ import six -class LogViewProperties(object): +class CheckViewProperties(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -31,45 +31,78 @@ class LogViewProperties(object): and the value is json key in definition. """ openapi_types = { - 'shape': 'str', 'type': 'str', - 'columns': 'list[LogViewerColumn]' + 'shape': 'str', + 'check_id': 'str', + 'check': 'Check' } attribute_map = { - 'shape': 'shape', 'type': 'type', - 'columns': 'columns' + 'shape': 'shape', + 'check_id': 'checkID', + 'check': 'check' } - def __init__(self, shape=None, type=None, columns=None): # noqa: E501 - """LogViewProperties - a model defined in OpenAPI""" # noqa: E501 + def __init__(self, type=None, shape=None, check_id=None, check=None): # noqa: E501 + """CheckViewProperties - a model defined in OpenAPI""" # noqa: E501 - self._shape = None self._type = None - self._columns = None + self._shape = None + self._check_id = None + self._check = None self.discriminator = None - self.shape = shape self.type = type - self.columns = columns + self.shape = shape + self.check_id = check_id + self.check = check + + @property + def type(self): + """Gets the type of this CheckViewProperties. # noqa: E501 + + + :return: The type of this CheckViewProperties. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this CheckViewProperties. + + + :param type: The type of this CheckViewProperties. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["check"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type @property def shape(self): - """Gets the shape of this LogViewProperties. # noqa: E501 + """Gets the shape of this CheckViewProperties. # noqa: E501 - :return: The shape of this LogViewProperties. # noqa: E501 + :return: The shape of this CheckViewProperties. # noqa: E501 :rtype: str """ return self._shape @shape.setter def shape(self, shape): - """Sets the shape of this LogViewProperties. + """Sets the shape of this CheckViewProperties. - :param shape: The shape of this LogViewProperties. # noqa: E501 + :param shape: The shape of this CheckViewProperties. # noqa: E501 :type: str """ if shape is None: @@ -84,58 +117,50 @@ def shape(self, shape): self._shape = shape @property - def type(self): - """Gets the type of this LogViewProperties. # noqa: E501 + def check_id(self): + """Gets the check_id of this CheckViewProperties. # noqa: E501 - :return: The type of this LogViewProperties. # noqa: E501 + :return: The check_id of this CheckViewProperties. # noqa: E501 :rtype: str """ - return self._type + return self._check_id - @type.setter - def type(self, type): - """Sets the type of this LogViewProperties. + @check_id.setter + def check_id(self, check_id): + """Sets the check_id of this CheckViewProperties. - :param type: The type of this LogViewProperties. # noqa: E501 + :param check_id: The check_id of this CheckViewProperties. # noqa: E501 :type: str """ - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["log-viewer"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) + if check_id is None: + raise ValueError("Invalid value for `check_id`, must not be `None`") # noqa: E501 - self._type = type + self._check_id = check_id @property - def columns(self): - """Gets the columns of this LogViewProperties. # noqa: E501 + def check(self): + """Gets the check of this CheckViewProperties. # noqa: E501 - Defines the order, names, and visibility of columns in the log viewer table # noqa: E501 - :return: The columns of this LogViewProperties. # noqa: E501 - :rtype: list[LogViewerColumn] + :return: The check of this CheckViewProperties. # noqa: E501 + :rtype: Check """ - return self._columns + return self._check - @columns.setter - def columns(self, columns): - """Sets the columns of this LogViewProperties. + @check.setter + def check(self, check): + """Sets the check of this CheckViewProperties. - Defines the order, names, and visibility of columns in the log viewer table # noqa: E501 - :param columns: The columns of this LogViewProperties. # noqa: E501 - :type: list[LogViewerColumn] + :param check: The check of this CheckViewProperties. # noqa: E501 + :type: Check """ - if columns is None: - raise ValueError("Invalid value for `columns`, must not be `None`") # noqa: E501 + if check is None: + raise ValueError("Invalid value for `check`, must not be `None`") # noqa: E501 - self._columns = columns + self._check = check def to_dict(self): """Returns the model properties as a dict""" @@ -171,7 +196,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, LogViewProperties): + if not isinstance(other, CheckViewProperties): return False return self.__dict__ == other.__dict__ diff --git a/influxdb2/domain/checks.py b/influxdb2/domain/checks.py new file mode 100644 index 00000000..a88c5df1 --- /dev/null +++ b/influxdb2/domain/checks.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Checks(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'checks': 'list[Check]', + 'links': 'Links' + } + + attribute_map = { + 'checks': 'checks', + 'links': 'links' + } + + def __init__(self, checks=None, links=None): # noqa: E501 + """Checks - a model defined in OpenAPI""" # noqa: E501 + + self._checks = None + self._links = None + self.discriminator = None + + if checks is not None: + self.checks = checks + if links is not None: + self.links = links + + @property + def checks(self): + """Gets the checks of this Checks. # noqa: E501 + + + :return: The checks of this Checks. # noqa: E501 + :rtype: list[Check] + """ + return self._checks + + @checks.setter + def checks(self, checks): + """Sets the checks of this Checks. + + + :param checks: The checks of this Checks. # noqa: E501 + :type: list[Check] + """ + + self._checks = checks + + @property + def links(self): + """Gets the links of this Checks. # noqa: E501 + + + :return: The links of this Checks. # noqa: E501 + :rtype: Links + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this Checks. + + + :param links: The links of this Checks. # noqa: E501 + :type: Links + """ + + self._links = links + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Checks): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/models/conditional_expression.py b/influxdb2/domain/conditional_expression.py similarity index 100% rename from influxdb2/models/conditional_expression.py rename to influxdb2/domain/conditional_expression.py diff --git a/influxdb2/models/constant_variable_properties.py b/influxdb2/domain/constant_variable_properties.py similarity index 100% rename from influxdb2/models/constant_variable_properties.py rename to influxdb2/domain/constant_variable_properties.py diff --git a/influxdb2/models/create_cell.py b/influxdb2/domain/create_cell.py similarity index 100% rename from influxdb2/models/create_cell.py rename to influxdb2/domain/create_cell.py diff --git a/influxdb2/models/create_dashboard_request.py b/influxdb2/domain/create_dashboard_request.py similarity index 100% rename from influxdb2/models/create_dashboard_request.py rename to influxdb2/domain/create_dashboard_request.py diff --git a/influxdb2/models/dashboard.py b/influxdb2/domain/dashboard.py similarity index 100% rename from influxdb2/models/dashboard.py rename to influxdb2/domain/dashboard.py diff --git a/influxdb2/models/dashboard_color.py b/influxdb2/domain/dashboard_color.py similarity index 87% rename from influxdb2/models/dashboard_color.py rename to influxdb2/domain/dashboard_color.py index e67be73a..f8b7de30 100644 --- a/influxdb2/models/dashboard_color.py +++ b/influxdb2/domain/dashboard_color.py @@ -35,7 +35,7 @@ class DashboardColor(object): 'type': 'str', 'hex': 'str', 'name': 'str', - 'value': 'str' + 'value': 'float' } attribute_map = { @@ -56,16 +56,11 @@ def __init__(self, id=None, type=None, hex=None, name=None, value=None): # noqa self._value = None self.discriminator = None - if id is not None: - self.id = id - if type is not None: - self.type = type - if hex is not None: - self.hex = hex - if name is not None: - self.name = name - if value is not None: - self.value = value + self.id = id + self.type = type + self.hex = hex + self.name = name + self.value = value @property def id(self): @@ -87,6 +82,8 @@ def id(self, id): :param id: The id of this DashboardColor. # noqa: E501 :type: str """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 self._id = id @@ -110,7 +107,9 @@ def type(self, type): :param type: The type of this DashboardColor. # noqa: E501 :type: str """ - allowed_values = ["min", "max", "threshold"] # noqa: E501 + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["min", "max", "threshold", "scale", "text", "background"] # noqa: E501 if type not in allowed_values: raise ValueError( "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 @@ -139,6 +138,8 @@ def hex(self, hex): :param hex: The hex of this DashboardColor. # noqa: E501 :type: str """ + if hex is None: + raise ValueError("Invalid value for `hex`, must not be `None`") # noqa: E501 if hex is not None and len(hex) > 7: raise ValueError("Invalid value for `hex`, length must be less than or equal to `7`") # noqa: E501 if hex is not None and len(hex) < 7: @@ -166,6 +167,8 @@ def name(self, name): :param name: The name of this DashboardColor. # noqa: E501 :type: str """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name @@ -176,7 +179,7 @@ def value(self): Value is the data value mapped to this color # noqa: E501 :return: The value of this DashboardColor. # noqa: E501 - :rtype: str + :rtype: float """ return self._value @@ -187,8 +190,10 @@ def value(self, value): Value is the data value mapped to this color # noqa: E501 :param value: The value of this DashboardColor. # noqa: E501 - :type: str + :type: float """ + if value is None: + raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 self._value = value diff --git a/influxdb2/domain/dashboard_query.py b/influxdb2/domain/dashboard_query.py new file mode 100644 index 00000000..c6a7f9ef --- /dev/null +++ b/influxdb2/domain/dashboard_query.py @@ -0,0 +1,192 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class DashboardQuery(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'text': 'str', + 'edit_mode': 'QueryEditMode', + 'name': 'str', + 'builder_config': 'BuilderConfig' + } + + attribute_map = { + 'text': 'text', + 'edit_mode': 'editMode', + 'name': 'name', + 'builder_config': 'builderConfig' + } + + def __init__(self, text=None, edit_mode=None, name=None, builder_config=None): # noqa: E501 + """DashboardQuery - a model defined in OpenAPI""" # noqa: E501 + + self._text = None + self._edit_mode = None + self._name = None + self._builder_config = None + self.discriminator = None + + if text is not None: + self.text = text + if edit_mode is not None: + self.edit_mode = edit_mode + if name is not None: + self.name = name + if builder_config is not None: + self.builder_config = builder_config + + @property + def text(self): + """Gets the text of this DashboardQuery. # noqa: E501 + + The text of the flux query # noqa: E501 + + :return: The text of this DashboardQuery. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this DashboardQuery. + + The text of the flux query # noqa: E501 + + :param text: The text of this DashboardQuery. # noqa: E501 + :type: str + """ + + self._text = text + + @property + def edit_mode(self): + """Gets the edit_mode of this DashboardQuery. # noqa: E501 + + + :return: The edit_mode of this DashboardQuery. # noqa: E501 + :rtype: QueryEditMode + """ + return self._edit_mode + + @edit_mode.setter + def edit_mode(self, edit_mode): + """Sets the edit_mode of this DashboardQuery. + + + :param edit_mode: The edit_mode of this DashboardQuery. # noqa: E501 + :type: QueryEditMode + """ + + self._edit_mode = edit_mode + + @property + def name(self): + """Gets the name of this DashboardQuery. # noqa: E501 + + + :return: The name of this DashboardQuery. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this DashboardQuery. + + + :param name: The name of this DashboardQuery. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def builder_config(self): + """Gets the builder_config of this DashboardQuery. # noqa: E501 + + + :return: The builder_config of this DashboardQuery. # noqa: E501 + :rtype: BuilderConfig + """ + return self._builder_config + + @builder_config.setter + def builder_config(self, builder_config): + """Sets the builder_config of this DashboardQuery. + + + :param builder_config: The builder_config of this DashboardQuery. # noqa: E501 + :type: BuilderConfig + """ + + self._builder_config = builder_config + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DashboardQuery): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/models/dashboards.py b/influxdb2/domain/dashboards.py similarity index 100% rename from influxdb2/models/dashboards.py rename to influxdb2/domain/dashboards.py diff --git a/influxdb2/models/date_time_literal.py b/influxdb2/domain/date_time_literal.py similarity index 100% rename from influxdb2/models/date_time_literal.py rename to influxdb2/domain/date_time_literal.py diff --git a/influxdb2/domain/deadman_check.py b/influxdb2/domain/deadman_check.py new file mode 100644 index 00000000..0ae167f4 --- /dev/null +++ b/influxdb2/domain/deadman_check.py @@ -0,0 +1,200 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class DeadmanCheck(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'type': 'str', + 'time_since': 'int', + 'report_zero': 'bool', + 'level': 'CheckStatusLevel' + } + + attribute_map = { + 'type': 'type', + 'time_since': 'timeSince', + 'report_zero': 'reportZero', + 'level': 'level' + } + + def __init__(self, type=None, time_since=None, report_zero=None, level=None): # noqa: E501 + """DeadmanCheck - a model defined in OpenAPI""" # noqa: E501 + + self._type = None + self._time_since = None + self._report_zero = None + self._level = None + self.discriminator = None + + if type is not None: + self.type = type + if time_since is not None: + self.time_since = time_since + if report_zero is not None: + self.report_zero = report_zero + if level is not None: + self.level = level + + @property + def type(self): + """Gets the type of this DeadmanCheck. # noqa: E501 + + + :return: The type of this DeadmanCheck. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this DeadmanCheck. + + + :param type: The type of this DeadmanCheck. # noqa: E501 + :type: str + """ + allowed_values = ["deadman"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def time_since(self): + """Gets the time_since of this DeadmanCheck. # noqa: E501 + + seconds before deadman triggers # noqa: E501 + + :return: The time_since of this DeadmanCheck. # noqa: E501 + :rtype: int + """ + return self._time_since + + @time_since.setter + def time_since(self, time_since): + """Sets the time_since of this DeadmanCheck. + + seconds before deadman triggers # noqa: E501 + + :param time_since: The time_since of this DeadmanCheck. # noqa: E501 + :type: int + """ + + self._time_since = time_since + + @property + def report_zero(self): + """Gets the report_zero of this DeadmanCheck. # noqa: E501 + + if only zero values reported since time, trigger alert # noqa: E501 + + :return: The report_zero of this DeadmanCheck. # noqa: E501 + :rtype: bool + """ + return self._report_zero + + @report_zero.setter + def report_zero(self, report_zero): + """Sets the report_zero of this DeadmanCheck. + + if only zero values reported since time, trigger alert # noqa: E501 + + :param report_zero: The report_zero of this DeadmanCheck. # noqa: E501 + :type: bool + """ + + self._report_zero = report_zero + + @property + def level(self): + """Gets the level of this DeadmanCheck. # noqa: E501 + + + :return: The level of this DeadmanCheck. # noqa: E501 + :rtype: CheckStatusLevel + """ + return self._level + + @level.setter + def level(self, level): + """Sets the level of this DeadmanCheck. + + + :param level: The level of this DeadmanCheck. # noqa: E501 + :type: CheckStatusLevel + """ + + self._level = level + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DeadmanCheck): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/models/decimal_places.py b/influxdb2/domain/decimal_places.py similarity index 100% rename from influxdb2/models/decimal_places.py rename to influxdb2/domain/decimal_places.py diff --git a/influxdb2/models/dialect.py b/influxdb2/domain/dialect.py similarity index 100% rename from influxdb2/models/dialect.py rename to influxdb2/domain/dialect.py diff --git a/influxdb2/models/document.py b/influxdb2/domain/document.py similarity index 100% rename from influxdb2/models/document.py rename to influxdb2/domain/document.py diff --git a/influxdb2/models/document_create.py b/influxdb2/domain/document_create.py similarity index 100% rename from influxdb2/models/document_create.py rename to influxdb2/domain/document_create.py diff --git a/influxdb2/models/document_links.py b/influxdb2/domain/document_links.py similarity index 100% rename from influxdb2/models/document_links.py rename to influxdb2/domain/document_links.py diff --git a/influxdb2/models/document_list_entry.py b/influxdb2/domain/document_list_entry.py similarity index 100% rename from influxdb2/models/document_list_entry.py rename to influxdb2/domain/document_list_entry.py diff --git a/influxdb2/models/document_meta.py b/influxdb2/domain/document_meta.py similarity index 100% rename from influxdb2/models/document_meta.py rename to influxdb2/domain/document_meta.py diff --git a/influxdb2/models/document_update.py b/influxdb2/domain/document_update.py similarity index 100% rename from influxdb2/models/document_update.py rename to influxdb2/domain/document_update.py diff --git a/influxdb2/models/documents.py b/influxdb2/domain/documents.py similarity index 100% rename from influxdb2/models/documents.py rename to influxdb2/domain/documents.py diff --git a/influxdb2/models/duration.py b/influxdb2/domain/duration.py similarity index 100% rename from influxdb2/models/duration.py rename to influxdb2/domain/duration.py diff --git a/influxdb2/models/duration_literal.py b/influxdb2/domain/duration_literal.py similarity index 100% rename from influxdb2/models/duration_literal.py rename to influxdb2/domain/duration_literal.py diff --git a/influxdb2/models/error.py b/influxdb2/domain/error.py similarity index 100% rename from influxdb2/models/error.py rename to influxdb2/domain/error.py diff --git a/influxdb2/models/expression.py b/influxdb2/domain/expression.py similarity index 100% rename from influxdb2/models/expression.py rename to influxdb2/domain/expression.py diff --git a/influxdb2/models/expression_statement.py b/influxdb2/domain/expression_statement.py similarity index 100% rename from influxdb2/models/expression_statement.py rename to influxdb2/domain/expression_statement.py diff --git a/influxdb2/models/field.py b/influxdb2/domain/field.py similarity index 100% rename from influxdb2/models/field.py rename to influxdb2/domain/field.py diff --git a/influxdb2/models/file.py b/influxdb2/domain/file.py similarity index 100% rename from influxdb2/models/file.py rename to influxdb2/domain/file.py diff --git a/influxdb2/models/float_literal.py b/influxdb2/domain/float_literal.py similarity index 100% rename from influxdb2/models/float_literal.py rename to influxdb2/domain/float_literal.py diff --git a/influxdb2/models/flux_suggestion.py b/influxdb2/domain/flux_suggestion.py similarity index 100% rename from influxdb2/models/flux_suggestion.py rename to influxdb2/domain/flux_suggestion.py diff --git a/influxdb2/models/flux_suggestions.py b/influxdb2/domain/flux_suggestions.py similarity index 100% rename from influxdb2/models/flux_suggestions.py rename to influxdb2/domain/flux_suggestions.py diff --git a/influxdb2/models/function_expression.py b/influxdb2/domain/function_expression.py similarity index 100% rename from influxdb2/models/function_expression.py rename to influxdb2/domain/function_expression.py diff --git a/influxdb2/models/gauge_view_properties.py b/influxdb2/domain/gauge_view_properties.py similarity index 58% rename from influxdb2/models/gauge_view_properties.py rename to influxdb2/domain/gauge_view_properties.py index 484ef1fc..ca9673a2 100644 --- a/influxdb2/models/gauge_view_properties.py +++ b/influxdb2/domain/gauge_view_properties.py @@ -31,8 +31,12 @@ class GaugeViewProperties(object): and the value is json key in definition. """ openapi_types = { - 'shape': 'str', 'type': 'str', + 'queries': 'list[DashboardQuery]', + 'colors': 'list[DashboardColor]', + 'shape': 'str', + 'note': 'str', + 'show_note_when_empty': 'bool', 'prefix': 'str', 'suffix': 'str', 'legend': 'Legend', @@ -40,37 +44,120 @@ class GaugeViewProperties(object): } attribute_map = { - 'shape': 'shape', 'type': 'type', + 'queries': 'queries', + 'colors': 'colors', + 'shape': 'shape', + 'note': 'note', + 'show_note_when_empty': 'showNoteWhenEmpty', 'prefix': 'prefix', 'suffix': 'suffix', 'legend': 'legend', 'decimal_places': 'decimalPlaces' } - def __init__(self, shape=None, type=None, prefix=None, suffix=None, legend=None, decimal_places=None): # noqa: E501 + def __init__(self, type=None, queries=None, colors=None, shape=None, note=None, show_note_when_empty=None, prefix=None, suffix=None, legend=None, decimal_places=None): # noqa: E501 """GaugeViewProperties - a model defined in OpenAPI""" # noqa: E501 - self._shape = None self._type = None + self._queries = None + self._colors = None + self._shape = None + self._note = None + self._show_note_when_empty = None self._prefix = None self._suffix = None self._legend = None self._decimal_places = None self.discriminator = None - if shape is not None: - self.shape = shape - if type is not None: - self.type = type - if prefix is not None: - self.prefix = prefix - if suffix is not None: - self.suffix = suffix - if legend is not None: - self.legend = legend - if decimal_places is not None: - self.decimal_places = decimal_places + self.type = type + self.queries = queries + self.colors = colors + self.shape = shape + self.note = note + self.show_note_when_empty = show_note_when_empty + self.prefix = prefix + self.suffix = suffix + self.legend = legend + self.decimal_places = decimal_places + + @property + def type(self): + """Gets the type of this GaugeViewProperties. # noqa: E501 + + + :return: The type of this GaugeViewProperties. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this GaugeViewProperties. + + + :param type: The type of this GaugeViewProperties. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["gauge"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def queries(self): + """Gets the queries of this GaugeViewProperties. # noqa: E501 + + + :return: The queries of this GaugeViewProperties. # noqa: E501 + :rtype: list[DashboardQuery] + """ + return self._queries + + @queries.setter + def queries(self, queries): + """Sets the queries of this GaugeViewProperties. + + + :param queries: The queries of this GaugeViewProperties. # noqa: E501 + :type: list[DashboardQuery] + """ + if queries is None: + raise ValueError("Invalid value for `queries`, must not be `None`") # noqa: E501 + + self._queries = queries + + @property + def colors(self): + """Gets the colors of this GaugeViewProperties. # noqa: E501 + + Colors define color encoding of data into a visualization # noqa: E501 + + :return: The colors of this GaugeViewProperties. # noqa: E501 + :rtype: list[DashboardColor] + """ + return self._colors + + @colors.setter + def colors(self, colors): + """Sets the colors of this GaugeViewProperties. + + Colors define color encoding of data into a visualization # noqa: E501 + + :param colors: The colors of this GaugeViewProperties. # noqa: E501 + :type: list[DashboardColor] + """ + if colors is None: + raise ValueError("Invalid value for `colors`, must not be `None`") # noqa: E501 + + self._colors = colors @property def shape(self): @@ -90,6 +177,8 @@ def shape(self, shape): :param shape: The shape of this GaugeViewProperties. # noqa: E501 :type: str """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 allowed_values = ["chronograf-v2"] # noqa: E501 if shape not in allowed_values: raise ValueError( @@ -100,31 +189,52 @@ def shape(self, shape): self._shape = shape @property - def type(self): - """Gets the type of this GaugeViewProperties. # noqa: E501 + def note(self): + """Gets the note of this GaugeViewProperties. # noqa: E501 - :return: The type of this GaugeViewProperties. # noqa: E501 + :return: The note of this GaugeViewProperties. # noqa: E501 :rtype: str """ - return self._type + return self._note - @type.setter - def type(self, type): - """Sets the type of this GaugeViewProperties. + @note.setter + def note(self, note): + """Sets the note of this GaugeViewProperties. - :param type: The type of this GaugeViewProperties. # noqa: E501 + :param note: The note of this GaugeViewProperties. # noqa: E501 :type: str """ - allowed_values = ["gauge"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) + if note is None: + raise ValueError("Invalid value for `note`, must not be `None`") # noqa: E501 - self._type = type + self._note = note + + @property + def show_note_when_empty(self): + """Gets the show_note_when_empty of this GaugeViewProperties. # noqa: E501 + + if true, will display note when empty # noqa: E501 + + :return: The show_note_when_empty of this GaugeViewProperties. # noqa: E501 + :rtype: bool + """ + return self._show_note_when_empty + + @show_note_when_empty.setter + def show_note_when_empty(self, show_note_when_empty): + """Sets the show_note_when_empty of this GaugeViewProperties. + + if true, will display note when empty # noqa: E501 + + :param show_note_when_empty: The show_note_when_empty of this GaugeViewProperties. # noqa: E501 + :type: bool + """ + if show_note_when_empty is None: + raise ValueError("Invalid value for `show_note_when_empty`, must not be `None`") # noqa: E501 + + self._show_note_when_empty = show_note_when_empty @property def prefix(self): @@ -144,6 +254,8 @@ def prefix(self, prefix): :param prefix: The prefix of this GaugeViewProperties. # noqa: E501 :type: str """ + if prefix is None: + raise ValueError("Invalid value for `prefix`, must not be `None`") # noqa: E501 self._prefix = prefix @@ -165,6 +277,8 @@ def suffix(self, suffix): :param suffix: The suffix of this GaugeViewProperties. # noqa: E501 :type: str """ + if suffix is None: + raise ValueError("Invalid value for `suffix`, must not be `None`") # noqa: E501 self._suffix = suffix @@ -186,6 +300,8 @@ def legend(self, legend): :param legend: The legend of this GaugeViewProperties. # noqa: E501 :type: Legend """ + if legend is None: + raise ValueError("Invalid value for `legend`, must not be `None`") # noqa: E501 self._legend = legend @@ -207,6 +323,8 @@ def decimal_places(self, decimal_places): :param decimal_places: The decimal_places of this GaugeViewProperties. # noqa: E501 :type: DecimalPlaces """ + if decimal_places is None: + raise ValueError("Invalid value for `decimal_places`, must not be `None`") # noqa: E501 self._decimal_places = decimal_places diff --git a/influxdb2/models/check.py b/influxdb2/domain/health_check.py similarity index 76% rename from influxdb2/models/check.py rename to influxdb2/domain/health_check.py index fafc9f36..6307e7c7 100644 --- a/influxdb2/models/check.py +++ b/influxdb2/domain/health_check.py @@ -16,7 +16,7 @@ import six -class Check(object): +class HealthCheck(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -33,7 +33,7 @@ class Check(object): openapi_types = { 'name': 'str', 'message': 'str', - 'checks': 'list[Check]', + 'checks': 'list[HealthCheck]', 'status': 'str' } @@ -45,7 +45,7 @@ class Check(object): } def __init__(self, name=None, message=None, checks=None, status=None): # noqa: E501 - """Check - a model defined in OpenAPI""" # noqa: E501 + """HealthCheck - a model defined in OpenAPI""" # noqa: E501 self._name = None self._message = None @@ -62,20 +62,20 @@ def __init__(self, name=None, message=None, checks=None, status=None): # noqa: @property def name(self): - """Gets the name of this Check. # noqa: E501 + """Gets the name of this HealthCheck. # noqa: E501 - :return: The name of this Check. # noqa: E501 + :return: The name of this HealthCheck. # noqa: E501 :rtype: str """ return self._name @name.setter def name(self, name): - """Sets the name of this Check. + """Sets the name of this HealthCheck. - :param name: The name of this Check. # noqa: E501 + :param name: The name of this HealthCheck. # noqa: E501 :type: str """ if name is None: @@ -85,20 +85,20 @@ def name(self, name): @property def message(self): - """Gets the message of this Check. # noqa: E501 + """Gets the message of this HealthCheck. # noqa: E501 - :return: The message of this Check. # noqa: E501 + :return: The message of this HealthCheck. # noqa: E501 :rtype: str """ return self._message @message.setter def message(self, message): - """Sets the message of this Check. + """Sets the message of this HealthCheck. - :param message: The message of this Check. # noqa: E501 + :param message: The message of this HealthCheck. # noqa: E501 :type: str """ @@ -106,41 +106,41 @@ def message(self, message): @property def checks(self): - """Gets the checks of this Check. # noqa: E501 + """Gets the checks of this HealthCheck. # noqa: E501 - :return: The checks of this Check. # noqa: E501 - :rtype: list[Check] + :return: The checks of this HealthCheck. # noqa: E501 + :rtype: list[HealthCheck] """ return self._checks @checks.setter def checks(self, checks): - """Sets the checks of this Check. + """Sets the checks of this HealthCheck. - :param checks: The checks of this Check. # noqa: E501 - :type: list[Check] + :param checks: The checks of this HealthCheck. # noqa: E501 + :type: list[HealthCheck] """ self._checks = checks @property def status(self): - """Gets the status of this Check. # noqa: E501 + """Gets the status of this HealthCheck. # noqa: E501 - :return: The status of this Check. # noqa: E501 + :return: The status of this HealthCheck. # noqa: E501 :rtype: str """ return self._status @status.setter def status(self, status): - """Sets the status of this Check. + """Sets the status of this HealthCheck. - :param status: The status of this Check. # noqa: E501 + :param status: The status of this HealthCheck. # noqa: E501 :type: str """ if status is None: @@ -188,7 +188,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, Check): + if not isinstance(other, HealthCheck): return False return self.__dict__ == other.__dict__ diff --git a/influxdb2/domain/heatmap_view_properties.py b/influxdb2/domain/heatmap_view_properties.py new file mode 100644 index 00000000..f4570e93 --- /dev/null +++ b/influxdb2/domain/heatmap_view_properties.py @@ -0,0 +1,561 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class HeatmapViewProperties(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'type': 'str', + 'queries': 'list[DashboardQuery]', + 'colors': 'list[str]', + 'shape': 'str', + 'note': 'str', + 'show_note_when_empty': 'bool', + 'x_column': 'str', + 'y_column': 'str', + 'x_domain': 'list[float]', + 'y_domain': 'list[float]', + 'x_axis_label': 'str', + 'y_axis_label': 'str', + 'x_prefix': 'str', + 'x_suffix': 'str', + 'y_prefix': 'str', + 'y_suffix': 'str', + 'bin_size': 'float' + } + + attribute_map = { + 'type': 'type', + 'queries': 'queries', + 'colors': 'colors', + 'shape': 'shape', + 'note': 'note', + 'show_note_when_empty': 'showNoteWhenEmpty', + 'x_column': 'xColumn', + 'y_column': 'yColumn', + 'x_domain': 'xDomain', + 'y_domain': 'yDomain', + 'x_axis_label': 'xAxisLabel', + 'y_axis_label': 'yAxisLabel', + 'x_prefix': 'xPrefix', + 'x_suffix': 'xSuffix', + 'y_prefix': 'yPrefix', + 'y_suffix': 'ySuffix', + 'bin_size': 'binSize' + } + + def __init__(self, type=None, queries=None, colors=None, shape=None, note=None, show_note_when_empty=None, x_column=None, y_column=None, x_domain=None, y_domain=None, x_axis_label=None, y_axis_label=None, x_prefix=None, x_suffix=None, y_prefix=None, y_suffix=None, bin_size=None): # noqa: E501 + """HeatmapViewProperties - a model defined in OpenAPI""" # noqa: E501 + + self._type = None + self._queries = None + self._colors = None + self._shape = None + self._note = None + self._show_note_when_empty = None + self._x_column = None + self._y_column = None + self._x_domain = None + self._y_domain = None + self._x_axis_label = None + self._y_axis_label = None + self._x_prefix = None + self._x_suffix = None + self._y_prefix = None + self._y_suffix = None + self._bin_size = None + self.discriminator = None + + self.type = type + self.queries = queries + self.colors = colors + self.shape = shape + self.note = note + self.show_note_when_empty = show_note_when_empty + self.x_column = x_column + self.y_column = y_column + self.x_domain = x_domain + self.y_domain = y_domain + self.x_axis_label = x_axis_label + self.y_axis_label = y_axis_label + self.x_prefix = x_prefix + self.x_suffix = x_suffix + self.y_prefix = y_prefix + self.y_suffix = y_suffix + self.bin_size = bin_size + + @property + def type(self): + """Gets the type of this HeatmapViewProperties. # noqa: E501 + + + :return: The type of this HeatmapViewProperties. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this HeatmapViewProperties. + + + :param type: The type of this HeatmapViewProperties. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["heatmap"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def queries(self): + """Gets the queries of this HeatmapViewProperties. # noqa: E501 + + + :return: The queries of this HeatmapViewProperties. # noqa: E501 + :rtype: list[DashboardQuery] + """ + return self._queries + + @queries.setter + def queries(self, queries): + """Sets the queries of this HeatmapViewProperties. + + + :param queries: The queries of this HeatmapViewProperties. # noqa: E501 + :type: list[DashboardQuery] + """ + if queries is None: + raise ValueError("Invalid value for `queries`, must not be `None`") # noqa: E501 + + self._queries = queries + + @property + def colors(self): + """Gets the colors of this HeatmapViewProperties. # noqa: E501 + + Colors define color encoding of data into a visualization # noqa: E501 + + :return: The colors of this HeatmapViewProperties. # noqa: E501 + :rtype: list[str] + """ + return self._colors + + @colors.setter + def colors(self, colors): + """Sets the colors of this HeatmapViewProperties. + + Colors define color encoding of data into a visualization # noqa: E501 + + :param colors: The colors of this HeatmapViewProperties. # noqa: E501 + :type: list[str] + """ + if colors is None: + raise ValueError("Invalid value for `colors`, must not be `None`") # noqa: E501 + + self._colors = colors + + @property + def shape(self): + """Gets the shape of this HeatmapViewProperties. # noqa: E501 + + + :return: The shape of this HeatmapViewProperties. # noqa: E501 + :rtype: str + """ + return self._shape + + @shape.setter + def shape(self, shape): + """Sets the shape of this HeatmapViewProperties. + + + :param shape: The shape of this HeatmapViewProperties. # noqa: E501 + :type: str + """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 + allowed_values = ["chronograf-v2"] # noqa: E501 + if shape not in allowed_values: + raise ValueError( + "Invalid value for `shape` ({0}), must be one of {1}" # noqa: E501 + .format(shape, allowed_values) + ) + + self._shape = shape + + @property + def note(self): + """Gets the note of this HeatmapViewProperties. # noqa: E501 + + + :return: The note of this HeatmapViewProperties. # noqa: E501 + :rtype: str + """ + return self._note + + @note.setter + def note(self, note): + """Sets the note of this HeatmapViewProperties. + + + :param note: The note of this HeatmapViewProperties. # noqa: E501 + :type: str + """ + if note is None: + raise ValueError("Invalid value for `note`, must not be `None`") # noqa: E501 + + self._note = note + + @property + def show_note_when_empty(self): + """Gets the show_note_when_empty of this HeatmapViewProperties. # noqa: E501 + + if true, will display note when empty # noqa: E501 + + :return: The show_note_when_empty of this HeatmapViewProperties. # noqa: E501 + :rtype: bool + """ + return self._show_note_when_empty + + @show_note_when_empty.setter + def show_note_when_empty(self, show_note_when_empty): + """Sets the show_note_when_empty of this HeatmapViewProperties. + + if true, will display note when empty # noqa: E501 + + :param show_note_when_empty: The show_note_when_empty of this HeatmapViewProperties. # noqa: E501 + :type: bool + """ + if show_note_when_empty is None: + raise ValueError("Invalid value for `show_note_when_empty`, must not be `None`") # noqa: E501 + + self._show_note_when_empty = show_note_when_empty + + @property + def x_column(self): + """Gets the x_column of this HeatmapViewProperties. # noqa: E501 + + + :return: The x_column of this HeatmapViewProperties. # noqa: E501 + :rtype: str + """ + return self._x_column + + @x_column.setter + def x_column(self, x_column): + """Sets the x_column of this HeatmapViewProperties. + + + :param x_column: The x_column of this HeatmapViewProperties. # noqa: E501 + :type: str + """ + if x_column is None: + raise ValueError("Invalid value for `x_column`, must not be `None`") # noqa: E501 + + self._x_column = x_column + + @property + def y_column(self): + """Gets the y_column of this HeatmapViewProperties. # noqa: E501 + + + :return: The y_column of this HeatmapViewProperties. # noqa: E501 + :rtype: str + """ + return self._y_column + + @y_column.setter + def y_column(self, y_column): + """Sets the y_column of this HeatmapViewProperties. + + + :param y_column: The y_column of this HeatmapViewProperties. # noqa: E501 + :type: str + """ + if y_column is None: + raise ValueError("Invalid value for `y_column`, must not be `None`") # noqa: E501 + + self._y_column = y_column + + @property + def x_domain(self): + """Gets the x_domain of this HeatmapViewProperties. # noqa: E501 + + + :return: The x_domain of this HeatmapViewProperties. # noqa: E501 + :rtype: list[float] + """ + return self._x_domain + + @x_domain.setter + def x_domain(self, x_domain): + """Sets the x_domain of this HeatmapViewProperties. + + + :param x_domain: The x_domain of this HeatmapViewProperties. # noqa: E501 + :type: list[float] + """ + if x_domain is None: + raise ValueError("Invalid value for `x_domain`, must not be `None`") # noqa: E501 + + self._x_domain = x_domain + + @property + def y_domain(self): + """Gets the y_domain of this HeatmapViewProperties. # noqa: E501 + + + :return: The y_domain of this HeatmapViewProperties. # noqa: E501 + :rtype: list[float] + """ + return self._y_domain + + @y_domain.setter + def y_domain(self, y_domain): + """Sets the y_domain of this HeatmapViewProperties. + + + :param y_domain: The y_domain of this HeatmapViewProperties. # noqa: E501 + :type: list[float] + """ + if y_domain is None: + raise ValueError("Invalid value for `y_domain`, must not be `None`") # noqa: E501 + + self._y_domain = y_domain + + @property + def x_axis_label(self): + """Gets the x_axis_label of this HeatmapViewProperties. # noqa: E501 + + + :return: The x_axis_label of this HeatmapViewProperties. # noqa: E501 + :rtype: str + """ + return self._x_axis_label + + @x_axis_label.setter + def x_axis_label(self, x_axis_label): + """Sets the x_axis_label of this HeatmapViewProperties. + + + :param x_axis_label: The x_axis_label of this HeatmapViewProperties. # noqa: E501 + :type: str + """ + if x_axis_label is None: + raise ValueError("Invalid value for `x_axis_label`, must not be `None`") # noqa: E501 + + self._x_axis_label = x_axis_label + + @property + def y_axis_label(self): + """Gets the y_axis_label of this HeatmapViewProperties. # noqa: E501 + + + :return: The y_axis_label of this HeatmapViewProperties. # noqa: E501 + :rtype: str + """ + return self._y_axis_label + + @y_axis_label.setter + def y_axis_label(self, y_axis_label): + """Sets the y_axis_label of this HeatmapViewProperties. + + + :param y_axis_label: The y_axis_label of this HeatmapViewProperties. # noqa: E501 + :type: str + """ + if y_axis_label is None: + raise ValueError("Invalid value for `y_axis_label`, must not be `None`") # noqa: E501 + + self._y_axis_label = y_axis_label + + @property + def x_prefix(self): + """Gets the x_prefix of this HeatmapViewProperties. # noqa: E501 + + + :return: The x_prefix of this HeatmapViewProperties. # noqa: E501 + :rtype: str + """ + return self._x_prefix + + @x_prefix.setter + def x_prefix(self, x_prefix): + """Sets the x_prefix of this HeatmapViewProperties. + + + :param x_prefix: The x_prefix of this HeatmapViewProperties. # noqa: E501 + :type: str + """ + if x_prefix is None: + raise ValueError("Invalid value for `x_prefix`, must not be `None`") # noqa: E501 + + self._x_prefix = x_prefix + + @property + def x_suffix(self): + """Gets the x_suffix of this HeatmapViewProperties. # noqa: E501 + + + :return: The x_suffix of this HeatmapViewProperties. # noqa: E501 + :rtype: str + """ + return self._x_suffix + + @x_suffix.setter + def x_suffix(self, x_suffix): + """Sets the x_suffix of this HeatmapViewProperties. + + + :param x_suffix: The x_suffix of this HeatmapViewProperties. # noqa: E501 + :type: str + """ + if x_suffix is None: + raise ValueError("Invalid value for `x_suffix`, must not be `None`") # noqa: E501 + + self._x_suffix = x_suffix + + @property + def y_prefix(self): + """Gets the y_prefix of this HeatmapViewProperties. # noqa: E501 + + + :return: The y_prefix of this HeatmapViewProperties. # noqa: E501 + :rtype: str + """ + return self._y_prefix + + @y_prefix.setter + def y_prefix(self, y_prefix): + """Sets the y_prefix of this HeatmapViewProperties. + + + :param y_prefix: The y_prefix of this HeatmapViewProperties. # noqa: E501 + :type: str + """ + if y_prefix is None: + raise ValueError("Invalid value for `y_prefix`, must not be `None`") # noqa: E501 + + self._y_prefix = y_prefix + + @property + def y_suffix(self): + """Gets the y_suffix of this HeatmapViewProperties. # noqa: E501 + + + :return: The y_suffix of this HeatmapViewProperties. # noqa: E501 + :rtype: str + """ + return self._y_suffix + + @y_suffix.setter + def y_suffix(self, y_suffix): + """Sets the y_suffix of this HeatmapViewProperties. + + + :param y_suffix: The y_suffix of this HeatmapViewProperties. # noqa: E501 + :type: str + """ + if y_suffix is None: + raise ValueError("Invalid value for `y_suffix`, must not be `None`") # noqa: E501 + + self._y_suffix = y_suffix + + @property + def bin_size(self): + """Gets the bin_size of this HeatmapViewProperties. # noqa: E501 + + + :return: The bin_size of this HeatmapViewProperties. # noqa: E501 + :rtype: float + """ + return self._bin_size + + @bin_size.setter + def bin_size(self, bin_size): + """Sets the bin_size of this HeatmapViewProperties. + + + :param bin_size: The bin_size of this HeatmapViewProperties. # noqa: E501 + :type: float + """ + if bin_size is None: + raise ValueError("Invalid value for `bin_size`, must not be `None`") # noqa: E501 + + self._bin_size = bin_size + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, HeatmapViewProperties): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/models/histogram_view_properties.py b/influxdb2/domain/histogram_view_properties.py similarity index 59% rename from influxdb2/models/histogram_view_properties.py rename to influxdb2/domain/histogram_view_properties.py index 9e100d06..4660455d 100644 --- a/influxdb2/models/histogram_view_properties.py +++ b/influxdb2/domain/histogram_view_properties.py @@ -31,8 +31,12 @@ class HistogramViewProperties(object): and the value is json key in definition. """ openapi_types = { - 'shape': 'str', 'type': 'str', + 'queries': 'list[DashboardQuery]', + 'colors': 'list[DashboardColor]', + 'shape': 'str', + 'note': 'str', + 'show_note_when_empty': 'bool', 'x_column': 'str', 'fill_columns': 'list[str]', 'x_domain': 'list[float]', @@ -42,8 +46,12 @@ class HistogramViewProperties(object): } attribute_map = { - 'shape': 'shape', 'type': 'type', + 'queries': 'queries', + 'colors': 'colors', + 'shape': 'shape', + 'note': 'note', + 'show_note_when_empty': 'showNoteWhenEmpty', 'x_column': 'xColumn', 'fill_columns': 'fillColumns', 'x_domain': 'xDomain', @@ -52,11 +60,15 @@ class HistogramViewProperties(object): 'bin_count': 'binCount' } - def __init__(self, shape=None, type=None, x_column=None, fill_columns=None, x_domain=None, x_axis_label=None, position=None, bin_count=None): # noqa: E501 + def __init__(self, type=None, queries=None, colors=None, shape=None, note=None, show_note_when_empty=None, x_column=None, fill_columns=None, x_domain=None, x_axis_label=None, position=None, bin_count=None): # noqa: E501 """HistogramViewProperties - a model defined in OpenAPI""" # noqa: E501 - self._shape = None self._type = None + self._queries = None + self._colors = None + self._shape = None + self._note = None + self._show_note_when_empty = None self._x_column = None self._fill_columns = None self._x_domain = None @@ -65,22 +77,95 @@ def __init__(self, shape=None, type=None, x_column=None, fill_columns=None, x_do self._bin_count = None self.discriminator = None - if shape is not None: - self.shape = shape - if type is not None: - self.type = type - if x_column is not None: - self.x_column = x_column - if fill_columns is not None: - self.fill_columns = fill_columns - if x_domain is not None: - self.x_domain = x_domain - if x_axis_label is not None: - self.x_axis_label = x_axis_label - if position is not None: - self.position = position - if bin_count is not None: - self.bin_count = bin_count + self.type = type + self.queries = queries + self.colors = colors + self.shape = shape + self.note = note + self.show_note_when_empty = show_note_when_empty + self.x_column = x_column + self.fill_columns = fill_columns + self.x_domain = x_domain + self.x_axis_label = x_axis_label + self.position = position + self.bin_count = bin_count + + @property + def type(self): + """Gets the type of this HistogramViewProperties. # noqa: E501 + + + :return: The type of this HistogramViewProperties. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this HistogramViewProperties. + + + :param type: The type of this HistogramViewProperties. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["histogram"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def queries(self): + """Gets the queries of this HistogramViewProperties. # noqa: E501 + + + :return: The queries of this HistogramViewProperties. # noqa: E501 + :rtype: list[DashboardQuery] + """ + return self._queries + + @queries.setter + def queries(self, queries): + """Sets the queries of this HistogramViewProperties. + + + :param queries: The queries of this HistogramViewProperties. # noqa: E501 + :type: list[DashboardQuery] + """ + if queries is None: + raise ValueError("Invalid value for `queries`, must not be `None`") # noqa: E501 + + self._queries = queries + + @property + def colors(self): + """Gets the colors of this HistogramViewProperties. # noqa: E501 + + Colors define color encoding of data into a visualization # noqa: E501 + + :return: The colors of this HistogramViewProperties. # noqa: E501 + :rtype: list[DashboardColor] + """ + return self._colors + + @colors.setter + def colors(self, colors): + """Sets the colors of this HistogramViewProperties. + + Colors define color encoding of data into a visualization # noqa: E501 + + :param colors: The colors of this HistogramViewProperties. # noqa: E501 + :type: list[DashboardColor] + """ + if colors is None: + raise ValueError("Invalid value for `colors`, must not be `None`") # noqa: E501 + + self._colors = colors @property def shape(self): @@ -100,6 +185,8 @@ def shape(self, shape): :param shape: The shape of this HistogramViewProperties. # noqa: E501 :type: str """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 allowed_values = ["chronograf-v2"] # noqa: E501 if shape not in allowed_values: raise ValueError( @@ -110,31 +197,52 @@ def shape(self, shape): self._shape = shape @property - def type(self): - """Gets the type of this HistogramViewProperties. # noqa: E501 + def note(self): + """Gets the note of this HistogramViewProperties. # noqa: E501 - :return: The type of this HistogramViewProperties. # noqa: E501 + :return: The note of this HistogramViewProperties. # noqa: E501 :rtype: str """ - return self._type + return self._note - @type.setter - def type(self, type): - """Sets the type of this HistogramViewProperties. + @note.setter + def note(self, note): + """Sets the note of this HistogramViewProperties. - :param type: The type of this HistogramViewProperties. # noqa: E501 + :param note: The note of this HistogramViewProperties. # noqa: E501 :type: str """ - allowed_values = ["histogram"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) + if note is None: + raise ValueError("Invalid value for `note`, must not be `None`") # noqa: E501 - self._type = type + self._note = note + + @property + def show_note_when_empty(self): + """Gets the show_note_when_empty of this HistogramViewProperties. # noqa: E501 + + if true, will display note when empty # noqa: E501 + + :return: The show_note_when_empty of this HistogramViewProperties. # noqa: E501 + :rtype: bool + """ + return self._show_note_when_empty + + @show_note_when_empty.setter + def show_note_when_empty(self, show_note_when_empty): + """Sets the show_note_when_empty of this HistogramViewProperties. + + if true, will display note when empty # noqa: E501 + + :param show_note_when_empty: The show_note_when_empty of this HistogramViewProperties. # noqa: E501 + :type: bool + """ + if show_note_when_empty is None: + raise ValueError("Invalid value for `show_note_when_empty`, must not be `None`") # noqa: E501 + + self._show_note_when_empty = show_note_when_empty @property def x_column(self): @@ -154,6 +262,8 @@ def x_column(self, x_column): :param x_column: The x_column of this HistogramViewProperties. # noqa: E501 :type: str """ + if x_column is None: + raise ValueError("Invalid value for `x_column`, must not be `None`") # noqa: E501 self._x_column = x_column @@ -175,6 +285,8 @@ def fill_columns(self, fill_columns): :param fill_columns: The fill_columns of this HistogramViewProperties. # noqa: E501 :type: list[str] """ + if fill_columns is None: + raise ValueError("Invalid value for `fill_columns`, must not be `None`") # noqa: E501 self._fill_columns = fill_columns @@ -196,6 +308,8 @@ def x_domain(self, x_domain): :param x_domain: The x_domain of this HistogramViewProperties. # noqa: E501 :type: list[float] """ + if x_domain is None: + raise ValueError("Invalid value for `x_domain`, must not be `None`") # noqa: E501 self._x_domain = x_domain @@ -217,6 +331,8 @@ def x_axis_label(self, x_axis_label): :param x_axis_label: The x_axis_label of this HistogramViewProperties. # noqa: E501 :type: str """ + if x_axis_label is None: + raise ValueError("Invalid value for `x_axis_label`, must not be `None`") # noqa: E501 self._x_axis_label = x_axis_label @@ -238,6 +354,14 @@ def position(self, position): :param position: The position of this HistogramViewProperties. # noqa: E501 :type: str """ + if position is None: + raise ValueError("Invalid value for `position`, must not be `None`") # noqa: E501 + allowed_values = ["overlaid", "stacked"] # noqa: E501 + if position not in allowed_values: + raise ValueError( + "Invalid value for `position` ({0}), must be one of {1}" # noqa: E501 + .format(position, allowed_values) + ) self._position = position @@ -259,6 +383,8 @@ def bin_count(self, bin_count): :param bin_count: The bin_count of this HistogramViewProperties. # noqa: E501 :type: int """ + if bin_count is None: + raise ValueError("Invalid value for `bin_count`, must not be `None`") # noqa: E501 self._bin_count = bin_count diff --git a/influxdb2/models/identifier.py b/influxdb2/domain/identifier.py similarity index 100% rename from influxdb2/models/identifier.py rename to influxdb2/domain/identifier.py diff --git a/influxdb2/models/import_declaration.py b/influxdb2/domain/import_declaration.py similarity index 100% rename from influxdb2/models/import_declaration.py rename to influxdb2/domain/import_declaration.py diff --git a/influxdb2/models/index_expression.py b/influxdb2/domain/index_expression.py similarity index 100% rename from influxdb2/models/index_expression.py rename to influxdb2/domain/index_expression.py diff --git a/influxdb2/models/integer_literal.py b/influxdb2/domain/integer_literal.py similarity index 100% rename from influxdb2/models/integer_literal.py rename to influxdb2/domain/integer_literal.py diff --git a/influxdb2/models/is_onboarding.py b/influxdb2/domain/is_onboarding.py similarity index 100% rename from influxdb2/models/is_onboarding.py rename to influxdb2/domain/is_onboarding.py diff --git a/influxdb2/models/label.py b/influxdb2/domain/label.py similarity index 100% rename from influxdb2/models/label.py rename to influxdb2/domain/label.py diff --git a/influxdb2/models/label_create_request.py b/influxdb2/domain/label_create_request.py similarity index 100% rename from influxdb2/models/label_create_request.py rename to influxdb2/domain/label_create_request.py diff --git a/influxdb2/models/label_mapping.py b/influxdb2/domain/label_mapping.py similarity index 100% rename from influxdb2/models/label_mapping.py rename to influxdb2/domain/label_mapping.py diff --git a/influxdb2/models/label_response.py b/influxdb2/domain/label_response.py similarity index 100% rename from influxdb2/models/label_response.py rename to influxdb2/domain/label_response.py diff --git a/influxdb2/models/label_update.py b/influxdb2/domain/label_update.py similarity index 100% rename from influxdb2/models/label_update.py rename to influxdb2/domain/label_update.py diff --git a/influxdb2/models/labels_response.py b/influxdb2/domain/labels_response.py similarity index 100% rename from influxdb2/models/labels_response.py rename to influxdb2/domain/labels_response.py diff --git a/influxdb2/models/language_request.py b/influxdb2/domain/language_request.py similarity index 100% rename from influxdb2/models/language_request.py rename to influxdb2/domain/language_request.py diff --git a/influxdb2/models/legend.py b/influxdb2/domain/legend.py similarity index 100% rename from influxdb2/models/legend.py rename to influxdb2/domain/legend.py diff --git a/influxdb2/domain/level_rule.py b/influxdb2/domain/level_rule.py new file mode 100644 index 00000000..e0aa8cac --- /dev/null +++ b/influxdb2/domain/level_rule.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class LevelRule(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'level': 'CheckStatusLevel', + 'operation': 'str' + } + + attribute_map = { + 'level': 'level', + 'operation': 'operation' + } + + def __init__(self, level=None, operation=None): # noqa: E501 + """LevelRule - a model defined in OpenAPI""" # noqa: E501 + + self._level = None + self._operation = None + self.discriminator = None + + if level is not None: + self.level = level + if operation is not None: + self.operation = operation + + @property + def level(self): + """Gets the level of this LevelRule. # noqa: E501 + + + :return: The level of this LevelRule. # noqa: E501 + :rtype: CheckStatusLevel + """ + return self._level + + @level.setter + def level(self, level): + """Sets the level of this LevelRule. + + + :param level: The level of this LevelRule. # noqa: E501 + :type: CheckStatusLevel + """ + + self._level = level + + @property + def operation(self): + """Gets the operation of this LevelRule. # noqa: E501 + + + :return: The operation of this LevelRule. # noqa: E501 + :rtype: str + """ + return self._operation + + @operation.setter + def operation(self, operation): + """Sets the operation of this LevelRule. + + + :param operation: The operation of this LevelRule. # noqa: E501 + :type: str + """ + allowed_values = ["equal", "notequal"] # noqa: E501 + if operation not in allowed_values: + raise ValueError( + "Invalid value for `operation` ({0}), must be one of {1}" # noqa: E501 + .format(operation, allowed_values) + ) + + self._operation = operation + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, LevelRule): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/models/line_plus_single_stat_properties.py b/influxdb2/domain/line_plus_single_stat_properties.py similarity index 50% rename from influxdb2/models/line_plus_single_stat_properties.py rename to influxdb2/domain/line_plus_single_stat_properties.py index 11617165..0acc82b9 100644 --- a/influxdb2/models/line_plus_single_stat_properties.py +++ b/influxdb2/domain/line_plus_single_stat_properties.py @@ -31,72 +31,152 @@ class LinePlusSingleStatProperties(object): and the value is json key in definition. """ openapi_types = { - 'axes': 'Axes', - 'shape': 'str', 'type': 'str', + 'queries': 'list[DashboardQuery]', + 'colors': 'list[DashboardColor]', + 'shape': 'str', + 'note': 'str', + 'show_note_when_empty': 'bool', + 'axes': 'Axes', 'legend': 'Legend', + 'x_column': 'str', + 'y_column': 'str', + 'shade_below': 'bool', 'prefix': 'str', 'suffix': 'str', 'decimal_places': 'DecimalPlaces' } attribute_map = { - 'axes': 'axes', - 'shape': 'shape', 'type': 'type', + 'queries': 'queries', + 'colors': 'colors', + 'shape': 'shape', + 'note': 'note', + 'show_note_when_empty': 'showNoteWhenEmpty', + 'axes': 'axes', 'legend': 'legend', + 'x_column': 'xColumn', + 'y_column': 'yColumn', + 'shade_below': 'shadeBelow', 'prefix': 'prefix', 'suffix': 'suffix', 'decimal_places': 'decimalPlaces' } - def __init__(self, axes=None, shape=None, type=None, legend=None, prefix=None, suffix=None, decimal_places=None): # noqa: E501 + def __init__(self, type=None, queries=None, colors=None, shape=None, note=None, show_note_when_empty=None, axes=None, legend=None, x_column=None, y_column=None, shade_below=None, prefix=None, suffix=None, decimal_places=None): # noqa: E501 """LinePlusSingleStatProperties - a model defined in OpenAPI""" # noqa: E501 - self._axes = None - self._shape = None self._type = None + self._queries = None + self._colors = None + self._shape = None + self._note = None + self._show_note_when_empty = None + self._axes = None self._legend = None + self._x_column = None + self._y_column = None + self._shade_below = None self._prefix = None self._suffix = None self._decimal_places = None self.discriminator = None - if axes is not None: - self.axes = axes - if shape is not None: - self.shape = shape - if type is not None: - self.type = type - if legend is not None: - self.legend = legend - if prefix is not None: - self.prefix = prefix - if suffix is not None: - self.suffix = suffix - if decimal_places is not None: - self.decimal_places = decimal_places + self.type = type + self.queries = queries + self.colors = colors + self.shape = shape + self.note = note + self.show_note_when_empty = show_note_when_empty + self.axes = axes + self.legend = legend + if x_column is not None: + self.x_column = x_column + if y_column is not None: + self.y_column = y_column + if shade_below is not None: + self.shade_below = shade_below + self.prefix = prefix + self.suffix = suffix + self.decimal_places = decimal_places @property - def axes(self): - """Gets the axes of this LinePlusSingleStatProperties. # noqa: E501 + def type(self): + """Gets the type of this LinePlusSingleStatProperties. # noqa: E501 - :return: The axes of this LinePlusSingleStatProperties. # noqa: E501 - :rtype: Axes + :return: The type of this LinePlusSingleStatProperties. # noqa: E501 + :rtype: str """ - return self._axes + return self._type - @axes.setter - def axes(self, axes): - """Sets the axes of this LinePlusSingleStatProperties. + @type.setter + def type(self, type): + """Sets the type of this LinePlusSingleStatProperties. - :param axes: The axes of this LinePlusSingleStatProperties. # noqa: E501 - :type: Axes + :param type: The type of this LinePlusSingleStatProperties. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["line-plus-single-stat"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def queries(self): + """Gets the queries of this LinePlusSingleStatProperties. # noqa: E501 + + + :return: The queries of this LinePlusSingleStatProperties. # noqa: E501 + :rtype: list[DashboardQuery] """ + return self._queries - self._axes = axes + @queries.setter + def queries(self, queries): + """Sets the queries of this LinePlusSingleStatProperties. + + + :param queries: The queries of this LinePlusSingleStatProperties. # noqa: E501 + :type: list[DashboardQuery] + """ + if queries is None: + raise ValueError("Invalid value for `queries`, must not be `None`") # noqa: E501 + + self._queries = queries + + @property + def colors(self): + """Gets the colors of this LinePlusSingleStatProperties. # noqa: E501 + + Colors define color encoding of data into a visualization # noqa: E501 + + :return: The colors of this LinePlusSingleStatProperties. # noqa: E501 + :rtype: list[DashboardColor] + """ + return self._colors + + @colors.setter + def colors(self, colors): + """Sets the colors of this LinePlusSingleStatProperties. + + Colors define color encoding of data into a visualization # noqa: E501 + + :param colors: The colors of this LinePlusSingleStatProperties. # noqa: E501 + :type: list[DashboardColor] + """ + if colors is None: + raise ValueError("Invalid value for `colors`, must not be `None`") # noqa: E501 + + self._colors = colors @property def shape(self): @@ -116,6 +196,8 @@ def shape(self, shape): :param shape: The shape of this LinePlusSingleStatProperties. # noqa: E501 :type: str """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 allowed_values = ["chronograf-v2"] # noqa: E501 if shape not in allowed_values: raise ValueError( @@ -126,31 +208,75 @@ def shape(self, shape): self._shape = shape @property - def type(self): - """Gets the type of this LinePlusSingleStatProperties. # noqa: E501 + def note(self): + """Gets the note of this LinePlusSingleStatProperties. # noqa: E501 - :return: The type of this LinePlusSingleStatProperties. # noqa: E501 + :return: The note of this LinePlusSingleStatProperties. # noqa: E501 :rtype: str """ - return self._type + return self._note - @type.setter - def type(self, type): - """Sets the type of this LinePlusSingleStatProperties. + @note.setter + def note(self, note): + """Sets the note of this LinePlusSingleStatProperties. - :param type: The type of this LinePlusSingleStatProperties. # noqa: E501 + :param note: The note of this LinePlusSingleStatProperties. # noqa: E501 :type: str """ - allowed_values = ["line-plus-single-stat"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) + if note is None: + raise ValueError("Invalid value for `note`, must not be `None`") # noqa: E501 - self._type = type + self._note = note + + @property + def show_note_when_empty(self): + """Gets the show_note_when_empty of this LinePlusSingleStatProperties. # noqa: E501 + + if true, will display note when empty # noqa: E501 + + :return: The show_note_when_empty of this LinePlusSingleStatProperties. # noqa: E501 + :rtype: bool + """ + return self._show_note_when_empty + + @show_note_when_empty.setter + def show_note_when_empty(self, show_note_when_empty): + """Sets the show_note_when_empty of this LinePlusSingleStatProperties. + + if true, will display note when empty # noqa: E501 + + :param show_note_when_empty: The show_note_when_empty of this LinePlusSingleStatProperties. # noqa: E501 + :type: bool + """ + if show_note_when_empty is None: + raise ValueError("Invalid value for `show_note_when_empty`, must not be `None`") # noqa: E501 + + self._show_note_when_empty = show_note_when_empty + + @property + def axes(self): + """Gets the axes of this LinePlusSingleStatProperties. # noqa: E501 + + + :return: The axes of this LinePlusSingleStatProperties. # noqa: E501 + :rtype: Axes + """ + return self._axes + + @axes.setter + def axes(self, axes): + """Sets the axes of this LinePlusSingleStatProperties. + + + :param axes: The axes of this LinePlusSingleStatProperties. # noqa: E501 + :type: Axes + """ + if axes is None: + raise ValueError("Invalid value for `axes`, must not be `None`") # noqa: E501 + + self._axes = axes @property def legend(self): @@ -170,9 +296,74 @@ def legend(self, legend): :param legend: The legend of this LinePlusSingleStatProperties. # noqa: E501 :type: Legend """ + if legend is None: + raise ValueError("Invalid value for `legend`, must not be `None`") # noqa: E501 self._legend = legend + @property + def x_column(self): + """Gets the x_column of this LinePlusSingleStatProperties. # noqa: E501 + + + :return: The x_column of this LinePlusSingleStatProperties. # noqa: E501 + :rtype: str + """ + return self._x_column + + @x_column.setter + def x_column(self, x_column): + """Sets the x_column of this LinePlusSingleStatProperties. + + + :param x_column: The x_column of this LinePlusSingleStatProperties. # noqa: E501 + :type: str + """ + + self._x_column = x_column + + @property + def y_column(self): + """Gets the y_column of this LinePlusSingleStatProperties. # noqa: E501 + + + :return: The y_column of this LinePlusSingleStatProperties. # noqa: E501 + :rtype: str + """ + return self._y_column + + @y_column.setter + def y_column(self, y_column): + """Sets the y_column of this LinePlusSingleStatProperties. + + + :param y_column: The y_column of this LinePlusSingleStatProperties. # noqa: E501 + :type: str + """ + + self._y_column = y_column + + @property + def shade_below(self): + """Gets the shade_below of this LinePlusSingleStatProperties. # noqa: E501 + + + :return: The shade_below of this LinePlusSingleStatProperties. # noqa: E501 + :rtype: bool + """ + return self._shade_below + + @shade_below.setter + def shade_below(self, shade_below): + """Sets the shade_below of this LinePlusSingleStatProperties. + + + :param shade_below: The shade_below of this LinePlusSingleStatProperties. # noqa: E501 + :type: bool + """ + + self._shade_below = shade_below + @property def prefix(self): """Gets the prefix of this LinePlusSingleStatProperties. # noqa: E501 @@ -191,6 +382,8 @@ def prefix(self, prefix): :param prefix: The prefix of this LinePlusSingleStatProperties. # noqa: E501 :type: str """ + if prefix is None: + raise ValueError("Invalid value for `prefix`, must not be `None`") # noqa: E501 self._prefix = prefix @@ -212,6 +405,8 @@ def suffix(self, suffix): :param suffix: The suffix of this LinePlusSingleStatProperties. # noqa: E501 :type: str """ + if suffix is None: + raise ValueError("Invalid value for `suffix`, must not be `None`") # noqa: E501 self._suffix = suffix @@ -233,6 +428,8 @@ def decimal_places(self, decimal_places): :param decimal_places: The decimal_places of this LinePlusSingleStatProperties. # noqa: E501 :type: DecimalPlaces """ + if decimal_places is None: + raise ValueError("Invalid value for `decimal_places`, must not be `None`") # noqa: E501 self._decimal_places = decimal_places diff --git a/influxdb2/models/line_protocol_error.py b/influxdb2/domain/line_protocol_error.py similarity index 100% rename from influxdb2/models/line_protocol_error.py rename to influxdb2/domain/line_protocol_error.py diff --git a/influxdb2/models/line_protocol_length_error.py b/influxdb2/domain/line_protocol_length_error.py similarity index 100% rename from influxdb2/models/line_protocol_length_error.py rename to influxdb2/domain/line_protocol_length_error.py diff --git a/influxdb2/models/links.py b/influxdb2/domain/links.py similarity index 100% rename from influxdb2/models/links.py rename to influxdb2/domain/links.py diff --git a/influxdb2/models/log_event.py b/influxdb2/domain/log_event.py similarity index 100% rename from influxdb2/models/log_event.py rename to influxdb2/domain/log_event.py diff --git a/influxdb2/models/logical_expression.py b/influxdb2/domain/logical_expression.py similarity index 100% rename from influxdb2/models/logical_expression.py rename to influxdb2/domain/logical_expression.py diff --git a/influxdb2/models/logs.py b/influxdb2/domain/logs.py similarity index 100% rename from influxdb2/models/logs.py rename to influxdb2/domain/logs.py diff --git a/influxdb2/models/map_variable_properties.py b/influxdb2/domain/map_variable_properties.py similarity index 100% rename from influxdb2/models/map_variable_properties.py rename to influxdb2/domain/map_variable_properties.py diff --git a/influxdb2/models/markdown_view_properties.py b/influxdb2/domain/markdown_view_properties.py similarity index 90% rename from influxdb2/models/markdown_view_properties.py rename to influxdb2/domain/markdown_view_properties.py index 6197a3e7..cd41a001 100644 --- a/influxdb2/models/markdown_view_properties.py +++ b/influxdb2/domain/markdown_view_properties.py @@ -31,85 +31,86 @@ class MarkdownViewProperties(object): and the value is json key in definition. """ openapi_types = { - 'shape': 'str', 'type': 'str', + 'shape': 'str', 'note': 'str' } attribute_map = { - 'shape': 'shape', 'type': 'type', + 'shape': 'shape', 'note': 'note' } - def __init__(self, shape=None, type=None, note=None): # noqa: E501 + def __init__(self, type=None, shape=None, note=None): # noqa: E501 """MarkdownViewProperties - a model defined in OpenAPI""" # noqa: E501 - self._shape = None self._type = None + self._shape = None self._note = None self.discriminator = None - if shape is not None: - self.shape = shape - if type is not None: - self.type = type - if note is not None: - self.note = note + self.type = type + self.shape = shape + self.note = note @property - def shape(self): - """Gets the shape of this MarkdownViewProperties. # noqa: E501 + def type(self): + """Gets the type of this MarkdownViewProperties. # noqa: E501 - :return: The shape of this MarkdownViewProperties. # noqa: E501 + :return: The type of this MarkdownViewProperties. # noqa: E501 :rtype: str """ - return self._shape + return self._type - @shape.setter - def shape(self, shape): - """Sets the shape of this MarkdownViewProperties. + @type.setter + def type(self, type): + """Sets the type of this MarkdownViewProperties. - :param shape: The shape of this MarkdownViewProperties. # noqa: E501 + :param type: The type of this MarkdownViewProperties. # noqa: E501 :type: str """ - allowed_values = ["chronograf-v2"] # noqa: E501 - if shape not in allowed_values: + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["markdown"] # noqa: E501 + if type not in allowed_values: raise ValueError( - "Invalid value for `shape` ({0}), must be one of {1}" # noqa: E501 - .format(shape, allowed_values) + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) ) - self._shape = shape + self._type = type @property - def type(self): - """Gets the type of this MarkdownViewProperties. # noqa: E501 + def shape(self): + """Gets the shape of this MarkdownViewProperties. # noqa: E501 - :return: The type of this MarkdownViewProperties. # noqa: E501 + :return: The shape of this MarkdownViewProperties. # noqa: E501 :rtype: str """ - return self._type + return self._shape - @type.setter - def type(self, type): - """Sets the type of this MarkdownViewProperties. + @shape.setter + def shape(self, shape): + """Sets the shape of this MarkdownViewProperties. - :param type: The type of this MarkdownViewProperties. # noqa: E501 + :param shape: The shape of this MarkdownViewProperties. # noqa: E501 :type: str """ - allowed_values = ["markdown"] # noqa: E501 - if type not in allowed_values: + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 + allowed_values = ["chronograf-v2"] # noqa: E501 + if shape not in allowed_values: raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) + "Invalid value for `shape` ({0}), must be one of {1}" # noqa: E501 + .format(shape, allowed_values) ) - self._type = type + self._shape = shape @property def note(self): @@ -129,6 +130,8 @@ def note(self, note): :param note: The note of this MarkdownViewProperties. # noqa: E501 :type: str """ + if note is None: + raise ValueError("Invalid value for `note`, must not be `None`") # noqa: E501 self._note = note diff --git a/influxdb2/models/member_assignment.py b/influxdb2/domain/member_assignment.py similarity index 100% rename from influxdb2/models/member_assignment.py rename to influxdb2/domain/member_assignment.py diff --git a/influxdb2/models/member_expression.py b/influxdb2/domain/member_expression.py similarity index 100% rename from influxdb2/models/member_expression.py rename to influxdb2/domain/member_expression.py diff --git a/influxdb2/models/model_property.py b/influxdb2/domain/model_property.py similarity index 100% rename from influxdb2/models/model_property.py rename to influxdb2/domain/model_property.py diff --git a/influxdb2/models/node.py b/influxdb2/domain/node.py similarity index 100% rename from influxdb2/models/node.py rename to influxdb2/domain/node.py diff --git a/influxdb2/domain/notification_endpoint.py b/influxdb2/domain/notification_endpoint.py new file mode 100644 index 00000000..06d8c5c4 --- /dev/null +++ b/influxdb2/domain/notification_endpoint.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class NotificationEndpoint(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """NotificationEndpoint - a model defined in OpenAPI""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, NotificationEndpoint): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/domain/notification_endpoint_base.py b/influxdb2/domain/notification_endpoint_base.py new file mode 100644 index 00000000..cac103c8 --- /dev/null +++ b/influxdb2/domain/notification_endpoint_base.py @@ -0,0 +1,304 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class NotificationEndpointBase(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'str', + 'org_id': 'str', + 'user_id': 'str', + 'created_at': 'datetime', + 'updated_at': 'datetime', + 'description': 'str', + 'status': 'str', + 'labels': 'list[Label]' + } + + attribute_map = { + 'id': 'id', + 'org_id': 'orgID', + 'user_id': 'userID', + 'created_at': 'createdAt', + 'updated_at': 'updatedAt', + 'description': 'description', + 'status': 'status', + 'labels': 'labels' + } + + def __init__(self, id=None, org_id=None, user_id=None, created_at=None, updated_at=None, description=None, status='active', labels=None): # noqa: E501 + """NotificationEndpointBase - a model defined in OpenAPI""" # noqa: E501 + + self._id = None + self._org_id = None + self._user_id = None + self._created_at = None + self._updated_at = None + self._description = None + self._status = None + self._labels = None + self.discriminator = None + + if id is not None: + self.id = id + if org_id is not None: + self.org_id = org_id + if user_id is not None: + self.user_id = user_id + if created_at is not None: + self.created_at = created_at + if updated_at is not None: + self.updated_at = updated_at + if description is not None: + self.description = description + if status is not None: + self.status = status + if labels is not None: + self.labels = labels + + @property + def id(self): + """Gets the id of this NotificationEndpointBase. # noqa: E501 + + + :return: The id of this NotificationEndpointBase. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this NotificationEndpointBase. + + + :param id: The id of this NotificationEndpointBase. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def org_id(self): + """Gets the org_id of this NotificationEndpointBase. # noqa: E501 + + + :return: The org_id of this NotificationEndpointBase. # noqa: E501 + :rtype: str + """ + return self._org_id + + @org_id.setter + def org_id(self, org_id): + """Sets the org_id of this NotificationEndpointBase. + + + :param org_id: The org_id of this NotificationEndpointBase. # noqa: E501 + :type: str + """ + + self._org_id = org_id + + @property + def user_id(self): + """Gets the user_id of this NotificationEndpointBase. # noqa: E501 + + + :return: The user_id of this NotificationEndpointBase. # noqa: E501 + :rtype: str + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this NotificationEndpointBase. + + + :param user_id: The user_id of this NotificationEndpointBase. # noqa: E501 + :type: str + """ + + self._user_id = user_id + + @property + def created_at(self): + """Gets the created_at of this NotificationEndpointBase. # noqa: E501 + + + :return: The created_at of this NotificationEndpointBase. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this NotificationEndpointBase. + + + :param created_at: The created_at of this NotificationEndpointBase. # noqa: E501 + :type: datetime + """ + + self._created_at = created_at + + @property + def updated_at(self): + """Gets the updated_at of this NotificationEndpointBase. # noqa: E501 + + + :return: The updated_at of this NotificationEndpointBase. # noqa: E501 + :rtype: datetime + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this NotificationEndpointBase. + + + :param updated_at: The updated_at of this NotificationEndpointBase. # noqa: E501 + :type: datetime + """ + + self._updated_at = updated_at + + @property + def description(self): + """Gets the description of this NotificationEndpointBase. # noqa: E501 + + An optional description of the notification endpoint # noqa: E501 + + :return: The description of this NotificationEndpointBase. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this NotificationEndpointBase. + + An optional description of the notification endpoint # noqa: E501 + + :param description: The description of this NotificationEndpointBase. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def status(self): + """Gets the status of this NotificationEndpointBase. # noqa: E501 + + The status of the endpoint. # noqa: E501 + + :return: The status of this NotificationEndpointBase. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this NotificationEndpointBase. + + The status of the endpoint. # noqa: E501 + + :param status: The status of this NotificationEndpointBase. # noqa: E501 + :type: str + """ + allowed_values = ["active", "inactive"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def labels(self): + """Gets the labels of this NotificationEndpointBase. # noqa: E501 + + + :return: The labels of this NotificationEndpointBase. # noqa: E501 + :rtype: list[Label] + """ + return self._labels + + @labels.setter + def labels(self, labels): + """Sets the labels of this NotificationEndpointBase. + + + :param labels: The labels of this NotificationEndpointBase. # noqa: E501 + :type: list[Label] + """ + + self._labels = labels + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, NotificationEndpointBase): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/domain/notification_endpoints.py b/influxdb2/domain/notification_endpoints.py new file mode 100644 index 00000000..1b4faae1 --- /dev/null +++ b/influxdb2/domain/notification_endpoints.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class NotificationEndpoints(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'notification_endpoints': 'list[NotificationEndpoint]', + 'links': 'Links' + } + + attribute_map = { + 'notification_endpoints': 'notificationEndpoints', + 'links': 'links' + } + + def __init__(self, notification_endpoints=None, links=None): # noqa: E501 + """NotificationEndpoints - a model defined in OpenAPI""" # noqa: E501 + + self._notification_endpoints = None + self._links = None + self.discriminator = None + + if notification_endpoints is not None: + self.notification_endpoints = notification_endpoints + if links is not None: + self.links = links + + @property + def notification_endpoints(self): + """Gets the notification_endpoints of this NotificationEndpoints. # noqa: E501 + + + :return: The notification_endpoints of this NotificationEndpoints. # noqa: E501 + :rtype: list[NotificationEndpoint] + """ + return self._notification_endpoints + + @notification_endpoints.setter + def notification_endpoints(self, notification_endpoints): + """Sets the notification_endpoints of this NotificationEndpoints. + + + :param notification_endpoints: The notification_endpoints of this NotificationEndpoints. # noqa: E501 + :type: list[NotificationEndpoint] + """ + + self._notification_endpoints = notification_endpoints + + @property + def links(self): + """Gets the links of this NotificationEndpoints. # noqa: E501 + + + :return: The links of this NotificationEndpoints. # noqa: E501 + :rtype: Links + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this NotificationEndpoints. + + + :param links: The links of this NotificationEndpoints. # noqa: E501 + :type: Links + """ + + self._links = links + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, NotificationEndpoints): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/domain/notification_rule.py b/influxdb2/domain/notification_rule.py new file mode 100644 index 00000000..04ec6725 --- /dev/null +++ b/influxdb2/domain/notification_rule.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class NotificationRule(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """NotificationRule - a model defined in OpenAPI""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, NotificationRule): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/domain/notification_rule_base.py b/influxdb2/domain/notification_rule_base.py new file mode 100644 index 00000000..89f5a06b --- /dev/null +++ b/influxdb2/domain/notification_rule_base.py @@ -0,0 +1,607 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class NotificationRuleBase(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'str', + 'notify_endpoint_id': 'str', + 'org_id': 'str', + 'authorization_id': 'str', + 'created_at': 'datetime', + 'updated_at': 'datetime', + 'status': 'TaskStatusType', + 'name': 'str', + 'sleep_until': 'str', + 'every': 'str', + 'offset': 'str', + 'cron': 'str', + 'runbook_link': 'str', + 'limit_every': 'int', + 'limit': 'int', + 'tag_rules': 'list[TagRule]', + 'description': 'str', + 'status_rules': 'list[StatusRule]', + 'labels': 'list[Label]' + } + + attribute_map = { + 'id': 'id', + 'notify_endpoint_id': 'notifyEndpointID', + 'org_id': 'orgID', + 'authorization_id': 'authorizationID', + 'created_at': 'createdAt', + 'updated_at': 'updatedAt', + 'status': 'status', + 'name': 'name', + 'sleep_until': 'sleepUntil', + 'every': 'every', + 'offset': 'offset', + 'cron': 'cron', + 'runbook_link': 'runbookLink', + 'limit_every': 'limitEvery', + 'limit': 'limit', + 'tag_rules': 'tagRules', + 'description': 'description', + 'status_rules': 'statusRules', + 'labels': 'labels' + } + + def __init__(self, id=None, notify_endpoint_id=None, org_id=None, authorization_id=None, created_at=None, updated_at=None, status=None, name=None, sleep_until=None, every=None, offset=None, cron=None, runbook_link=None, limit_every=None, limit=None, tag_rules=None, description=None, status_rules=None, labels=None): # noqa: E501 + """NotificationRuleBase - a model defined in OpenAPI""" # noqa: E501 + + self._id = None + self._notify_endpoint_id = None + self._org_id = None + self._authorization_id = None + self._created_at = None + self._updated_at = None + self._status = None + self._name = None + self._sleep_until = None + self._every = None + self._offset = None + self._cron = None + self._runbook_link = None + self._limit_every = None + self._limit = None + self._tag_rules = None + self._description = None + self._status_rules = None + self._labels = None + self.discriminator = None + + self.id = id + if notify_endpoint_id is not None: + self.notify_endpoint_id = notify_endpoint_id + if org_id is not None: + self.org_id = org_id + if authorization_id is not None: + self.authorization_id = authorization_id + if created_at is not None: + self.created_at = created_at + if updated_at is not None: + self.updated_at = updated_at + self.status = status + self.name = name + if sleep_until is not None: + self.sleep_until = sleep_until + if every is not None: + self.every = every + if offset is not None: + self.offset = offset + if cron is not None: + self.cron = cron + if runbook_link is not None: + self.runbook_link = runbook_link + if limit_every is not None: + self.limit_every = limit_every + if limit is not None: + self.limit = limit + self.tag_rules = tag_rules + if description is not None: + self.description = description + self.status_rules = status_rules + if labels is not None: + self.labels = labels + + @property + def id(self): + """Gets the id of this NotificationRuleBase. # noqa: E501 + + + :return: The id of this NotificationRuleBase. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this NotificationRuleBase. + + + :param id: The id of this NotificationRuleBase. # noqa: E501 + :type: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def notify_endpoint_id(self): + """Gets the notify_endpoint_id of this NotificationRuleBase. # noqa: E501 + + + :return: The notify_endpoint_id of this NotificationRuleBase. # noqa: E501 + :rtype: str + """ + return self._notify_endpoint_id + + @notify_endpoint_id.setter + def notify_endpoint_id(self, notify_endpoint_id): + """Sets the notify_endpoint_id of this NotificationRuleBase. + + + :param notify_endpoint_id: The notify_endpoint_id of this NotificationRuleBase. # noqa: E501 + :type: str + """ + + self._notify_endpoint_id = notify_endpoint_id + + @property + def org_id(self): + """Gets the org_id of this NotificationRuleBase. # noqa: E501 + + the ID of the organization that owns this notification rule. # noqa: E501 + + :return: The org_id of this NotificationRuleBase. # noqa: E501 + :rtype: str + """ + return self._org_id + + @org_id.setter + def org_id(self, org_id): + """Sets the org_id of this NotificationRuleBase. + + the ID of the organization that owns this notification rule. # noqa: E501 + + :param org_id: The org_id of this NotificationRuleBase. # noqa: E501 + :type: str + """ + + self._org_id = org_id + + @property + def authorization_id(self): + """Gets the authorization_id of this NotificationRuleBase. # noqa: E501 + + The ID of the authorization used to create this notification rule. # noqa: E501 + + :return: The authorization_id of this NotificationRuleBase. # noqa: E501 + :rtype: str + """ + return self._authorization_id + + @authorization_id.setter + def authorization_id(self, authorization_id): + """Sets the authorization_id of this NotificationRuleBase. + + The ID of the authorization used to create this notification rule. # noqa: E501 + + :param authorization_id: The authorization_id of this NotificationRuleBase. # noqa: E501 + :type: str + """ + + self._authorization_id = authorization_id + + @property + def created_at(self): + """Gets the created_at of this NotificationRuleBase. # noqa: E501 + + + :return: The created_at of this NotificationRuleBase. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this NotificationRuleBase. + + + :param created_at: The created_at of this NotificationRuleBase. # noqa: E501 + :type: datetime + """ + + self._created_at = created_at + + @property + def updated_at(self): + """Gets the updated_at of this NotificationRuleBase. # noqa: E501 + + + :return: The updated_at of this NotificationRuleBase. # noqa: E501 + :rtype: datetime + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this NotificationRuleBase. + + + :param updated_at: The updated_at of this NotificationRuleBase. # noqa: E501 + :type: datetime + """ + + self._updated_at = updated_at + + @property + def status(self): + """Gets the status of this NotificationRuleBase. # noqa: E501 + + + :return: The status of this NotificationRuleBase. # noqa: E501 + :rtype: TaskStatusType + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this NotificationRuleBase. + + + :param status: The status of this NotificationRuleBase. # noqa: E501 + :type: TaskStatusType + """ + if status is None: + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + @property + def name(self): + """Gets the name of this NotificationRuleBase. # noqa: E501 + + human-readable name describing the notification rule # noqa: E501 + + :return: The name of this NotificationRuleBase. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this NotificationRuleBase. + + human-readable name describing the notification rule # noqa: E501 + + :param name: The name of this NotificationRuleBase. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def sleep_until(self): + """Gets the sleep_until of this NotificationRuleBase. # noqa: E501 + + + :return: The sleep_until of this NotificationRuleBase. # noqa: E501 + :rtype: str + """ + return self._sleep_until + + @sleep_until.setter + def sleep_until(self, sleep_until): + """Sets the sleep_until of this NotificationRuleBase. + + + :param sleep_until: The sleep_until of this NotificationRuleBase. # noqa: E501 + :type: str + """ + + self._sleep_until = sleep_until + + @property + def every(self): + """Gets the every of this NotificationRuleBase. # noqa: E501 + + notification repetition interval # noqa: E501 + + :return: The every of this NotificationRuleBase. # noqa: E501 + :rtype: str + """ + return self._every + + @every.setter + def every(self, every): + """Sets the every of this NotificationRuleBase. + + notification repetition interval # noqa: E501 + + :param every: The every of this NotificationRuleBase. # noqa: E501 + :type: str + """ + + self._every = every + + @property + def offset(self): + """Gets the offset of this NotificationRuleBase. # noqa: E501 + + Duration to delay after the schedule, before executing check. # noqa: E501 + + :return: The offset of this NotificationRuleBase. # noqa: E501 + :rtype: str + """ + return self._offset + + @offset.setter + def offset(self, offset): + """Sets the offset of this NotificationRuleBase. + + Duration to delay after the schedule, before executing check. # noqa: E501 + + :param offset: The offset of this NotificationRuleBase. # noqa: E501 + :type: str + """ + + self._offset = offset + + @property + def cron(self): + """Gets the cron of this NotificationRuleBase. # noqa: E501 + + notification repetition interval in the form '* * * * * *'; # noqa: E501 + + :return: The cron of this NotificationRuleBase. # noqa: E501 + :rtype: str + """ + return self._cron + + @cron.setter + def cron(self, cron): + """Sets the cron of this NotificationRuleBase. + + notification repetition interval in the form '* * * * * *'; # noqa: E501 + + :param cron: The cron of this NotificationRuleBase. # noqa: E501 + :type: str + """ + + self._cron = cron + + @property + def runbook_link(self): + """Gets the runbook_link of this NotificationRuleBase. # noqa: E501 + + + :return: The runbook_link of this NotificationRuleBase. # noqa: E501 + :rtype: str + """ + return self._runbook_link + + @runbook_link.setter + def runbook_link(self, runbook_link): + """Sets the runbook_link of this NotificationRuleBase. + + + :param runbook_link: The runbook_link of this NotificationRuleBase. # noqa: E501 + :type: str + """ + + self._runbook_link = runbook_link + + @property + def limit_every(self): + """Gets the limit_every of this NotificationRuleBase. # noqa: E501 + + don't notify me more than times every seconds. If set, limit cannot be empty. # noqa: E501 + + :return: The limit_every of this NotificationRuleBase. # noqa: E501 + :rtype: int + """ + return self._limit_every + + @limit_every.setter + def limit_every(self, limit_every): + """Sets the limit_every of this NotificationRuleBase. + + don't notify me more than times every seconds. If set, limit cannot be empty. # noqa: E501 + + :param limit_every: The limit_every of this NotificationRuleBase. # noqa: E501 + :type: int + """ + + self._limit_every = limit_every + + @property + def limit(self): + """Gets the limit of this NotificationRuleBase. # noqa: E501 + + don't notify me more than times every seconds. If set, limitEvery cannot be empty. # noqa: E501 + + :return: The limit of this NotificationRuleBase. # noqa: E501 + :rtype: int + """ + return self._limit + + @limit.setter + def limit(self, limit): + """Sets the limit of this NotificationRuleBase. + + don't notify me more than times every seconds. If set, limitEvery cannot be empty. # noqa: E501 + + :param limit: The limit of this NotificationRuleBase. # noqa: E501 + :type: int + """ + + self._limit = limit + + @property + def tag_rules(self): + """Gets the tag_rules of this NotificationRuleBase. # noqa: E501 + + list of tag rules the notification rule attempts to match # noqa: E501 + + :return: The tag_rules of this NotificationRuleBase. # noqa: E501 + :rtype: list[TagRule] + """ + return self._tag_rules + + @tag_rules.setter + def tag_rules(self, tag_rules): + """Sets the tag_rules of this NotificationRuleBase. + + list of tag rules the notification rule attempts to match # noqa: E501 + + :param tag_rules: The tag_rules of this NotificationRuleBase. # noqa: E501 + :type: list[TagRule] + """ + if tag_rules is None: + raise ValueError("Invalid value for `tag_rules`, must not be `None`") # noqa: E501 + + self._tag_rules = tag_rules + + @property + def description(self): + """Gets the description of this NotificationRuleBase. # noqa: E501 + + An optional description of the notification rule # noqa: E501 + + :return: The description of this NotificationRuleBase. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this NotificationRuleBase. + + An optional description of the notification rule # noqa: E501 + + :param description: The description of this NotificationRuleBase. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def status_rules(self): + """Gets the status_rules of this NotificationRuleBase. # noqa: E501 + + list of status rules the notification rule attempts to match # noqa: E501 + + :return: The status_rules of this NotificationRuleBase. # noqa: E501 + :rtype: list[StatusRule] + """ + return self._status_rules + + @status_rules.setter + def status_rules(self, status_rules): + """Sets the status_rules of this NotificationRuleBase. + + list of status rules the notification rule attempts to match # noqa: E501 + + :param status_rules: The status_rules of this NotificationRuleBase. # noqa: E501 + :type: list[StatusRule] + """ + if status_rules is None: + raise ValueError("Invalid value for `status_rules`, must not be `None`") # noqa: E501 + + self._status_rules = status_rules + + @property + def labels(self): + """Gets the labels of this NotificationRuleBase. # noqa: E501 + + + :return: The labels of this NotificationRuleBase. # noqa: E501 + :rtype: list[Label] + """ + return self._labels + + @labels.setter + def labels(self, labels): + """Sets the labels of this NotificationRuleBase. + + + :param labels: The labels of this NotificationRuleBase. # noqa: E501 + :type: list[Label] + """ + + self._labels = labels + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, NotificationRuleBase): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/models/log_viewer_column.py b/influxdb2/domain/notification_rule_update.py similarity index 52% rename from influxdb2/models/log_viewer_column.py rename to influxdb2/domain/notification_rule_update.py index 3e30827e..68e70abc 100644 --- a/influxdb2/models/log_viewer_column.py +++ b/influxdb2/domain/notification_rule_update.py @@ -16,7 +16,7 @@ import six -class LogViewerColumn(object): +class NotificationRuleUpdate(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -32,100 +32,99 @@ class LogViewerColumn(object): """ openapi_types = { 'name': 'str', - 'position': 'int', - 'settings': 'list[LogViewerColumnSettings]' + 'description': 'str', + 'status': 'str' } attribute_map = { 'name': 'name', - 'position': 'position', - 'settings': 'settings' + 'description': 'description', + 'status': 'status' } - def __init__(self, name=None, position=None, settings=None): # noqa: E501 - """LogViewerColumn - a model defined in OpenAPI""" # noqa: E501 + def __init__(self, name=None, description=None, status=None): # noqa: E501 + """NotificationRuleUpdate - a model defined in OpenAPI""" # noqa: E501 self._name = None - self._position = None - self._settings = None + self._description = None + self._status = None self.discriminator = None - self.name = name - self.position = position - self.settings = settings + if name is not None: + self.name = name + if description is not None: + self.description = description + if status is not None: + self.status = status @property def name(self): - """Gets the name of this LogViewerColumn. # noqa: E501 + """Gets the name of this NotificationRuleUpdate. # noqa: E501 - Unique identifier name of the column # noqa: E501 - :return: The name of this LogViewerColumn. # noqa: E501 + :return: The name of this NotificationRuleUpdate. # noqa: E501 :rtype: str """ return self._name @name.setter def name(self, name): - """Sets the name of this LogViewerColumn. + """Sets the name of this NotificationRuleUpdate. - Unique identifier name of the column # noqa: E501 - :param name: The name of this LogViewerColumn. # noqa: E501 + :param name: The name of this NotificationRuleUpdate. # noqa: E501 :type: str """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name @property - def position(self): - """Gets the position of this LogViewerColumn. # noqa: E501 + def description(self): + """Gets the description of this NotificationRuleUpdate. # noqa: E501 - :return: The position of this LogViewerColumn. # noqa: E501 - :rtype: int + :return: The description of this NotificationRuleUpdate. # noqa: E501 + :rtype: str """ - return self._position + return self._description - @position.setter - def position(self, position): - """Sets the position of this LogViewerColumn. + @description.setter + def description(self, description): + """Sets the description of this NotificationRuleUpdate. - :param position: The position of this LogViewerColumn. # noqa: E501 - :type: int + :param description: The description of this NotificationRuleUpdate. # noqa: E501 + :type: str """ - if position is None: - raise ValueError("Invalid value for `position`, must not be `None`") # noqa: E501 - self._position = position + self._description = description @property - def settings(self): - """Gets the settings of this LogViewerColumn. # noqa: E501 + def status(self): + """Gets the status of this NotificationRuleUpdate. # noqa: E501 - Composable settings options for the column # noqa: E501 - :return: The settings of this LogViewerColumn. # noqa: E501 - :rtype: list[LogViewerColumnSettings] + :return: The status of this NotificationRuleUpdate. # noqa: E501 + :rtype: str """ - return self._settings + return self._status - @settings.setter - def settings(self, settings): - """Sets the settings of this LogViewerColumn. + @status.setter + def status(self, status): + """Sets the status of this NotificationRuleUpdate. - Composable settings options for the column # noqa: E501 - :param settings: The settings of this LogViewerColumn. # noqa: E501 - :type: list[LogViewerColumnSettings] + :param status: The status of this NotificationRuleUpdate. # noqa: E501 + :type: str """ - if settings is None: - raise ValueError("Invalid value for `settings`, must not be `None`") # noqa: E501 + allowed_values = ["active", "inactive"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) - self._settings = settings + self._status = status def to_dict(self): """Returns the model properties as a dict""" @@ -161,7 +160,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, LogViewerColumn): + if not isinstance(other, NotificationRuleUpdate): return False return self.__dict__ == other.__dict__ diff --git a/influxdb2/models/dashboard_query_range.py b/influxdb2/domain/notification_rules.py similarity index 55% rename from influxdb2/models/dashboard_query_range.py rename to influxdb2/domain/notification_rules.py index 319d19b5..def07c5e 100644 --- a/influxdb2/models/dashboard_query_range.py +++ b/influxdb2/domain/notification_rules.py @@ -16,7 +16,7 @@ import six -class DashboardQueryRange(object): +class NotificationRules(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -31,74 +31,68 @@ class DashboardQueryRange(object): and the value is json key in definition. """ openapi_types = { - 'upper': 'int', - 'lower': 'int' + 'notification_rules': 'list[NotificationRule]', + 'links': 'Links' } attribute_map = { - 'upper': 'upper', - 'lower': 'lower' + 'notification_rules': 'notificationRules', + 'links': 'links' } - def __init__(self, upper=None, lower=None): # noqa: E501 - """DashboardQueryRange - a model defined in OpenAPI""" # noqa: E501 + def __init__(self, notification_rules=None, links=None): # noqa: E501 + """NotificationRules - a model defined in OpenAPI""" # noqa: E501 - self._upper = None - self._lower = None + self._notification_rules = None + self._links = None self.discriminator = None - self.upper = upper - self.lower = lower + if notification_rules is not None: + self.notification_rules = notification_rules + if links is not None: + self.links = links @property - def upper(self): - """Gets the upper of this DashboardQueryRange. # noqa: E501 + def notification_rules(self): + """Gets the notification_rules of this NotificationRules. # noqa: E501 - Upper bound of the display range of the Y-axis # noqa: E501 - :return: The upper of this DashboardQueryRange. # noqa: E501 - :rtype: int + :return: The notification_rules of this NotificationRules. # noqa: E501 + :rtype: list[NotificationRule] """ - return self._upper + return self._notification_rules - @upper.setter - def upper(self, upper): - """Sets the upper of this DashboardQueryRange. + @notification_rules.setter + def notification_rules(self, notification_rules): + """Sets the notification_rules of this NotificationRules. - Upper bound of the display range of the Y-axis # noqa: E501 - :param upper: The upper of this DashboardQueryRange. # noqa: E501 - :type: int + :param notification_rules: The notification_rules of this NotificationRules. # noqa: E501 + :type: list[NotificationRule] """ - if upper is None: - raise ValueError("Invalid value for `upper`, must not be `None`") # noqa: E501 - self._upper = upper + self._notification_rules = notification_rules @property - def lower(self): - """Gets the lower of this DashboardQueryRange. # noqa: E501 + def links(self): + """Gets the links of this NotificationRules. # noqa: E501 - Lower bound of the display range of the Y-axis # noqa: E501 - :return: The lower of this DashboardQueryRange. # noqa: E501 - :rtype: int + :return: The links of this NotificationRules. # noqa: E501 + :rtype: Links """ - return self._lower + return self._links - @lower.setter - def lower(self, lower): - """Sets the lower of this DashboardQueryRange. + @links.setter + def links(self, links): + """Sets the links of this NotificationRules. - Lower bound of the display range of the Y-axis # noqa: E501 - :param lower: The lower of this DashboardQueryRange. # noqa: E501 - :type: int + :param links: The links of this NotificationRules. # noqa: E501 + :type: Links """ - if lower is None: - raise ValueError("Invalid value for `lower`, must not be `None`") # noqa: E501 - self._lower = lower + self._links = links def to_dict(self): """Returns the model properties as a dict""" @@ -134,7 +128,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, DashboardQueryRange): + if not isinstance(other, NotificationRules): return False return self.__dict__ == other.__dict__ diff --git a/influxdb2/models/object_expression.py b/influxdb2/domain/object_expression.py similarity index 100% rename from influxdb2/models/object_expression.py rename to influxdb2/domain/object_expression.py diff --git a/influxdb2/models/onboarding_request.py b/influxdb2/domain/onboarding_request.py similarity index 100% rename from influxdb2/models/onboarding_request.py rename to influxdb2/domain/onboarding_request.py diff --git a/influxdb2/models/onboarding_response.py b/influxdb2/domain/onboarding_response.py similarity index 100% rename from influxdb2/models/onboarding_response.py rename to influxdb2/domain/onboarding_response.py diff --git a/influxdb2/models/operation_log.py b/influxdb2/domain/operation_log.py similarity index 100% rename from influxdb2/models/operation_log.py rename to influxdb2/domain/operation_log.py diff --git a/influxdb2/models/operation_log_links.py b/influxdb2/domain/operation_log_links.py similarity index 100% rename from influxdb2/models/operation_log_links.py rename to influxdb2/domain/operation_log_links.py diff --git a/influxdb2/models/operation_logs.py b/influxdb2/domain/operation_logs.py similarity index 100% rename from influxdb2/models/operation_logs.py rename to influxdb2/domain/operation_logs.py diff --git a/influxdb2/models/option_statement.py b/influxdb2/domain/option_statement.py similarity index 100% rename from influxdb2/models/option_statement.py rename to influxdb2/domain/option_statement.py diff --git a/influxdb2/models/organization.py b/influxdb2/domain/organization.py similarity index 100% rename from influxdb2/models/organization.py rename to influxdb2/domain/organization.py diff --git a/influxdb2/models/organization_links.py b/influxdb2/domain/organization_links.py similarity index 100% rename from influxdb2/models/organization_links.py rename to influxdb2/domain/organization_links.py diff --git a/influxdb2/models/organizations.py b/influxdb2/domain/organizations.py similarity index 100% rename from influxdb2/models/organizations.py rename to influxdb2/domain/organizations.py diff --git a/influxdb2/models/package.py b/influxdb2/domain/package.py similarity index 100% rename from influxdb2/models/package.py rename to influxdb2/domain/package.py diff --git a/influxdb2/models/package_clause.py b/influxdb2/domain/package_clause.py similarity index 100% rename from influxdb2/models/package_clause.py rename to influxdb2/domain/package_clause.py diff --git a/influxdb2/domain/pager_duty_notification_endpoint.py b/influxdb2/domain/pager_duty_notification_endpoint.py new file mode 100644 index 00000000..240fb8c2 --- /dev/null +++ b/influxdb2/domain/pager_duty_notification_endpoint.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class PagerDutyNotificationEndpoint(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'name': 'str' + } + + attribute_map = { + 'name': 'name' + } + + def __init__(self, name=None): # noqa: E501 + """PagerDutyNotificationEndpoint - a model defined in OpenAPI""" # noqa: E501 + + self._name = None + self.discriminator = None + + if name is not None: + self.name = name + + @property + def name(self): + """Gets the name of this PagerDutyNotificationEndpoint. # noqa: E501 + + + :return: The name of this PagerDutyNotificationEndpoint. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this PagerDutyNotificationEndpoint. + + + :param name: The name of this PagerDutyNotificationEndpoint. # noqa: E501 + :type: str + """ + allowed_values = ["pagerduty"] # noqa: E501 + if name not in allowed_values: + raise ValueError( + "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 + .format(name, allowed_values) + ) + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PagerDutyNotificationEndpoint): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/models/log_viewer_column_settings.py b/influxdb2/domain/pager_duty_notification_rule.py similarity index 60% rename from influxdb2/models/log_viewer_column_settings.py rename to influxdb2/domain/pager_duty_notification_rule.py index eaf2cd83..1fb2b02a 100644 --- a/influxdb2/models/log_viewer_column_settings.py +++ b/influxdb2/domain/pager_duty_notification_rule.py @@ -16,7 +16,7 @@ import six -class LogViewerColumnSettings(object): +class PagerDutyNotificationRule(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -32,95 +32,75 @@ class LogViewerColumnSettings(object): """ openapi_types = { 'type': 'str', - 'value': 'str', - 'name': 'str' + 'message_template': 'str' } attribute_map = { 'type': 'type', - 'value': 'value', - 'name': 'name' + 'message_template': 'messageTemplate' } - def __init__(self, type=None, value=None, name=None): # noqa: E501 - """LogViewerColumnSettings - a model defined in OpenAPI""" # noqa: E501 + def __init__(self, type=None, message_template=None): # noqa: E501 + """PagerDutyNotificationRule - a model defined in OpenAPI""" # noqa: E501 self._type = None - self._value = None - self._name = None + self._message_template = None self.discriminator = None self.type = type - self.value = value - if name is not None: - self.name = name + self.message_template = message_template @property def type(self): - """Gets the type of this LogViewerColumnSettings. # noqa: E501 + """Gets the type of this PagerDutyNotificationRule. # noqa: E501 - :return: The type of this LogViewerColumnSettings. # noqa: E501 + :return: The type of this PagerDutyNotificationRule. # noqa: E501 :rtype: str """ return self._type @type.setter def type(self, type): - """Sets the type of this LogViewerColumnSettings. + """Sets the type of this PagerDutyNotificationRule. - :param type: The type of this LogViewerColumnSettings. # noqa: E501 + :param type: The type of this PagerDutyNotificationRule. # noqa: E501 :type: str """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["pagerduty"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) self._type = type @property - def value(self): - """Gets the value of this LogViewerColumnSettings. # noqa: E501 + def message_template(self): + """Gets the message_template of this PagerDutyNotificationRule. # noqa: E501 - :return: The value of this LogViewerColumnSettings. # noqa: E501 + :return: The message_template of this PagerDutyNotificationRule. # noqa: E501 :rtype: str """ - return self._value + return self._message_template - @value.setter - def value(self, value): - """Sets the value of this LogViewerColumnSettings. + @message_template.setter + def message_template(self, message_template): + """Sets the message_template of this PagerDutyNotificationRule. - :param value: The value of this LogViewerColumnSettings. # noqa: E501 + :param message_template: The message_template of this PagerDutyNotificationRule. # noqa: E501 :type: str """ - if value is None: - raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 + if message_template is None: + raise ValueError("Invalid value for `message_template`, must not be `None`") # noqa: E501 - self._value = value - - @property - def name(self): - """Gets the name of this LogViewerColumnSettings. # noqa: E501 - - - :return: The name of this LogViewerColumnSettings. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this LogViewerColumnSettings. - - - :param name: The name of this LogViewerColumnSettings. # noqa: E501 - :type: str - """ - - self._name = name + self._message_template = message_template def to_dict(self): """Returns the model properties as a dict""" @@ -156,7 +136,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, LogViewerColumnSettings): + if not isinstance(other, PagerDutyNotificationRule): return False return self.__dict__ == other.__dict__ diff --git a/influxdb2/models/password_reset_body.py b/influxdb2/domain/password_reset_body.py similarity index 100% rename from influxdb2/models/password_reset_body.py rename to influxdb2/domain/password_reset_body.py diff --git a/influxdb2/models/permission.py b/influxdb2/domain/permission.py similarity index 100% rename from influxdb2/models/permission.py rename to influxdb2/domain/permission.py diff --git a/influxdb2/models/permission_resource.py b/influxdb2/domain/permission_resource.py similarity index 98% rename from influxdb2/models/permission_resource.py rename to influxdb2/domain/permission_resource.py index 901a35fa..b2327d57 100644 --- a/influxdb2/models/permission_resource.py +++ b/influxdb2/domain/permission_resource.py @@ -82,7 +82,7 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["authorizations", "buckets", "dashboards", "orgs", "sources", "tasks", "telegrafs", "users", "variables", "scrapers", "secrets", "labels", "views", "documents"] # noqa: E501 + allowed_values = ["authorizations", "buckets", "dashboards", "orgs", "sources", "tasks", "telegrafs", "users", "variables", "scrapers", "secrets", "labels", "views", "documents", "notificationRules", "notificationEndpoints", "checks"] # noqa: E501 if type not in allowed_values: raise ValueError( "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 diff --git a/influxdb2/models/pipe_expression.py b/influxdb2/domain/pipe_expression.py similarity index 100% rename from influxdb2/models/pipe_expression.py rename to influxdb2/domain/pipe_expression.py diff --git a/influxdb2/models/pipe_literal.py b/influxdb2/domain/pipe_literal.py similarity index 100% rename from influxdb2/models/pipe_literal.py rename to influxdb2/domain/pipe_literal.py diff --git a/influxdb2/models/property_key.py b/influxdb2/domain/property_key.py similarity index 100% rename from influxdb2/models/property_key.py rename to influxdb2/domain/property_key.py diff --git a/influxdb2/models/query.py b/influxdb2/domain/query.py similarity index 100% rename from influxdb2/models/query.py rename to influxdb2/domain/query.py diff --git a/influxdb2/domain/query_edit_mode.py b/influxdb2/domain/query_edit_mode.py new file mode 100644 index 00000000..8d98db51 --- /dev/null +++ b/influxdb2/domain/query_edit_mode.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class QueryEditMode(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + BUILDER = "builder" + ADVANCED = "advanced" + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """QueryEditMode - a model defined in OpenAPI""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, QueryEditMode): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/models/query_variable_properties.py b/influxdb2/domain/query_variable_properties.py similarity index 100% rename from influxdb2/models/query_variable_properties.py rename to influxdb2/domain/query_variable_properties.py diff --git a/influxdb2/models/query_variable_properties_values.py b/influxdb2/domain/query_variable_properties_values.py similarity index 100% rename from influxdb2/models/query_variable_properties_values.py rename to influxdb2/domain/query_variable_properties_values.py diff --git a/influxdb2/models/ready.py b/influxdb2/domain/ready.py similarity index 100% rename from influxdb2/models/ready.py rename to influxdb2/domain/ready.py diff --git a/influxdb2/models/regexp_literal.py b/influxdb2/domain/regexp_literal.py similarity index 100% rename from influxdb2/models/regexp_literal.py rename to influxdb2/domain/regexp_literal.py diff --git a/influxdb2/models/renamable_field.py b/influxdb2/domain/renamable_field.py similarity index 100% rename from influxdb2/models/renamable_field.py rename to influxdb2/domain/renamable_field.py diff --git a/influxdb2/models/resource_member.py b/influxdb2/domain/resource_member.py similarity index 100% rename from influxdb2/models/resource_member.py rename to influxdb2/domain/resource_member.py diff --git a/influxdb2/models/resource_members.py b/influxdb2/domain/resource_members.py similarity index 100% rename from influxdb2/models/resource_members.py rename to influxdb2/domain/resource_members.py diff --git a/influxdb2/models/resource_owner.py b/influxdb2/domain/resource_owner.py similarity index 100% rename from influxdb2/models/resource_owner.py rename to influxdb2/domain/resource_owner.py diff --git a/influxdb2/models/resource_owners.py b/influxdb2/domain/resource_owners.py similarity index 100% rename from influxdb2/models/resource_owners.py rename to influxdb2/domain/resource_owners.py diff --git a/influxdb2/models/return_statement.py b/influxdb2/domain/return_statement.py similarity index 100% rename from influxdb2/models/return_statement.py rename to influxdb2/domain/return_statement.py diff --git a/influxdb2/models/routes.py b/influxdb2/domain/routes.py similarity index 100% rename from influxdb2/models/routes.py rename to influxdb2/domain/routes.py diff --git a/influxdb2/models/routes_external.py b/influxdb2/domain/routes_external.py similarity index 100% rename from influxdb2/models/routes_external.py rename to influxdb2/domain/routes_external.py diff --git a/influxdb2/models/routes_query.py b/influxdb2/domain/routes_query.py similarity index 100% rename from influxdb2/models/routes_query.py rename to influxdb2/domain/routes_query.py diff --git a/influxdb2/models/routes_system.py b/influxdb2/domain/routes_system.py similarity index 100% rename from influxdb2/models/routes_system.py rename to influxdb2/domain/routes_system.py diff --git a/influxdb2/models/run.py b/influxdb2/domain/run.py similarity index 100% rename from influxdb2/models/run.py rename to influxdb2/domain/run.py diff --git a/influxdb2/models/run_links.py b/influxdb2/domain/run_links.py similarity index 100% rename from influxdb2/models/run_links.py rename to influxdb2/domain/run_links.py diff --git a/influxdb2/models/run_log.py b/influxdb2/domain/run_log.py similarity index 100% rename from influxdb2/models/run_log.py rename to influxdb2/domain/run_log.py diff --git a/influxdb2/models/run_manually.py b/influxdb2/domain/run_manually.py similarity index 100% rename from influxdb2/models/run_manually.py rename to influxdb2/domain/run_manually.py diff --git a/influxdb2/models/runs.py b/influxdb2/domain/runs.py similarity index 100% rename from influxdb2/models/runs.py rename to influxdb2/domain/runs.py diff --git a/influxdb2/domain/scatter_view_properties.py b/influxdb2/domain/scatter_view_properties.py new file mode 100644 index 00000000..d9d83b70 --- /dev/null +++ b/influxdb2/domain/scatter_view_properties.py @@ -0,0 +1,588 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ScatterViewProperties(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'type': 'str', + 'queries': 'list[DashboardQuery]', + 'colors': 'list[str]', + 'shape': 'str', + 'note': 'str', + 'show_note_when_empty': 'bool', + 'x_column': 'str', + 'y_column': 'str', + 'fill_columns': 'list[str]', + 'symbol_columns': 'list[str]', + 'x_domain': 'list[float]', + 'y_domain': 'list[float]', + 'x_axis_label': 'str', + 'y_axis_label': 'str', + 'x_prefix': 'str', + 'x_suffix': 'str', + 'y_prefix': 'str', + 'y_suffix': 'str' + } + + attribute_map = { + 'type': 'type', + 'queries': 'queries', + 'colors': 'colors', + 'shape': 'shape', + 'note': 'note', + 'show_note_when_empty': 'showNoteWhenEmpty', + 'x_column': 'xColumn', + 'y_column': 'yColumn', + 'fill_columns': 'fillColumns', + 'symbol_columns': 'symbolColumns', + 'x_domain': 'xDomain', + 'y_domain': 'yDomain', + 'x_axis_label': 'xAxisLabel', + 'y_axis_label': 'yAxisLabel', + 'x_prefix': 'xPrefix', + 'x_suffix': 'xSuffix', + 'y_prefix': 'yPrefix', + 'y_suffix': 'ySuffix' + } + + def __init__(self, type=None, queries=None, colors=None, shape=None, note=None, show_note_when_empty=None, x_column=None, y_column=None, fill_columns=None, symbol_columns=None, x_domain=None, y_domain=None, x_axis_label=None, y_axis_label=None, x_prefix=None, x_suffix=None, y_prefix=None, y_suffix=None): # noqa: E501 + """ScatterViewProperties - a model defined in OpenAPI""" # noqa: E501 + + self._type = None + self._queries = None + self._colors = None + self._shape = None + self._note = None + self._show_note_when_empty = None + self._x_column = None + self._y_column = None + self._fill_columns = None + self._symbol_columns = None + self._x_domain = None + self._y_domain = None + self._x_axis_label = None + self._y_axis_label = None + self._x_prefix = None + self._x_suffix = None + self._y_prefix = None + self._y_suffix = None + self.discriminator = None + + self.type = type + self.queries = queries + self.colors = colors + self.shape = shape + self.note = note + self.show_note_when_empty = show_note_when_empty + self.x_column = x_column + self.y_column = y_column + self.fill_columns = fill_columns + self.symbol_columns = symbol_columns + self.x_domain = x_domain + self.y_domain = y_domain + self.x_axis_label = x_axis_label + self.y_axis_label = y_axis_label + self.x_prefix = x_prefix + self.x_suffix = x_suffix + self.y_prefix = y_prefix + self.y_suffix = y_suffix + + @property + def type(self): + """Gets the type of this ScatterViewProperties. # noqa: E501 + + + :return: The type of this ScatterViewProperties. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this ScatterViewProperties. + + + :param type: The type of this ScatterViewProperties. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["scatter"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def queries(self): + """Gets the queries of this ScatterViewProperties. # noqa: E501 + + + :return: The queries of this ScatterViewProperties. # noqa: E501 + :rtype: list[DashboardQuery] + """ + return self._queries + + @queries.setter + def queries(self, queries): + """Sets the queries of this ScatterViewProperties. + + + :param queries: The queries of this ScatterViewProperties. # noqa: E501 + :type: list[DashboardQuery] + """ + if queries is None: + raise ValueError("Invalid value for `queries`, must not be `None`") # noqa: E501 + + self._queries = queries + + @property + def colors(self): + """Gets the colors of this ScatterViewProperties. # noqa: E501 + + Colors define color encoding of data into a visualization # noqa: E501 + + :return: The colors of this ScatterViewProperties. # noqa: E501 + :rtype: list[str] + """ + return self._colors + + @colors.setter + def colors(self, colors): + """Sets the colors of this ScatterViewProperties. + + Colors define color encoding of data into a visualization # noqa: E501 + + :param colors: The colors of this ScatterViewProperties. # noqa: E501 + :type: list[str] + """ + if colors is None: + raise ValueError("Invalid value for `colors`, must not be `None`") # noqa: E501 + + self._colors = colors + + @property + def shape(self): + """Gets the shape of this ScatterViewProperties. # noqa: E501 + + + :return: The shape of this ScatterViewProperties. # noqa: E501 + :rtype: str + """ + return self._shape + + @shape.setter + def shape(self, shape): + """Sets the shape of this ScatterViewProperties. + + + :param shape: The shape of this ScatterViewProperties. # noqa: E501 + :type: str + """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 + allowed_values = ["chronograf-v2"] # noqa: E501 + if shape not in allowed_values: + raise ValueError( + "Invalid value for `shape` ({0}), must be one of {1}" # noqa: E501 + .format(shape, allowed_values) + ) + + self._shape = shape + + @property + def note(self): + """Gets the note of this ScatterViewProperties. # noqa: E501 + + + :return: The note of this ScatterViewProperties. # noqa: E501 + :rtype: str + """ + return self._note + + @note.setter + def note(self, note): + """Sets the note of this ScatterViewProperties. + + + :param note: The note of this ScatterViewProperties. # noqa: E501 + :type: str + """ + if note is None: + raise ValueError("Invalid value for `note`, must not be `None`") # noqa: E501 + + self._note = note + + @property + def show_note_when_empty(self): + """Gets the show_note_when_empty of this ScatterViewProperties. # noqa: E501 + + if true, will display note when empty # noqa: E501 + + :return: The show_note_when_empty of this ScatterViewProperties. # noqa: E501 + :rtype: bool + """ + return self._show_note_when_empty + + @show_note_when_empty.setter + def show_note_when_empty(self, show_note_when_empty): + """Sets the show_note_when_empty of this ScatterViewProperties. + + if true, will display note when empty # noqa: E501 + + :param show_note_when_empty: The show_note_when_empty of this ScatterViewProperties. # noqa: E501 + :type: bool + """ + if show_note_when_empty is None: + raise ValueError("Invalid value for `show_note_when_empty`, must not be `None`") # noqa: E501 + + self._show_note_when_empty = show_note_when_empty + + @property + def x_column(self): + """Gets the x_column of this ScatterViewProperties. # noqa: E501 + + + :return: The x_column of this ScatterViewProperties. # noqa: E501 + :rtype: str + """ + return self._x_column + + @x_column.setter + def x_column(self, x_column): + """Sets the x_column of this ScatterViewProperties. + + + :param x_column: The x_column of this ScatterViewProperties. # noqa: E501 + :type: str + """ + if x_column is None: + raise ValueError("Invalid value for `x_column`, must not be `None`") # noqa: E501 + + self._x_column = x_column + + @property + def y_column(self): + """Gets the y_column of this ScatterViewProperties. # noqa: E501 + + + :return: The y_column of this ScatterViewProperties. # noqa: E501 + :rtype: str + """ + return self._y_column + + @y_column.setter + def y_column(self, y_column): + """Sets the y_column of this ScatterViewProperties. + + + :param y_column: The y_column of this ScatterViewProperties. # noqa: E501 + :type: str + """ + if y_column is None: + raise ValueError("Invalid value for `y_column`, must not be `None`") # noqa: E501 + + self._y_column = y_column + + @property + def fill_columns(self): + """Gets the fill_columns of this ScatterViewProperties. # noqa: E501 + + + :return: The fill_columns of this ScatterViewProperties. # noqa: E501 + :rtype: list[str] + """ + return self._fill_columns + + @fill_columns.setter + def fill_columns(self, fill_columns): + """Sets the fill_columns of this ScatterViewProperties. + + + :param fill_columns: The fill_columns of this ScatterViewProperties. # noqa: E501 + :type: list[str] + """ + if fill_columns is None: + raise ValueError("Invalid value for `fill_columns`, must not be `None`") # noqa: E501 + + self._fill_columns = fill_columns + + @property + def symbol_columns(self): + """Gets the symbol_columns of this ScatterViewProperties. # noqa: E501 + + + :return: The symbol_columns of this ScatterViewProperties. # noqa: E501 + :rtype: list[str] + """ + return self._symbol_columns + + @symbol_columns.setter + def symbol_columns(self, symbol_columns): + """Sets the symbol_columns of this ScatterViewProperties. + + + :param symbol_columns: The symbol_columns of this ScatterViewProperties. # noqa: E501 + :type: list[str] + """ + if symbol_columns is None: + raise ValueError("Invalid value for `symbol_columns`, must not be `None`") # noqa: E501 + + self._symbol_columns = symbol_columns + + @property + def x_domain(self): + """Gets the x_domain of this ScatterViewProperties. # noqa: E501 + + + :return: The x_domain of this ScatterViewProperties. # noqa: E501 + :rtype: list[float] + """ + return self._x_domain + + @x_domain.setter + def x_domain(self, x_domain): + """Sets the x_domain of this ScatterViewProperties. + + + :param x_domain: The x_domain of this ScatterViewProperties. # noqa: E501 + :type: list[float] + """ + if x_domain is None: + raise ValueError("Invalid value for `x_domain`, must not be `None`") # noqa: E501 + + self._x_domain = x_domain + + @property + def y_domain(self): + """Gets the y_domain of this ScatterViewProperties. # noqa: E501 + + + :return: The y_domain of this ScatterViewProperties. # noqa: E501 + :rtype: list[float] + """ + return self._y_domain + + @y_domain.setter + def y_domain(self, y_domain): + """Sets the y_domain of this ScatterViewProperties. + + + :param y_domain: The y_domain of this ScatterViewProperties. # noqa: E501 + :type: list[float] + """ + if y_domain is None: + raise ValueError("Invalid value for `y_domain`, must not be `None`") # noqa: E501 + + self._y_domain = y_domain + + @property + def x_axis_label(self): + """Gets the x_axis_label of this ScatterViewProperties. # noqa: E501 + + + :return: The x_axis_label of this ScatterViewProperties. # noqa: E501 + :rtype: str + """ + return self._x_axis_label + + @x_axis_label.setter + def x_axis_label(self, x_axis_label): + """Sets the x_axis_label of this ScatterViewProperties. + + + :param x_axis_label: The x_axis_label of this ScatterViewProperties. # noqa: E501 + :type: str + """ + if x_axis_label is None: + raise ValueError("Invalid value for `x_axis_label`, must not be `None`") # noqa: E501 + + self._x_axis_label = x_axis_label + + @property + def y_axis_label(self): + """Gets the y_axis_label of this ScatterViewProperties. # noqa: E501 + + + :return: The y_axis_label of this ScatterViewProperties. # noqa: E501 + :rtype: str + """ + return self._y_axis_label + + @y_axis_label.setter + def y_axis_label(self, y_axis_label): + """Sets the y_axis_label of this ScatterViewProperties. + + + :param y_axis_label: The y_axis_label of this ScatterViewProperties. # noqa: E501 + :type: str + """ + if y_axis_label is None: + raise ValueError("Invalid value for `y_axis_label`, must not be `None`") # noqa: E501 + + self._y_axis_label = y_axis_label + + @property + def x_prefix(self): + """Gets the x_prefix of this ScatterViewProperties. # noqa: E501 + + + :return: The x_prefix of this ScatterViewProperties. # noqa: E501 + :rtype: str + """ + return self._x_prefix + + @x_prefix.setter + def x_prefix(self, x_prefix): + """Sets the x_prefix of this ScatterViewProperties. + + + :param x_prefix: The x_prefix of this ScatterViewProperties. # noqa: E501 + :type: str + """ + if x_prefix is None: + raise ValueError("Invalid value for `x_prefix`, must not be `None`") # noqa: E501 + + self._x_prefix = x_prefix + + @property + def x_suffix(self): + """Gets the x_suffix of this ScatterViewProperties. # noqa: E501 + + + :return: The x_suffix of this ScatterViewProperties. # noqa: E501 + :rtype: str + """ + return self._x_suffix + + @x_suffix.setter + def x_suffix(self, x_suffix): + """Sets the x_suffix of this ScatterViewProperties. + + + :param x_suffix: The x_suffix of this ScatterViewProperties. # noqa: E501 + :type: str + """ + if x_suffix is None: + raise ValueError("Invalid value for `x_suffix`, must not be `None`") # noqa: E501 + + self._x_suffix = x_suffix + + @property + def y_prefix(self): + """Gets the y_prefix of this ScatterViewProperties. # noqa: E501 + + + :return: The y_prefix of this ScatterViewProperties. # noqa: E501 + :rtype: str + """ + return self._y_prefix + + @y_prefix.setter + def y_prefix(self, y_prefix): + """Sets the y_prefix of this ScatterViewProperties. + + + :param y_prefix: The y_prefix of this ScatterViewProperties. # noqa: E501 + :type: str + """ + if y_prefix is None: + raise ValueError("Invalid value for `y_prefix`, must not be `None`") # noqa: E501 + + self._y_prefix = y_prefix + + @property + def y_suffix(self): + """Gets the y_suffix of this ScatterViewProperties. # noqa: E501 + + + :return: The y_suffix of this ScatterViewProperties. # noqa: E501 + :rtype: str + """ + return self._y_suffix + + @y_suffix.setter + def y_suffix(self, y_suffix): + """Sets the y_suffix of this ScatterViewProperties. + + + :param y_suffix: The y_suffix of this ScatterViewProperties. # noqa: E501 + :type: str + """ + if y_suffix is None: + raise ValueError("Invalid value for `y_suffix`, must not be `None`") # noqa: E501 + + self._y_suffix = y_suffix + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ScatterViewProperties): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/models/scraper_target_request.py b/influxdb2/domain/scraper_target_request.py similarity index 100% rename from influxdb2/models/scraper_target_request.py rename to influxdb2/domain/scraper_target_request.py diff --git a/influxdb2/models/scraper_target_response.py b/influxdb2/domain/scraper_target_response.py similarity index 100% rename from influxdb2/models/scraper_target_response.py rename to influxdb2/domain/scraper_target_response.py diff --git a/influxdb2/models/scraper_target_responses.py b/influxdb2/domain/scraper_target_responses.py similarity index 100% rename from influxdb2/models/scraper_target_responses.py rename to influxdb2/domain/scraper_target_responses.py diff --git a/influxdb2/models/secret_keys.py b/influxdb2/domain/secret_keys.py similarity index 100% rename from influxdb2/models/secret_keys.py rename to influxdb2/domain/secret_keys.py diff --git a/influxdb2/models/secret_keys_response.py b/influxdb2/domain/secret_keys_response.py similarity index 100% rename from influxdb2/models/secret_keys_response.py rename to influxdb2/domain/secret_keys_response.py diff --git a/influxdb2/models/single_stat_view_properties.py b/influxdb2/domain/single_stat_view_properties.py similarity index 58% rename from influxdb2/models/single_stat_view_properties.py rename to influxdb2/domain/single_stat_view_properties.py index 0d500fdd..b8afa468 100644 --- a/influxdb2/models/single_stat_view_properties.py +++ b/influxdb2/domain/single_stat_view_properties.py @@ -31,8 +31,12 @@ class SingleStatViewProperties(object): and the value is json key in definition. """ openapi_types = { - 'shape': 'str', 'type': 'str', + 'queries': 'list[DashboardQuery]', + 'colors': 'list[DashboardColor]', + 'shape': 'str', + 'note': 'str', + 'show_note_when_empty': 'bool', 'prefix': 'str', 'suffix': 'str', 'legend': 'Legend', @@ -40,37 +44,120 @@ class SingleStatViewProperties(object): } attribute_map = { - 'shape': 'shape', 'type': 'type', + 'queries': 'queries', + 'colors': 'colors', + 'shape': 'shape', + 'note': 'note', + 'show_note_when_empty': 'showNoteWhenEmpty', 'prefix': 'prefix', 'suffix': 'suffix', 'legend': 'legend', 'decimal_places': 'decimalPlaces' } - def __init__(self, shape=None, type=None, prefix=None, suffix=None, legend=None, decimal_places=None): # noqa: E501 + def __init__(self, type=None, queries=None, colors=None, shape=None, note=None, show_note_when_empty=None, prefix=None, suffix=None, legend=None, decimal_places=None): # noqa: E501 """SingleStatViewProperties - a model defined in OpenAPI""" # noqa: E501 - self._shape = None self._type = None + self._queries = None + self._colors = None + self._shape = None + self._note = None + self._show_note_when_empty = None self._prefix = None self._suffix = None self._legend = None self._decimal_places = None self.discriminator = None - if shape is not None: - self.shape = shape - if type is not None: - self.type = type - if prefix is not None: - self.prefix = prefix - if suffix is not None: - self.suffix = suffix - if legend is not None: - self.legend = legend - if decimal_places is not None: - self.decimal_places = decimal_places + self.type = type + self.queries = queries + self.colors = colors + self.shape = shape + self.note = note + self.show_note_when_empty = show_note_when_empty + self.prefix = prefix + self.suffix = suffix + self.legend = legend + self.decimal_places = decimal_places + + @property + def type(self): + """Gets the type of this SingleStatViewProperties. # noqa: E501 + + + :return: The type of this SingleStatViewProperties. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this SingleStatViewProperties. + + + :param type: The type of this SingleStatViewProperties. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["single-stat"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def queries(self): + """Gets the queries of this SingleStatViewProperties. # noqa: E501 + + + :return: The queries of this SingleStatViewProperties. # noqa: E501 + :rtype: list[DashboardQuery] + """ + return self._queries + + @queries.setter + def queries(self, queries): + """Sets the queries of this SingleStatViewProperties. + + + :param queries: The queries of this SingleStatViewProperties. # noqa: E501 + :type: list[DashboardQuery] + """ + if queries is None: + raise ValueError("Invalid value for `queries`, must not be `None`") # noqa: E501 + + self._queries = queries + + @property + def colors(self): + """Gets the colors of this SingleStatViewProperties. # noqa: E501 + + Colors define color encoding of data into a visualization # noqa: E501 + + :return: The colors of this SingleStatViewProperties. # noqa: E501 + :rtype: list[DashboardColor] + """ + return self._colors + + @colors.setter + def colors(self, colors): + """Sets the colors of this SingleStatViewProperties. + + Colors define color encoding of data into a visualization # noqa: E501 + + :param colors: The colors of this SingleStatViewProperties. # noqa: E501 + :type: list[DashboardColor] + """ + if colors is None: + raise ValueError("Invalid value for `colors`, must not be `None`") # noqa: E501 + + self._colors = colors @property def shape(self): @@ -90,6 +177,8 @@ def shape(self, shape): :param shape: The shape of this SingleStatViewProperties. # noqa: E501 :type: str """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 allowed_values = ["chronograf-v2"] # noqa: E501 if shape not in allowed_values: raise ValueError( @@ -100,31 +189,52 @@ def shape(self, shape): self._shape = shape @property - def type(self): - """Gets the type of this SingleStatViewProperties. # noqa: E501 + def note(self): + """Gets the note of this SingleStatViewProperties. # noqa: E501 - :return: The type of this SingleStatViewProperties. # noqa: E501 + :return: The note of this SingleStatViewProperties. # noqa: E501 :rtype: str """ - return self._type + return self._note - @type.setter - def type(self, type): - """Sets the type of this SingleStatViewProperties. + @note.setter + def note(self, note): + """Sets the note of this SingleStatViewProperties. - :param type: The type of this SingleStatViewProperties. # noqa: E501 + :param note: The note of this SingleStatViewProperties. # noqa: E501 :type: str """ - allowed_values = ["single-stat"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) + if note is None: + raise ValueError("Invalid value for `note`, must not be `None`") # noqa: E501 - self._type = type + self._note = note + + @property + def show_note_when_empty(self): + """Gets the show_note_when_empty of this SingleStatViewProperties. # noqa: E501 + + if true, will display note when empty # noqa: E501 + + :return: The show_note_when_empty of this SingleStatViewProperties. # noqa: E501 + :rtype: bool + """ + return self._show_note_when_empty + + @show_note_when_empty.setter + def show_note_when_empty(self, show_note_when_empty): + """Sets the show_note_when_empty of this SingleStatViewProperties. + + if true, will display note when empty # noqa: E501 + + :param show_note_when_empty: The show_note_when_empty of this SingleStatViewProperties. # noqa: E501 + :type: bool + """ + if show_note_when_empty is None: + raise ValueError("Invalid value for `show_note_when_empty`, must not be `None`") # noqa: E501 + + self._show_note_when_empty = show_note_when_empty @property def prefix(self): @@ -144,6 +254,8 @@ def prefix(self, prefix): :param prefix: The prefix of this SingleStatViewProperties. # noqa: E501 :type: str """ + if prefix is None: + raise ValueError("Invalid value for `prefix`, must not be `None`") # noqa: E501 self._prefix = prefix @@ -165,6 +277,8 @@ def suffix(self, suffix): :param suffix: The suffix of this SingleStatViewProperties. # noqa: E501 :type: str """ + if suffix is None: + raise ValueError("Invalid value for `suffix`, must not be `None`") # noqa: E501 self._suffix = suffix @@ -186,6 +300,8 @@ def legend(self, legend): :param legend: The legend of this SingleStatViewProperties. # noqa: E501 :type: Legend """ + if legend is None: + raise ValueError("Invalid value for `legend`, must not be `None`") # noqa: E501 self._legend = legend @@ -207,6 +323,8 @@ def decimal_places(self, decimal_places): :param decimal_places: The decimal_places of this SingleStatViewProperties. # noqa: E501 :type: DecimalPlaces """ + if decimal_places is None: + raise ValueError("Invalid value for `decimal_places`, must not be `None`") # noqa: E501 self._decimal_places = decimal_places diff --git a/influxdb2/domain/slack_notification_endpoint.py b/influxdb2/domain/slack_notification_endpoint.py new file mode 100644 index 00000000..612118d7 --- /dev/null +++ b/influxdb2/domain/slack_notification_endpoint.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class SlackNotificationEndpoint(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'name': 'str' + } + + attribute_map = { + 'name': 'name' + } + + def __init__(self, name=None): # noqa: E501 + """SlackNotificationEndpoint - a model defined in OpenAPI""" # noqa: E501 + + self._name = None + self.discriminator = None + + if name is not None: + self.name = name + + @property + def name(self): + """Gets the name of this SlackNotificationEndpoint. # noqa: E501 + + + :return: The name of this SlackNotificationEndpoint. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SlackNotificationEndpoint. + + + :param name: The name of this SlackNotificationEndpoint. # noqa: E501 + :type: str + """ + allowed_values = ["slack"] # noqa: E501 + if name not in allowed_values: + raise ValueError( + "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 + .format(name, allowed_values) + ) + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SlackNotificationEndpoint): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/domain/slack_notification_rule.py b/influxdb2/domain/slack_notification_rule.py new file mode 100644 index 00000000..12b0fda1 --- /dev/null +++ b/influxdb2/domain/slack_notification_rule.py @@ -0,0 +1,172 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class SlackNotificationRule(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'type': 'str', + 'channel': 'str', + 'message_template': 'str' + } + + attribute_map = { + 'type': 'type', + 'channel': 'channel', + 'message_template': 'messageTemplate' + } + + def __init__(self, type=None, channel=None, message_template=None): # noqa: E501 + """SlackNotificationRule - a model defined in OpenAPI""" # noqa: E501 + + self._type = None + self._channel = None + self._message_template = None + self.discriminator = None + + self.type = type + if channel is not None: + self.channel = channel + self.message_template = message_template + + @property + def type(self): + """Gets the type of this SlackNotificationRule. # noqa: E501 + + + :return: The type of this SlackNotificationRule. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this SlackNotificationRule. + + + :param type: The type of this SlackNotificationRule. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["slack"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def channel(self): + """Gets the channel of this SlackNotificationRule. # noqa: E501 + + + :return: The channel of this SlackNotificationRule. # noqa: E501 + :rtype: str + """ + return self._channel + + @channel.setter + def channel(self, channel): + """Sets the channel of this SlackNotificationRule. + + + :param channel: The channel of this SlackNotificationRule. # noqa: E501 + :type: str + """ + + self._channel = channel + + @property + def message_template(self): + """Gets the message_template of this SlackNotificationRule. # noqa: E501 + + + :return: The message_template of this SlackNotificationRule. # noqa: E501 + :rtype: str + """ + return self._message_template + + @message_template.setter + def message_template(self, message_template): + """Sets the message_template of this SlackNotificationRule. + + + :param message_template: The message_template of this SlackNotificationRule. # noqa: E501 + :type: str + """ + if message_template is None: + raise ValueError("Invalid value for `message_template`, must not be `None`") # noqa: E501 + + self._message_template = message_template + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SlackNotificationRule): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/domain/smtp_notification_endpoint.py b/influxdb2/domain/smtp_notification_endpoint.py new file mode 100644 index 00000000..7fe9fb7b --- /dev/null +++ b/influxdb2/domain/smtp_notification_endpoint.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class SMTPNotificationEndpoint(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'name': 'str' + } + + attribute_map = { + 'name': 'name' + } + + def __init__(self, name=None): # noqa: E501 + """SMTPNotificationEndpoint - a model defined in OpenAPI""" # noqa: E501 + + self._name = None + self.discriminator = None + + if name is not None: + self.name = name + + @property + def name(self): + """Gets the name of this SMTPNotificationEndpoint. # noqa: E501 + + + :return: The name of this SMTPNotificationEndpoint. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SMTPNotificationEndpoint. + + + :param name: The name of this SMTPNotificationEndpoint. # noqa: E501 + :type: str + """ + allowed_values = ["smtp"] # noqa: E501 + if name not in allowed_values: + raise ValueError( + "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 + .format(name, allowed_values) + ) + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SMTPNotificationEndpoint): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/domain/smtp_notification_rule.py b/influxdb2/domain/smtp_notification_rule.py new file mode 100644 index 00000000..f6dbb25d --- /dev/null +++ b/influxdb2/domain/smtp_notification_rule.py @@ -0,0 +1,199 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class SMTPNotificationRule(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'type': 'str', + 'subject_template': 'str', + 'body_template': 'str', + 'to': 'str' + } + + attribute_map = { + 'type': 'type', + 'subject_template': 'subjectTemplate', + 'body_template': 'bodyTemplate', + 'to': 'to' + } + + def __init__(self, type=None, subject_template=None, body_template=None, to=None): # noqa: E501 + """SMTPNotificationRule - a model defined in OpenAPI""" # noqa: E501 + + self._type = None + self._subject_template = None + self._body_template = None + self._to = None + self.discriminator = None + + self.type = type + self.subject_template = subject_template + if body_template is not None: + self.body_template = body_template + self.to = to + + @property + def type(self): + """Gets the type of this SMTPNotificationRule. # noqa: E501 + + + :return: The type of this SMTPNotificationRule. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this SMTPNotificationRule. + + + :param type: The type of this SMTPNotificationRule. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["smtp"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def subject_template(self): + """Gets the subject_template of this SMTPNotificationRule. # noqa: E501 + + + :return: The subject_template of this SMTPNotificationRule. # noqa: E501 + :rtype: str + """ + return self._subject_template + + @subject_template.setter + def subject_template(self, subject_template): + """Sets the subject_template of this SMTPNotificationRule. + + + :param subject_template: The subject_template of this SMTPNotificationRule. # noqa: E501 + :type: str + """ + if subject_template is None: + raise ValueError("Invalid value for `subject_template`, must not be `None`") # noqa: E501 + + self._subject_template = subject_template + + @property + def body_template(self): + """Gets the body_template of this SMTPNotificationRule. # noqa: E501 + + + :return: The body_template of this SMTPNotificationRule. # noqa: E501 + :rtype: str + """ + return self._body_template + + @body_template.setter + def body_template(self, body_template): + """Sets the body_template of this SMTPNotificationRule. + + + :param body_template: The body_template of this SMTPNotificationRule. # noqa: E501 + :type: str + """ + + self._body_template = body_template + + @property + def to(self): + """Gets the to of this SMTPNotificationRule. # noqa: E501 + + + :return: The to of this SMTPNotificationRule. # noqa: E501 + :rtype: str + """ + return self._to + + @to.setter + def to(self, to): + """Sets the to of this SMTPNotificationRule. + + + :param to: The to of this SMTPNotificationRule. # noqa: E501 + :type: str + """ + if to is None: + raise ValueError("Invalid value for `to`, must not be `None`") # noqa: E501 + + self._to = to + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SMTPNotificationRule): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/models/source.py b/influxdb2/domain/source.py similarity index 100% rename from influxdb2/models/source.py rename to influxdb2/domain/source.py diff --git a/influxdb2/models/source_links.py b/influxdb2/domain/source_links.py similarity index 100% rename from influxdb2/models/source_links.py rename to influxdb2/domain/source_links.py diff --git a/influxdb2/models/sources.py b/influxdb2/domain/sources.py similarity index 100% rename from influxdb2/models/sources.py rename to influxdb2/domain/sources.py diff --git a/influxdb2/models/statement.py b/influxdb2/domain/statement.py similarity index 100% rename from influxdb2/models/statement.py rename to influxdb2/domain/statement.py diff --git a/influxdb2/domain/status_rule.py b/influxdb2/domain/status_rule.py new file mode 100644 index 00000000..1f560cb9 --- /dev/null +++ b/influxdb2/domain/status_rule.py @@ -0,0 +1,190 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class StatusRule(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'current_level': 'LevelRule', + 'previous_level': 'LevelRule', + 'count': 'int', + 'period': 'str' + } + + attribute_map = { + 'current_level': 'currentLevel', + 'previous_level': 'previousLevel', + 'count': 'count', + 'period': 'period' + } + + def __init__(self, current_level=None, previous_level=None, count=None, period=None): # noqa: E501 + """StatusRule - a model defined in OpenAPI""" # noqa: E501 + + self._current_level = None + self._previous_level = None + self._count = None + self._period = None + self.discriminator = None + + if current_level is not None: + self.current_level = current_level + if previous_level is not None: + self.previous_level = previous_level + if count is not None: + self.count = count + if period is not None: + self.period = period + + @property + def current_level(self): + """Gets the current_level of this StatusRule. # noqa: E501 + + + :return: The current_level of this StatusRule. # noqa: E501 + :rtype: LevelRule + """ + return self._current_level + + @current_level.setter + def current_level(self, current_level): + """Sets the current_level of this StatusRule. + + + :param current_level: The current_level of this StatusRule. # noqa: E501 + :type: LevelRule + """ + + self._current_level = current_level + + @property + def previous_level(self): + """Gets the previous_level of this StatusRule. # noqa: E501 + + + :return: The previous_level of this StatusRule. # noqa: E501 + :rtype: LevelRule + """ + return self._previous_level + + @previous_level.setter + def previous_level(self, previous_level): + """Sets the previous_level of this StatusRule. + + + :param previous_level: The previous_level of this StatusRule. # noqa: E501 + :type: LevelRule + """ + + self._previous_level = previous_level + + @property + def count(self): + """Gets the count of this StatusRule. # noqa: E501 + + + :return: The count of this StatusRule. # noqa: E501 + :rtype: int + """ + return self._count + + @count.setter + def count(self, count): + """Sets the count of this StatusRule. + + + :param count: The count of this StatusRule. # noqa: E501 + :type: int + """ + + self._count = count + + @property + def period(self): + """Gets the period of this StatusRule. # noqa: E501 + + + :return: The period of this StatusRule. # noqa: E501 + :rtype: str + """ + return self._period + + @period.setter + def period(self, period): + """Sets the period of this StatusRule. + + + :param period: The period of this StatusRule. # noqa: E501 + :type: str + """ + + self._period = period + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StatusRule): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/models/string_literal.py b/influxdb2/domain/string_literal.py similarity index 100% rename from influxdb2/models/string_literal.py rename to influxdb2/domain/string_literal.py diff --git a/influxdb2/models/table_view_properties.py b/influxdb2/domain/table_view_properties.py similarity index 60% rename from influxdb2/models/table_view_properties.py rename to influxdb2/domain/table_view_properties.py index 0a69bd75..e2ecb3d9 100644 --- a/influxdb2/models/table_view_properties.py +++ b/influxdb2/domain/table_view_properties.py @@ -31,8 +31,12 @@ class TableViewProperties(object): and the value is json key in definition. """ openapi_types = { - 'shape': 'str', 'type': 'str', + 'queries': 'list[DashboardQuery]', + 'colors': 'list[DashboardColor]', + 'shape': 'str', + 'note': 'str', + 'show_note_when_empty': 'bool', 'table_options': 'object', 'field_options': 'list[RenamableField]', 'time_format': 'str', @@ -40,37 +44,120 @@ class TableViewProperties(object): } attribute_map = { - 'shape': 'shape', 'type': 'type', + 'queries': 'queries', + 'colors': 'colors', + 'shape': 'shape', + 'note': 'note', + 'show_note_when_empty': 'showNoteWhenEmpty', 'table_options': 'tableOptions', 'field_options': 'fieldOptions', 'time_format': 'timeFormat', 'decimal_places': 'decimalPlaces' } - def __init__(self, shape=None, type=None, table_options=None, field_options=None, time_format=None, decimal_places=None): # noqa: E501 + def __init__(self, type=None, queries=None, colors=None, shape=None, note=None, show_note_when_empty=None, table_options=None, field_options=None, time_format=None, decimal_places=None): # noqa: E501 """TableViewProperties - a model defined in OpenAPI""" # noqa: E501 - self._shape = None self._type = None + self._queries = None + self._colors = None + self._shape = None + self._note = None + self._show_note_when_empty = None self._table_options = None self._field_options = None self._time_format = None self._decimal_places = None self.discriminator = None - if shape is not None: - self.shape = shape - if type is not None: - self.type = type - if table_options is not None: - self.table_options = table_options - if field_options is not None: - self.field_options = field_options - if time_format is not None: - self.time_format = time_format - if decimal_places is not None: - self.decimal_places = decimal_places + self.type = type + self.queries = queries + self.colors = colors + self.shape = shape + self.note = note + self.show_note_when_empty = show_note_when_empty + self.table_options = table_options + self.field_options = field_options + self.time_format = time_format + self.decimal_places = decimal_places + + @property + def type(self): + """Gets the type of this TableViewProperties. # noqa: E501 + + + :return: The type of this TableViewProperties. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this TableViewProperties. + + + :param type: The type of this TableViewProperties. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["table"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def queries(self): + """Gets the queries of this TableViewProperties. # noqa: E501 + + + :return: The queries of this TableViewProperties. # noqa: E501 + :rtype: list[DashboardQuery] + """ + return self._queries + + @queries.setter + def queries(self, queries): + """Sets the queries of this TableViewProperties. + + + :param queries: The queries of this TableViewProperties. # noqa: E501 + :type: list[DashboardQuery] + """ + if queries is None: + raise ValueError("Invalid value for `queries`, must not be `None`") # noqa: E501 + + self._queries = queries + + @property + def colors(self): + """Gets the colors of this TableViewProperties. # noqa: E501 + + Colors define color encoding of data into a visualization # noqa: E501 + + :return: The colors of this TableViewProperties. # noqa: E501 + :rtype: list[DashboardColor] + """ + return self._colors + + @colors.setter + def colors(self, colors): + """Sets the colors of this TableViewProperties. + + Colors define color encoding of data into a visualization # noqa: E501 + + :param colors: The colors of this TableViewProperties. # noqa: E501 + :type: list[DashboardColor] + """ + if colors is None: + raise ValueError("Invalid value for `colors`, must not be `None`") # noqa: E501 + + self._colors = colors @property def shape(self): @@ -90,6 +177,8 @@ def shape(self, shape): :param shape: The shape of this TableViewProperties. # noqa: E501 :type: str """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 allowed_values = ["chronograf-v2"] # noqa: E501 if shape not in allowed_values: raise ValueError( @@ -100,31 +189,52 @@ def shape(self, shape): self._shape = shape @property - def type(self): - """Gets the type of this TableViewProperties. # noqa: E501 + def note(self): + """Gets the note of this TableViewProperties. # noqa: E501 - :return: The type of this TableViewProperties. # noqa: E501 + :return: The note of this TableViewProperties. # noqa: E501 :rtype: str """ - return self._type + return self._note - @type.setter - def type(self, type): - """Sets the type of this TableViewProperties. + @note.setter + def note(self, note): + """Sets the note of this TableViewProperties. - :param type: The type of this TableViewProperties. # noqa: E501 + :param note: The note of this TableViewProperties. # noqa: E501 :type: str """ - allowed_values = ["table"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) + if note is None: + raise ValueError("Invalid value for `note`, must not be `None`") # noqa: E501 - self._type = type + self._note = note + + @property + def show_note_when_empty(self): + """Gets the show_note_when_empty of this TableViewProperties. # noqa: E501 + + if true, will display note when empty # noqa: E501 + + :return: The show_note_when_empty of this TableViewProperties. # noqa: E501 + :rtype: bool + """ + return self._show_note_when_empty + + @show_note_when_empty.setter + def show_note_when_empty(self, show_note_when_empty): + """Sets the show_note_when_empty of this TableViewProperties. + + if true, will display note when empty # noqa: E501 + + :param show_note_when_empty: The show_note_when_empty of this TableViewProperties. # noqa: E501 + :type: bool + """ + if show_note_when_empty is None: + raise ValueError("Invalid value for `show_note_when_empty`, must not be `None`") # noqa: E501 + + self._show_note_when_empty = show_note_when_empty @property def table_options(self): @@ -144,6 +254,8 @@ def table_options(self, table_options): :param table_options: The table_options of this TableViewProperties. # noqa: E501 :type: object """ + if table_options is None: + raise ValueError("Invalid value for `table_options`, must not be `None`") # noqa: E501 self._table_options = table_options @@ -167,6 +279,8 @@ def field_options(self, field_options): :param field_options: The field_options of this TableViewProperties. # noqa: E501 :type: list[RenamableField] """ + if field_options is None: + raise ValueError("Invalid value for `field_options`, must not be `None`") # noqa: E501 self._field_options = field_options @@ -190,6 +304,8 @@ def time_format(self, time_format): :param time_format: The time_format of this TableViewProperties. # noqa: E501 :type: str """ + if time_format is None: + raise ValueError("Invalid value for `time_format`, must not be `None`") # noqa: E501 self._time_format = time_format @@ -211,6 +327,8 @@ def decimal_places(self, decimal_places): :param decimal_places: The decimal_places of this TableViewProperties. # noqa: E501 :type: DecimalPlaces """ + if decimal_places is None: + raise ValueError("Invalid value for `decimal_places`, must not be `None`") # noqa: E501 self._decimal_places = decimal_places diff --git a/influxdb2/domain/tag_rule.py b/influxdb2/domain/tag_rule.py new file mode 100644 index 00000000..3476a2e8 --- /dev/null +++ b/influxdb2/domain/tag_rule.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class TagRule(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'key': 'str', + 'value': 'str', + 'operator': 'str' + } + + attribute_map = { + 'key': 'key', + 'value': 'value', + 'operator': 'operator' + } + + def __init__(self, key=None, value=None, operator=None): # noqa: E501 + """TagRule - a model defined in OpenAPI""" # noqa: E501 + + self._key = None + self._value = None + self._operator = None + self.discriminator = None + + if key is not None: + self.key = key + if value is not None: + self.value = value + if operator is not None: + self.operator = operator + + @property + def key(self): + """Gets the key of this TagRule. # noqa: E501 + + + :return: The key of this TagRule. # noqa: E501 + :rtype: str + """ + return self._key + + @key.setter + def key(self, key): + """Sets the key of this TagRule. + + + :param key: The key of this TagRule. # noqa: E501 + :type: str + """ + + self._key = key + + @property + def value(self): + """Gets the value of this TagRule. # noqa: E501 + + + :return: The value of this TagRule. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this TagRule. + + + :param value: The value of this TagRule. # noqa: E501 + :type: str + """ + + self._value = value + + @property + def operator(self): + """Gets the operator of this TagRule. # noqa: E501 + + + :return: The operator of this TagRule. # noqa: E501 + :rtype: str + """ + return self._operator + + @operator.setter + def operator(self, operator): + """Sets the operator of this TagRule. + + + :param operator: The operator of this TagRule. # noqa: E501 + :type: str + """ + allowed_values = ["equal", "notequal", "equalregex", "notequalregex"] # noqa: E501 + if operator not in allowed_values: + raise ValueError( + "Invalid value for `operator` ({0}), must be one of {1}" # noqa: E501 + .format(operator, allowed_values) + ) + + self._operator = operator + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TagRule): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/models/task.py b/influxdb2/domain/task.py similarity index 94% rename from influxdb2/models/task.py rename to influxdb2/domain/task.py index 89b4cdfa..d797fd2f 100644 --- a/influxdb2/models/task.py +++ b/influxdb2/domain/task.py @@ -36,7 +36,7 @@ class Task(object): 'org': 'str', 'name': 'str', 'description': 'str', - 'status': 'str', + 'status': 'TaskStatusType', 'labels': 'list[Label]', 'authorization_id': 'str', 'flux': 'str', @@ -68,7 +68,7 @@ class Task(object): 'links': 'links' } - def __init__(self, id=None, org_id=None, org=None, name=None, description=None, status='active', labels=None, authorization_id=None, flux=None, every=None, cron=None, offset=None, latest_completed=None, created_at=None, updated_at=None, links=None): # noqa: E501 + def __init__(self, id=None, org_id=None, org=None, name=None, description=None, status=None, labels=None, authorization_id=None, flux=None, every=None, cron=None, offset=None, latest_completed=None, created_at=None, updated_at=None, links=None): # noqa: E501 """Task - a model defined in OpenAPI""" # noqa: E501 self._id = None @@ -241,10 +241,9 @@ def description(self, description): def status(self): """Gets the status of this Task. # noqa: E501 - The current status of the task. When updated to 'inactive', cancels all queued jobs of this task. # noqa: E501 :return: The status of this Task. # noqa: E501 - :rtype: str + :rtype: TaskStatusType """ return self._status @@ -252,17 +251,10 @@ def status(self): def status(self, status): """Sets the status of this Task. - The current status of the task. When updated to 'inactive', cancels all queued jobs of this task. # noqa: E501 :param status: The status of this Task. # noqa: E501 - :type: str + :type: TaskStatusType """ - allowed_values = ["active", "inactive"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) self._status = status diff --git a/influxdb2/models/task_create_request.py b/influxdb2/domain/task_create_request.py similarity index 87% rename from influxdb2/models/task_create_request.py rename to influxdb2/domain/task_create_request.py index ae256e6a..1107b325 100644 --- a/influxdb2/models/task_create_request.py +++ b/influxdb2/domain/task_create_request.py @@ -33,7 +33,7 @@ class TaskCreateRequest(object): openapi_types = { 'org_id': 'str', 'org': 'str', - 'status': 'str', + 'status': 'TaskStatusType', 'flux': 'str', 'description': 'str', 'token': 'str' @@ -48,7 +48,7 @@ class TaskCreateRequest(object): 'token': 'token' } - def __init__(self, org_id=None, org=None, status='active', flux=None, description=None, token=None): # noqa: E501 + def __init__(self, org_id=None, org=None, status=None, flux=None, description=None, token=None): # noqa: E501 """TaskCreateRequest - a model defined in OpenAPI""" # noqa: E501 self._org_id = None @@ -68,8 +68,7 @@ def __init__(self, org_id=None, org=None, status='active', flux=None, descriptio self.flux = flux if description is not None: self.description = description - if token is not None: - self.token = token + self.token = token @property def org_id(self): @@ -121,10 +120,9 @@ def org(self, org): def status(self): """Gets the status of this TaskCreateRequest. # noqa: E501 - Starting state of the task. 'inactive' tasks are not run until they are updated to 'active' # noqa: E501 :return: The status of this TaskCreateRequest. # noqa: E501 - :rtype: str + :rtype: TaskStatusType """ return self._status @@ -132,17 +130,10 @@ def status(self): def status(self, status): """Sets the status of this TaskCreateRequest. - Starting state of the task. 'inactive' tasks are not run until they are updated to 'active' # noqa: E501 :param status: The status of this TaskCreateRequest. # noqa: E501 - :type: str + :type: TaskStatusType """ - allowed_values = ["active", "inactive"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) self._status = status @@ -198,7 +189,7 @@ def description(self, description): def token(self): """Gets the token of this TaskCreateRequest. # noqa: E501 - The token to use for authenticating this task when it executes queries. If omitted, uses the token associated with the request that creates the task. # noqa: E501 + The token to use for authenticating this task when it executes queries. # noqa: E501 :return: The token of this TaskCreateRequest. # noqa: E501 :rtype: str @@ -209,11 +200,13 @@ def token(self): def token(self, token): """Sets the token of this TaskCreateRequest. - The token to use for authenticating this task when it executes queries. If omitted, uses the token associated with the request that creates the task. # noqa: E501 + The token to use for authenticating this task when it executes queries. # noqa: E501 :param token: The token of this TaskCreateRequest. # noqa: E501 :type: str """ + if token is None: + raise ValueError("Invalid value for `token`, must not be `None`") # noqa: E501 self._token = token diff --git a/influxdb2/models/task_links.py b/influxdb2/domain/task_links.py similarity index 100% rename from influxdb2/models/task_links.py rename to influxdb2/domain/task_links.py diff --git a/influxdb2/domain/task_status_type.py b/influxdb2/domain/task_status_type.py new file mode 100644 index 00000000..9952cf63 --- /dev/null +++ b/influxdb2/domain/task_status_type.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class TaskStatusType(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + ACTIVE = "active" + INACTIVE = "inactive" + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """TaskStatusType - a model defined in OpenAPI""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TaskStatusType): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/models/task_update_request.py b/influxdb2/domain/task_update_request.py similarity index 91% rename from influxdb2/models/task_update_request.py rename to influxdb2/domain/task_update_request.py index eb1de418..8703ba8d 100644 --- a/influxdb2/models/task_update_request.py +++ b/influxdb2/domain/task_update_request.py @@ -31,7 +31,7 @@ class TaskUpdateRequest(object): and the value is json key in definition. """ openapi_types = { - 'status': 'str', + 'status': 'TaskStatusType', 'flux': 'str', 'name': 'str', 'every': 'str', @@ -52,7 +52,7 @@ class TaskUpdateRequest(object): 'token': 'token' } - def __init__(self, status='active', flux=None, name=None, every=None, cron=None, offset=None, description=None, token=None): # noqa: E501 + def __init__(self, status=None, flux=None, name=None, every=None, cron=None, offset=None, description=None, token=None): # noqa: E501 """TaskUpdateRequest - a model defined in OpenAPI""" # noqa: E501 self._status = None @@ -86,10 +86,9 @@ def __init__(self, status='active', flux=None, name=None, every=None, cron=None, def status(self): """Gets the status of this TaskUpdateRequest. # noqa: E501 - Starting state of the task. 'inactive' tasks are not run until they are updated to 'active' # noqa: E501 :return: The status of this TaskUpdateRequest. # noqa: E501 - :rtype: str + :rtype: TaskStatusType """ return self._status @@ -97,17 +96,10 @@ def status(self): def status(self, status): """Sets the status of this TaskUpdateRequest. - Starting state of the task. 'inactive' tasks are not run until they are updated to 'active' # noqa: E501 :param status: The status of this TaskUpdateRequest. # noqa: E501 - :type: str + :type: TaskStatusType """ - allowed_values = ["active", "inactive"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) self._status = status diff --git a/influxdb2/models/tasks.py b/influxdb2/domain/tasks.py similarity index 100% rename from influxdb2/models/tasks.py rename to influxdb2/domain/tasks.py diff --git a/influxdb2/models/telegraf.py b/influxdb2/domain/telegraf.py similarity index 100% rename from influxdb2/models/telegraf.py rename to influxdb2/domain/telegraf.py diff --git a/influxdb2/models/telegraf_plugin_input_cpu.py b/influxdb2/domain/telegraf_plugin_input_cpu.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_cpu.py rename to influxdb2/domain/telegraf_plugin_input_cpu.py diff --git a/influxdb2/models/telegraf_plugin_input_disk.py b/influxdb2/domain/telegraf_plugin_input_disk.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_disk.py rename to influxdb2/domain/telegraf_plugin_input_disk.py diff --git a/influxdb2/models/telegraf_plugin_input_diskio.py b/influxdb2/domain/telegraf_plugin_input_diskio.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_diskio.py rename to influxdb2/domain/telegraf_plugin_input_diskio.py diff --git a/influxdb2/models/telegraf_plugin_input_docker.py b/influxdb2/domain/telegraf_plugin_input_docker.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_docker.py rename to influxdb2/domain/telegraf_plugin_input_docker.py diff --git a/influxdb2/models/telegraf_plugin_input_docker_config.py b/influxdb2/domain/telegraf_plugin_input_docker_config.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_docker_config.py rename to influxdb2/domain/telegraf_plugin_input_docker_config.py diff --git a/influxdb2/models/telegraf_plugin_input_file.py b/influxdb2/domain/telegraf_plugin_input_file.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_file.py rename to influxdb2/domain/telegraf_plugin_input_file.py diff --git a/influxdb2/models/telegraf_plugin_input_file_config.py b/influxdb2/domain/telegraf_plugin_input_file_config.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_file_config.py rename to influxdb2/domain/telegraf_plugin_input_file_config.py diff --git a/influxdb2/models/telegraf_plugin_input_kernel.py b/influxdb2/domain/telegraf_plugin_input_kernel.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_kernel.py rename to influxdb2/domain/telegraf_plugin_input_kernel.py diff --git a/influxdb2/models/telegraf_plugin_input_kubernetes.py b/influxdb2/domain/telegraf_plugin_input_kubernetes.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_kubernetes.py rename to influxdb2/domain/telegraf_plugin_input_kubernetes.py diff --git a/influxdb2/models/telegraf_plugin_input_kubernetes_config.py b/influxdb2/domain/telegraf_plugin_input_kubernetes_config.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_kubernetes_config.py rename to influxdb2/domain/telegraf_plugin_input_kubernetes_config.py diff --git a/influxdb2/models/telegraf_plugin_input_log_parser.py b/influxdb2/domain/telegraf_plugin_input_log_parser.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_log_parser.py rename to influxdb2/domain/telegraf_plugin_input_log_parser.py diff --git a/influxdb2/models/telegraf_plugin_input_log_parser_config.py b/influxdb2/domain/telegraf_plugin_input_log_parser_config.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_log_parser_config.py rename to influxdb2/domain/telegraf_plugin_input_log_parser_config.py diff --git a/influxdb2/models/telegraf_plugin_input_mem.py b/influxdb2/domain/telegraf_plugin_input_mem.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_mem.py rename to influxdb2/domain/telegraf_plugin_input_mem.py diff --git a/influxdb2/models/telegraf_plugin_input_net.py b/influxdb2/domain/telegraf_plugin_input_net.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_net.py rename to influxdb2/domain/telegraf_plugin_input_net.py diff --git a/influxdb2/models/telegraf_plugin_input_net_response.py b/influxdb2/domain/telegraf_plugin_input_net_response.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_net_response.py rename to influxdb2/domain/telegraf_plugin_input_net_response.py diff --git a/influxdb2/models/telegraf_plugin_input_nginx.py b/influxdb2/domain/telegraf_plugin_input_nginx.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_nginx.py rename to influxdb2/domain/telegraf_plugin_input_nginx.py diff --git a/influxdb2/models/telegraf_plugin_input_processes.py b/influxdb2/domain/telegraf_plugin_input_processes.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_processes.py rename to influxdb2/domain/telegraf_plugin_input_processes.py diff --git a/influxdb2/models/telegraf_plugin_input_procstat.py b/influxdb2/domain/telegraf_plugin_input_procstat.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_procstat.py rename to influxdb2/domain/telegraf_plugin_input_procstat.py diff --git a/influxdb2/models/telegraf_plugin_input_procstat_config.py b/influxdb2/domain/telegraf_plugin_input_procstat_config.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_procstat_config.py rename to influxdb2/domain/telegraf_plugin_input_procstat_config.py diff --git a/influxdb2/models/telegraf_plugin_input_prometheus.py b/influxdb2/domain/telegraf_plugin_input_prometheus.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_prometheus.py rename to influxdb2/domain/telegraf_plugin_input_prometheus.py diff --git a/influxdb2/models/telegraf_plugin_input_prometheus_config.py b/influxdb2/domain/telegraf_plugin_input_prometheus_config.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_prometheus_config.py rename to influxdb2/domain/telegraf_plugin_input_prometheus_config.py diff --git a/influxdb2/models/telegraf_plugin_input_redis.py b/influxdb2/domain/telegraf_plugin_input_redis.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_redis.py rename to influxdb2/domain/telegraf_plugin_input_redis.py diff --git a/influxdb2/models/telegraf_plugin_input_redis_config.py b/influxdb2/domain/telegraf_plugin_input_redis_config.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_redis_config.py rename to influxdb2/domain/telegraf_plugin_input_redis_config.py diff --git a/influxdb2/models/telegraf_plugin_input_swap.py b/influxdb2/domain/telegraf_plugin_input_swap.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_swap.py rename to influxdb2/domain/telegraf_plugin_input_swap.py diff --git a/influxdb2/models/telegraf_plugin_input_syslog.py b/influxdb2/domain/telegraf_plugin_input_syslog.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_syslog.py rename to influxdb2/domain/telegraf_plugin_input_syslog.py diff --git a/influxdb2/models/telegraf_plugin_input_syslog_config.py b/influxdb2/domain/telegraf_plugin_input_syslog_config.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_syslog_config.py rename to influxdb2/domain/telegraf_plugin_input_syslog_config.py diff --git a/influxdb2/models/telegraf_plugin_input_system.py b/influxdb2/domain/telegraf_plugin_input_system.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_system.py rename to influxdb2/domain/telegraf_plugin_input_system.py diff --git a/influxdb2/models/telegraf_plugin_input_tail.py b/influxdb2/domain/telegraf_plugin_input_tail.py similarity index 100% rename from influxdb2/models/telegraf_plugin_input_tail.py rename to influxdb2/domain/telegraf_plugin_input_tail.py diff --git a/influxdb2/models/telegraf_plugin_output_file.py b/influxdb2/domain/telegraf_plugin_output_file.py similarity index 100% rename from influxdb2/models/telegraf_plugin_output_file.py rename to influxdb2/domain/telegraf_plugin_output_file.py diff --git a/influxdb2/models/telegraf_plugin_output_file_config.py b/influxdb2/domain/telegraf_plugin_output_file_config.py similarity index 100% rename from influxdb2/models/telegraf_plugin_output_file_config.py rename to influxdb2/domain/telegraf_plugin_output_file_config.py diff --git a/influxdb2/models/telegraf_plugin_output_file_config_files.py b/influxdb2/domain/telegraf_plugin_output_file_config_files.py similarity index 100% rename from influxdb2/models/telegraf_plugin_output_file_config_files.py rename to influxdb2/domain/telegraf_plugin_output_file_config_files.py diff --git a/influxdb2/models/telegraf_plugin_output_influx_dbv2.py b/influxdb2/domain/telegraf_plugin_output_influx_dbv2.py similarity index 100% rename from influxdb2/models/telegraf_plugin_output_influx_dbv2.py rename to influxdb2/domain/telegraf_plugin_output_influx_dbv2.py diff --git a/influxdb2/models/telegraf_plugin_output_influx_dbv2_config.py b/influxdb2/domain/telegraf_plugin_output_influx_dbv2_config.py similarity index 100% rename from influxdb2/models/telegraf_plugin_output_influx_dbv2_config.py rename to influxdb2/domain/telegraf_plugin_output_influx_dbv2_config.py diff --git a/influxdb2/models/telegraf_request.py b/influxdb2/domain/telegraf_request.py similarity index 100% rename from influxdb2/models/telegraf_request.py rename to influxdb2/domain/telegraf_request.py diff --git a/influxdb2/models/telegraf_request_agent.py b/influxdb2/domain/telegraf_request_agent.py similarity index 100% rename from influxdb2/models/telegraf_request_agent.py rename to influxdb2/domain/telegraf_request_agent.py diff --git a/influxdb2/models/telegraf_request_plugin.py b/influxdb2/domain/telegraf_request_plugin.py similarity index 100% rename from influxdb2/models/telegraf_request_plugin.py rename to influxdb2/domain/telegraf_request_plugin.py diff --git a/influxdb2/models/telegrafs.py b/influxdb2/domain/telegrafs.py similarity index 100% rename from influxdb2/models/telegrafs.py rename to influxdb2/domain/telegrafs.py diff --git a/influxdb2/models/test_statement.py b/influxdb2/domain/test_statement.py similarity index 100% rename from influxdb2/models/test_statement.py rename to influxdb2/domain/test_statement.py diff --git a/influxdb2/domain/threshold.py b/influxdb2/domain/threshold.py new file mode 100644 index 00000000..6123f0c6 --- /dev/null +++ b/influxdb2/domain/threshold.py @@ -0,0 +1,192 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Threshold(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'level': 'CheckStatusLevel', + 'all_values': 'bool', + 'lower_bound': 'float', + 'upper_bound': 'float' + } + + attribute_map = { + 'level': 'level', + 'all_values': 'allValues', + 'lower_bound': 'lowerBound', + 'upper_bound': 'upperBound' + } + + def __init__(self, level=None, all_values=None, lower_bound=None, upper_bound=None): # noqa: E501 + """Threshold - a model defined in OpenAPI""" # noqa: E501 + + self._level = None + self._all_values = None + self._lower_bound = None + self._upper_bound = None + self.discriminator = None + + if level is not None: + self.level = level + if all_values is not None: + self.all_values = all_values + if lower_bound is not None: + self.lower_bound = lower_bound + if upper_bound is not None: + self.upper_bound = upper_bound + + @property + def level(self): + """Gets the level of this Threshold. # noqa: E501 + + + :return: The level of this Threshold. # noqa: E501 + :rtype: CheckStatusLevel + """ + return self._level + + @level.setter + def level(self, level): + """Sets the level of this Threshold. + + + :param level: The level of this Threshold. # noqa: E501 + :type: CheckStatusLevel + """ + + self._level = level + + @property + def all_values(self): + """Gets the all_values of this Threshold. # noqa: E501 + + if true, only alert if all values meet threshold # noqa: E501 + + :return: The all_values of this Threshold. # noqa: E501 + :rtype: bool + """ + return self._all_values + + @all_values.setter + def all_values(self, all_values): + """Sets the all_values of this Threshold. + + if true, only alert if all values meet threshold # noqa: E501 + + :param all_values: The all_values of this Threshold. # noqa: E501 + :type: bool + """ + + self._all_values = all_values + + @property + def lower_bound(self): + """Gets the lower_bound of this Threshold. # noqa: E501 + + + :return: The lower_bound of this Threshold. # noqa: E501 + :rtype: float + """ + return self._lower_bound + + @lower_bound.setter + def lower_bound(self, lower_bound): + """Sets the lower_bound of this Threshold. + + + :param lower_bound: The lower_bound of this Threshold. # noqa: E501 + :type: float + """ + + self._lower_bound = lower_bound + + @property + def upper_bound(self): + """Gets the upper_bound of this Threshold. # noqa: E501 + + + :return: The upper_bound of this Threshold. # noqa: E501 + :rtype: float + """ + return self._upper_bound + + @upper_bound.setter + def upper_bound(self, upper_bound): + """Sets the upper_bound of this Threshold. + + + :param upper_bound: The upper_bound of this Threshold. # noqa: E501 + :type: float + """ + + self._upper_bound = upper_bound + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Threshold): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/models/empty_view_properties.py b/influxdb2/domain/threshold_check.py similarity index 65% rename from influxdb2/models/empty_view_properties.py rename to influxdb2/domain/threshold_check.py index f59bf196..c011e69d 100644 --- a/influxdb2/models/empty_view_properties.py +++ b/influxdb2/domain/threshold_check.py @@ -16,7 +16,7 @@ import six -class EmptyViewProperties(object): +class ThresholdCheck(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -31,80 +31,74 @@ class EmptyViewProperties(object): and the value is json key in definition. """ openapi_types = { - 'shape': 'str', - 'type': 'str' + 'type': 'str', + 'thresholds': 'list[Threshold]' } attribute_map = { - 'shape': 'shape', - 'type': 'type' + 'type': 'type', + 'thresholds': 'thresholds' } - def __init__(self, shape=None, type=None): # noqa: E501 - """EmptyViewProperties - a model defined in OpenAPI""" # noqa: E501 + def __init__(self, type=None, thresholds=None): # noqa: E501 + """ThresholdCheck - a model defined in OpenAPI""" # noqa: E501 - self._shape = None self._type = None + self._thresholds = None self.discriminator = None - if shape is not None: - self.shape = shape if type is not None: self.type = type + if thresholds is not None: + self.thresholds = thresholds @property - def shape(self): - """Gets the shape of this EmptyViewProperties. # noqa: E501 + def type(self): + """Gets the type of this ThresholdCheck. # noqa: E501 - :return: The shape of this EmptyViewProperties. # noqa: E501 + :return: The type of this ThresholdCheck. # noqa: E501 :rtype: str """ - return self._shape + return self._type - @shape.setter - def shape(self, shape): - """Sets the shape of this EmptyViewProperties. + @type.setter + def type(self, type): + """Sets the type of this ThresholdCheck. - :param shape: The shape of this EmptyViewProperties. # noqa: E501 + :param type: The type of this ThresholdCheck. # noqa: E501 :type: str """ - allowed_values = ["chronograf-v2"] # noqa: E501 - if shape not in allowed_values: + allowed_values = ["threshold"] # noqa: E501 + if type not in allowed_values: raise ValueError( - "Invalid value for `shape` ({0}), must be one of {1}" # noqa: E501 - .format(shape, allowed_values) + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) ) - self._shape = shape + self._type = type @property - def type(self): - """Gets the type of this EmptyViewProperties. # noqa: E501 + def thresholds(self): + """Gets the thresholds of this ThresholdCheck. # noqa: E501 - :return: The type of this EmptyViewProperties. # noqa: E501 - :rtype: str + :return: The thresholds of this ThresholdCheck. # noqa: E501 + :rtype: list[Threshold] """ - return self._type + return self._thresholds - @type.setter - def type(self, type): - """Sets the type of this EmptyViewProperties. + @thresholds.setter + def thresholds(self, thresholds): + """Sets the thresholds of this ThresholdCheck. - :param type: The type of this EmptyViewProperties. # noqa: E501 - :type: str + :param thresholds: The thresholds of this ThresholdCheck. # noqa: E501 + :type: list[Threshold] """ - allowed_values = ["empty"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) - self._type = type + self._thresholds = thresholds def to_dict(self): """Returns the model properties as a dict""" @@ -140,7 +134,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, EmptyViewProperties): + if not isinstance(other, ThresholdCheck): return False return self.__dict__ == other.__dict__ diff --git a/influxdb2/models/unary_expression.py b/influxdb2/domain/unary_expression.py similarity index 100% rename from influxdb2/models/unary_expression.py rename to influxdb2/domain/unary_expression.py diff --git a/influxdb2/models/unsigned_integer_literal.py b/influxdb2/domain/unsigned_integer_literal.py similarity index 100% rename from influxdb2/models/unsigned_integer_literal.py rename to influxdb2/domain/unsigned_integer_literal.py diff --git a/influxdb2/models/user.py b/influxdb2/domain/user.py similarity index 87% rename from influxdb2/models/user.py rename to influxdb2/domain/user.py index 727a056f..f0d45976 100644 --- a/influxdb2/models/user.py +++ b/influxdb2/domain/user.py @@ -32,6 +32,7 @@ class User(object): """ openapi_types = { 'id': 'str', + 'oauth_id': 'str', 'name': 'str', 'status': 'str', 'links': 'UserLinks' @@ -39,15 +40,17 @@ class User(object): attribute_map = { 'id': 'id', + 'oauth_id': 'oauthID', 'name': 'name', 'status': 'status', 'links': 'links' } - def __init__(self, id=None, name=None, status='active', links=None): # noqa: E501 + def __init__(self, id=None, oauth_id=None, name=None, status='active', links=None): # noqa: E501 """User - a model defined in OpenAPI""" # noqa: E501 self._id = None + self._oauth_id = None self._name = None self._status = None self._links = None @@ -55,6 +58,8 @@ def __init__(self, id=None, name=None, status='active', links=None): # noqa: E5 if id is not None: self.id = id + if oauth_id is not None: + self.oauth_id = oauth_id self.name = name if status is not None: self.status = status @@ -82,6 +87,27 @@ def id(self, id): self._id = id + @property + def oauth_id(self): + """Gets the oauth_id of this User. # noqa: E501 + + + :return: The oauth_id of this User. # noqa: E501 + :rtype: str + """ + return self._oauth_id + + @oauth_id.setter + def oauth_id(self, oauth_id): + """Sets the oauth_id of this User. + + + :param oauth_id: The oauth_id of this User. # noqa: E501 + :type: str + """ + + self._oauth_id = oauth_id + @property def name(self): """Gets the name of this User. # noqa: E501 diff --git a/influxdb2/models/user_links.py b/influxdb2/domain/user_links.py similarity index 100% rename from influxdb2/models/user_links.py rename to influxdb2/domain/user_links.py diff --git a/influxdb2/models/users.py b/influxdb2/domain/users.py similarity index 100% rename from influxdb2/models/users.py rename to influxdb2/domain/users.py diff --git a/influxdb2/models/users_links.py b/influxdb2/domain/users_links.py similarity index 100% rename from influxdb2/models/users_links.py rename to influxdb2/domain/users_links.py diff --git a/influxdb2/models/variable.py b/influxdb2/domain/variable.py similarity index 83% rename from influxdb2/models/variable.py rename to influxdb2/domain/variable.py index dc3dd8e8..ec53280f 100644 --- a/influxdb2/models/variable.py +++ b/influxdb2/domain/variable.py @@ -38,7 +38,9 @@ class Variable(object): 'description': 'str', 'selected': 'list[str]', 'labels': 'list[Label]', - 'arguments': 'object' + 'arguments': 'object', + 'created_at': 'datetime', + 'updated_at': 'datetime' } attribute_map = { @@ -49,10 +51,12 @@ class Variable(object): 'description': 'description', 'selected': 'selected', 'labels': 'labels', - 'arguments': 'arguments' + 'arguments': 'arguments', + 'created_at': 'createdAt', + 'updated_at': 'updatedAt' } - def __init__(self, links=None, id=None, org_id=None, name=None, description=None, selected=None, labels=None, arguments=None): # noqa: E501 + def __init__(self, links=None, id=None, org_id=None, name=None, description=None, selected=None, labels=None, arguments=None, created_at=None, updated_at=None): # noqa: E501 """Variable - a model defined in OpenAPI""" # noqa: E501 self._links = None @@ -63,6 +67,8 @@ def __init__(self, links=None, id=None, org_id=None, name=None, description=None self._selected = None self._labels = None self._arguments = None + self._created_at = None + self._updated_at = None self.discriminator = None if links is not None: @@ -78,6 +84,10 @@ def __init__(self, links=None, id=None, org_id=None, name=None, description=None if labels is not None: self.labels = labels self.arguments = arguments + if created_at is not None: + self.created_at = created_at + if updated_at is not None: + self.updated_at = updated_at @property def links(self): @@ -253,6 +263,48 @@ def arguments(self, arguments): self._arguments = arguments + @property + def created_at(self): + """Gets the created_at of this Variable. # noqa: E501 + + + :return: The created_at of this Variable. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this Variable. + + + :param created_at: The created_at of this Variable. # noqa: E501 + :type: datetime + """ + + self._created_at = created_at + + @property + def updated_at(self): + """Gets the updated_at of this Variable. # noqa: E501 + + + :return: The updated_at of this Variable. # noqa: E501 + :rtype: datetime + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this Variable. + + + :param updated_at: The updated_at of this Variable. # noqa: E501 + :type: datetime + """ + + self._updated_at = updated_at + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/influxdb2/models/variable_assignment.py b/influxdb2/domain/variable_assignment.py similarity index 100% rename from influxdb2/models/variable_assignment.py rename to influxdb2/domain/variable_assignment.py diff --git a/influxdb2/models/variable_links.py b/influxdb2/domain/variable_links.py similarity index 100% rename from influxdb2/models/variable_links.py rename to influxdb2/domain/variable_links.py diff --git a/influxdb2/models/variables.py b/influxdb2/domain/variables.py similarity index 100% rename from influxdb2/models/variables.py rename to influxdb2/domain/variables.py diff --git a/influxdb2/models/view.py b/influxdb2/domain/view.py similarity index 91% rename from influxdb2/models/view.py rename to influxdb2/domain/view.py index 7279ad17..2c7078b5 100644 --- a/influxdb2/models/view.py +++ b/influxdb2/domain/view.py @@ -34,7 +34,7 @@ class View(object): 'links': 'ViewLinks', 'id': 'str', 'name': 'str', - 'properties': 'object' + 'properties': 'ViewProperties' } attribute_map = { @@ -57,10 +57,8 @@ def __init__(self, links=None, id=None, name=None, properties=None): # noqa: E5 self.links = links if id is not None: self.id = id - if name is not None: - self.name = name - if properties is not None: - self.properties = properties + self.name = name + self.properties = properties @property def links(self): @@ -122,6 +120,8 @@ def name(self, name): :param name: The name of this View. # noqa: E501 :type: str """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name @@ -131,7 +131,7 @@ def properties(self): :return: The properties of this View. # noqa: E501 - :rtype: object + :rtype: ViewProperties """ return self._properties @@ -141,8 +141,10 @@ def properties(self, properties): :param properties: The properties of this View. # noqa: E501 - :type: object + :type: ViewProperties """ + if properties is None: + raise ValueError("Invalid value for `properties`, must not be `None`") # noqa: E501 self._properties = properties diff --git a/influxdb2/models/view_links.py b/influxdb2/domain/view_links.py similarity index 100% rename from influxdb2/models/view_links.py rename to influxdb2/domain/view_links.py diff --git a/influxdb2/domain/view_properties.py b/influxdb2/domain/view_properties.py new file mode 100644 index 00000000..66e8689a --- /dev/null +++ b/influxdb2/domain/view_properties.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ViewProperties(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ViewProperties - a model defined in OpenAPI""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ViewProperties): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/domain/views.py b/influxdb2/domain/views.py new file mode 100644 index 00000000..d5bb7868 --- /dev/null +++ b/influxdb2/domain/views.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Views(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'links': 'ViewLinks', + 'views': 'list[View]' + } + + attribute_map = { + 'links': 'links', + 'views': 'views' + } + + def __init__(self, links=None, views=None): # noqa: E501 + """Views - a model defined in OpenAPI""" # noqa: E501 + + self._links = None + self._views = None + self.discriminator = None + + if links is not None: + self.links = links + if views is not None: + self.views = views + + @property + def links(self): + """Gets the links of this Views. # noqa: E501 + + + :return: The links of this Views. # noqa: E501 + :rtype: ViewLinks + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this Views. + + + :param links: The links of this Views. # noqa: E501 + :type: ViewLinks + """ + + self._links = links + + @property + def views(self): + """Gets the views of this Views. # noqa: E501 + + + :return: The views of this Views. # noqa: E501 + :rtype: list[View] + """ + return self._views + + @views.setter + def views(self, views): + """Sets the views of this Views. + + + :param views: The views of this Views. # noqa: E501 + :type: list[View] + """ + + self._views = views + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Views): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/domain/webhook_notification_endpoint.py b/influxdb2/domain/webhook_notification_endpoint.py new file mode 100644 index 00000000..15d12a74 --- /dev/null +++ b/influxdb2/domain/webhook_notification_endpoint.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class WebhookNotificationEndpoint(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'name': 'str' + } + + attribute_map = { + 'name': 'name' + } + + def __init__(self, name=None): # noqa: E501 + """WebhookNotificationEndpoint - a model defined in OpenAPI""" # noqa: E501 + + self._name = None + self.discriminator = None + + if name is not None: + self.name = name + + @property + def name(self): + """Gets the name of this WebhookNotificationEndpoint. # noqa: E501 + + + :return: The name of this WebhookNotificationEndpoint. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this WebhookNotificationEndpoint. + + + :param name: The name of this WebhookNotificationEndpoint. # noqa: E501 + :type: str + """ + allowed_values = ["webhook"] # noqa: E501 + if name not in allowed_values: + raise ValueError( + "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 + .format(name, allowed_values) + ) + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, WebhookNotificationEndpoint): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/models/write_precision.py b/influxdb2/domain/write_precision.py similarity index 100% rename from influxdb2/models/write_precision.py rename to influxdb2/domain/write_precision.py diff --git a/influxdb2/domain/xy_geom.py b/influxdb2/domain/xy_geom.py new file mode 100644 index 00000000..b0a6b241 --- /dev/null +++ b/influxdb2/domain/xy_geom.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class XYGeom(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + LINE = "line" + STEP = "step" + STACKED = "stacked" + BAR = "bar" + MONOTONEX = "monotoneX" + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """XYGeom - a model defined in OpenAPI""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, XYGeom): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/domain/xy_view_properties.py b/influxdb2/domain/xy_view_properties.py new file mode 100644 index 00000000..8a7108dc --- /dev/null +++ b/influxdb2/domain/xy_view_properties.py @@ -0,0 +1,423 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class XYViewProperties(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'type': 'str', + 'queries': 'list[DashboardQuery]', + 'colors': 'list[DashboardColor]', + 'shape': 'str', + 'note': 'str', + 'show_note_when_empty': 'bool', + 'axes': 'Axes', + 'legend': 'Legend', + 'x_column': 'str', + 'y_column': 'str', + 'shade_below': 'bool', + 'geom': 'XYGeom' + } + + attribute_map = { + 'type': 'type', + 'queries': 'queries', + 'colors': 'colors', + 'shape': 'shape', + 'note': 'note', + 'show_note_when_empty': 'showNoteWhenEmpty', + 'axes': 'axes', + 'legend': 'legend', + 'x_column': 'xColumn', + 'y_column': 'yColumn', + 'shade_below': 'shadeBelow', + 'geom': 'geom' + } + + def __init__(self, type=None, queries=None, colors=None, shape=None, note=None, show_note_when_empty=None, axes=None, legend=None, x_column=None, y_column=None, shade_below=None, geom=None): # noqa: E501 + """XYViewProperties - a model defined in OpenAPI""" # noqa: E501 + + self._type = None + self._queries = None + self._colors = None + self._shape = None + self._note = None + self._show_note_when_empty = None + self._axes = None + self._legend = None + self._x_column = None + self._y_column = None + self._shade_below = None + self._geom = None + self.discriminator = None + + self.type = type + self.queries = queries + self.colors = colors + self.shape = shape + self.note = note + self.show_note_when_empty = show_note_when_empty + self.axes = axes + self.legend = legend + if x_column is not None: + self.x_column = x_column + if y_column is not None: + self.y_column = y_column + if shade_below is not None: + self.shade_below = shade_below + self.geom = geom + + @property + def type(self): + """Gets the type of this XYViewProperties. # noqa: E501 + + + :return: The type of this XYViewProperties. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this XYViewProperties. + + + :param type: The type of this XYViewProperties. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["xy"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def queries(self): + """Gets the queries of this XYViewProperties. # noqa: E501 + + + :return: The queries of this XYViewProperties. # noqa: E501 + :rtype: list[DashboardQuery] + """ + return self._queries + + @queries.setter + def queries(self, queries): + """Sets the queries of this XYViewProperties. + + + :param queries: The queries of this XYViewProperties. # noqa: E501 + :type: list[DashboardQuery] + """ + if queries is None: + raise ValueError("Invalid value for `queries`, must not be `None`") # noqa: E501 + + self._queries = queries + + @property + def colors(self): + """Gets the colors of this XYViewProperties. # noqa: E501 + + Colors define color encoding of data into a visualization # noqa: E501 + + :return: The colors of this XYViewProperties. # noqa: E501 + :rtype: list[DashboardColor] + """ + return self._colors + + @colors.setter + def colors(self, colors): + """Sets the colors of this XYViewProperties. + + Colors define color encoding of data into a visualization # noqa: E501 + + :param colors: The colors of this XYViewProperties. # noqa: E501 + :type: list[DashboardColor] + """ + if colors is None: + raise ValueError("Invalid value for `colors`, must not be `None`") # noqa: E501 + + self._colors = colors + + @property + def shape(self): + """Gets the shape of this XYViewProperties. # noqa: E501 + + + :return: The shape of this XYViewProperties. # noqa: E501 + :rtype: str + """ + return self._shape + + @shape.setter + def shape(self, shape): + """Sets the shape of this XYViewProperties. + + + :param shape: The shape of this XYViewProperties. # noqa: E501 + :type: str + """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 + allowed_values = ["chronograf-v2"] # noqa: E501 + if shape not in allowed_values: + raise ValueError( + "Invalid value for `shape` ({0}), must be one of {1}" # noqa: E501 + .format(shape, allowed_values) + ) + + self._shape = shape + + @property + def note(self): + """Gets the note of this XYViewProperties. # noqa: E501 + + + :return: The note of this XYViewProperties. # noqa: E501 + :rtype: str + """ + return self._note + + @note.setter + def note(self, note): + """Sets the note of this XYViewProperties. + + + :param note: The note of this XYViewProperties. # noqa: E501 + :type: str + """ + if note is None: + raise ValueError("Invalid value for `note`, must not be `None`") # noqa: E501 + + self._note = note + + @property + def show_note_when_empty(self): + """Gets the show_note_when_empty of this XYViewProperties. # noqa: E501 + + if true, will display note when empty # noqa: E501 + + :return: The show_note_when_empty of this XYViewProperties. # noqa: E501 + :rtype: bool + """ + return self._show_note_when_empty + + @show_note_when_empty.setter + def show_note_when_empty(self, show_note_when_empty): + """Sets the show_note_when_empty of this XYViewProperties. + + if true, will display note when empty # noqa: E501 + + :param show_note_when_empty: The show_note_when_empty of this XYViewProperties. # noqa: E501 + :type: bool + """ + if show_note_when_empty is None: + raise ValueError("Invalid value for `show_note_when_empty`, must not be `None`") # noqa: E501 + + self._show_note_when_empty = show_note_when_empty + + @property + def axes(self): + """Gets the axes of this XYViewProperties. # noqa: E501 + + + :return: The axes of this XYViewProperties. # noqa: E501 + :rtype: Axes + """ + return self._axes + + @axes.setter + def axes(self, axes): + """Sets the axes of this XYViewProperties. + + + :param axes: The axes of this XYViewProperties. # noqa: E501 + :type: Axes + """ + if axes is None: + raise ValueError("Invalid value for `axes`, must not be `None`") # noqa: E501 + + self._axes = axes + + @property + def legend(self): + """Gets the legend of this XYViewProperties. # noqa: E501 + + + :return: The legend of this XYViewProperties. # noqa: E501 + :rtype: Legend + """ + return self._legend + + @legend.setter + def legend(self, legend): + """Sets the legend of this XYViewProperties. + + + :param legend: The legend of this XYViewProperties. # noqa: E501 + :type: Legend + """ + if legend is None: + raise ValueError("Invalid value for `legend`, must not be `None`") # noqa: E501 + + self._legend = legend + + @property + def x_column(self): + """Gets the x_column of this XYViewProperties. # noqa: E501 + + + :return: The x_column of this XYViewProperties. # noqa: E501 + :rtype: str + """ + return self._x_column + + @x_column.setter + def x_column(self, x_column): + """Sets the x_column of this XYViewProperties. + + + :param x_column: The x_column of this XYViewProperties. # noqa: E501 + :type: str + """ + + self._x_column = x_column + + @property + def y_column(self): + """Gets the y_column of this XYViewProperties. # noqa: E501 + + + :return: The y_column of this XYViewProperties. # noqa: E501 + :rtype: str + """ + return self._y_column + + @y_column.setter + def y_column(self, y_column): + """Sets the y_column of this XYViewProperties. + + + :param y_column: The y_column of this XYViewProperties. # noqa: E501 + :type: str + """ + + self._y_column = y_column + + @property + def shade_below(self): + """Gets the shade_below of this XYViewProperties. # noqa: E501 + + + :return: The shade_below of this XYViewProperties. # noqa: E501 + :rtype: bool + """ + return self._shade_below + + @shade_below.setter + def shade_below(self, shade_below): + """Sets the shade_below of this XYViewProperties. + + + :param shade_below: The shade_below of this XYViewProperties. # noqa: E501 + :type: bool + """ + + self._shade_below = shade_below + + @property + def geom(self): + """Gets the geom of this XYViewProperties. # noqa: E501 + + + :return: The geom of this XYViewProperties. # noqa: E501 + :rtype: XYGeom + """ + return self._geom + + @geom.setter + def geom(self, geom): + """Sets the geom of this XYViewProperties. + + + :param geom: The geom of this XYViewProperties. # noqa: E501 + :type: XYGeom + """ + if geom is None: + raise ValueError("Invalid value for `geom`, must not be `None`") # noqa: E501 + + self._geom = geom + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, XYViewProperties): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/influxdb2/models/__init__.py b/influxdb2/models/__init__.py deleted file mode 100644 index 1233a942..00000000 --- a/influxdb2/models/__init__.py +++ /dev/null @@ -1,214 +0,0 @@ -# coding: utf-8 - -# flake8: noqa -""" - Influx API Service - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: 0.1.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -# import models into model package -from influxdb2.models.ast_response import ASTResponse -from influxdb2.models.add_resource_member_request_body import AddResourceMemberRequestBody -from influxdb2.models.analyze_query_response import AnalyzeQueryResponse -from influxdb2.models.analyze_query_response_errors import AnalyzeQueryResponseErrors -from influxdb2.models.array_expression import ArrayExpression -from influxdb2.models.authorization import Authorization -from influxdb2.models.authorization_update_request import AuthorizationUpdateRequest -from influxdb2.models.authorizations import Authorizations -from influxdb2.models.axes import Axes -from influxdb2.models.axis import Axis -from influxdb2.models.bad_statement import BadStatement -from influxdb2.models.binary_expression import BinaryExpression -from influxdb2.models.block import Block -from influxdb2.models.boolean_literal import BooleanLiteral -from influxdb2.models.bucket import Bucket -from influxdb2.models.bucket_links import BucketLinks -from influxdb2.models.bucket_retention_rules import BucketRetentionRules -from influxdb2.models.buckets import Buckets -from influxdb2.models.builtin_statement import BuiltinStatement -from influxdb2.models.call_expression import CallExpression -from influxdb2.models.cell import Cell -from influxdb2.models.cell_links import CellLinks -from influxdb2.models.cell_update import CellUpdate -from influxdb2.models.check import Check -from influxdb2.models.conditional_expression import ConditionalExpression -from influxdb2.models.constant_variable_properties import ConstantVariableProperties -from influxdb2.models.create_cell import CreateCell -from influxdb2.models.create_dashboard_request import CreateDashboardRequest -from influxdb2.models.dashboard import Dashboard -from influxdb2.models.dashboard_color import DashboardColor -from influxdb2.models.dashboard_query import DashboardQuery -from influxdb2.models.dashboard_query_range import DashboardQueryRange -from influxdb2.models.dashboards import Dashboards -from influxdb2.models.date_time_literal import DateTimeLiteral -from influxdb2.models.decimal_places import DecimalPlaces -from influxdb2.models.dialect import Dialect -from influxdb2.models.document import Document -from influxdb2.models.document_create import DocumentCreate -from influxdb2.models.document_links import DocumentLinks -from influxdb2.models.document_list_entry import DocumentListEntry -from influxdb2.models.document_meta import DocumentMeta -from influxdb2.models.document_update import DocumentUpdate -from influxdb2.models.documents import Documents -from influxdb2.models.duration import Duration -from influxdb2.models.duration_literal import DurationLiteral -from influxdb2.models.empty_view_properties import EmptyViewProperties -from influxdb2.models.error import Error -from influxdb2.models.expression import Expression -from influxdb2.models.expression_statement import ExpressionStatement -from influxdb2.models.field import Field -from influxdb2.models.file import File -from influxdb2.models.float_literal import FloatLiteral -from influxdb2.models.flux_suggestion import FluxSuggestion -from influxdb2.models.flux_suggestions import FluxSuggestions -from influxdb2.models.function_expression import FunctionExpression -from influxdb2.models.gauge_view_properties import GaugeViewProperties -from influxdb2.models.histogram_view_properties import HistogramViewProperties -from influxdb2.models.identifier import Identifier -from influxdb2.models.import_declaration import ImportDeclaration -from influxdb2.models.index_expression import IndexExpression -from influxdb2.models.integer_literal import IntegerLiteral -from influxdb2.models.is_onboarding import IsOnboarding -from influxdb2.models.label import Label -from influxdb2.models.label_create_request import LabelCreateRequest -from influxdb2.models.label_mapping import LabelMapping -from influxdb2.models.label_response import LabelResponse -from influxdb2.models.label_update import LabelUpdate -from influxdb2.models.labels_response import LabelsResponse -from influxdb2.models.language_request import LanguageRequest -from influxdb2.models.legend import Legend -from influxdb2.models.line_plus_single_stat_properties import LinePlusSingleStatProperties -from influxdb2.models.line_protocol_error import LineProtocolError -from influxdb2.models.line_protocol_length_error import LineProtocolLengthError -from influxdb2.models.links import Links -from influxdb2.models.log_event import LogEvent -from influxdb2.models.log_view_properties import LogViewProperties -from influxdb2.models.log_viewer_column import LogViewerColumn -from influxdb2.models.log_viewer_column_settings import LogViewerColumnSettings -from influxdb2.models.logical_expression import LogicalExpression -from influxdb2.models.logs import Logs -from influxdb2.models.map_variable_properties import MapVariableProperties -from influxdb2.models.markdown_view_properties import MarkdownViewProperties -from influxdb2.models.member_assignment import MemberAssignment -from influxdb2.models.member_expression import MemberExpression -from influxdb2.models.model_property import ModelProperty -from influxdb2.models.node import Node -from influxdb2.models.object_expression import ObjectExpression -from influxdb2.models.onboarding_request import OnboardingRequest -from influxdb2.models.onboarding_response import OnboardingResponse -from influxdb2.models.operation_log import OperationLog -from influxdb2.models.operation_log_links import OperationLogLinks -from influxdb2.models.operation_logs import OperationLogs -from influxdb2.models.option_statement import OptionStatement -from influxdb2.models.organization import Organization -from influxdb2.models.organization_links import OrganizationLinks -from influxdb2.models.organizations import Organizations -from influxdb2.models.package import Package -from influxdb2.models.package_clause import PackageClause -from influxdb2.models.password_reset_body import PasswordResetBody -from influxdb2.models.permission import Permission -from influxdb2.models.permission_resource import PermissionResource -from influxdb2.models.pipe_expression import PipeExpression -from influxdb2.models.pipe_literal import PipeLiteral -from influxdb2.models.property_key import PropertyKey -from influxdb2.models.query import Query -from influxdb2.models.query_config import QueryConfig -from influxdb2.models.query_config_group_by import QueryConfigGroupBy -from influxdb2.models.query_config_range import QueryConfigRange -from influxdb2.models.query_variable_properties import QueryVariableProperties -from influxdb2.models.query_variable_properties_values import QueryVariablePropertiesValues -from influxdb2.models.ready import Ready -from influxdb2.models.regexp_literal import RegexpLiteral -from influxdb2.models.renamable_field import RenamableField -from influxdb2.models.resource_member import ResourceMember -from influxdb2.models.resource_members import ResourceMembers -from influxdb2.models.resource_owner import ResourceOwner -from influxdb2.models.resource_owners import ResourceOwners -from influxdb2.models.return_statement import ReturnStatement -from influxdb2.models.routes import Routes -from influxdb2.models.routes_external import RoutesExternal -from influxdb2.models.routes_query import RoutesQuery -from influxdb2.models.routes_system import RoutesSystem -from influxdb2.models.run import Run -from influxdb2.models.run_links import RunLinks -from influxdb2.models.run_log import RunLog -from influxdb2.models.run_manually import RunManually -from influxdb2.models.runs import Runs -from influxdb2.models.scraper_target_request import ScraperTargetRequest -from influxdb2.models.scraper_target_response import ScraperTargetResponse -from influxdb2.models.scraper_target_responses import ScraperTargetResponses -from influxdb2.models.secret_keys import SecretKeys -from influxdb2.models.secret_keys_response import SecretKeysResponse -from influxdb2.models.single_stat_view_properties import SingleStatViewProperties -from influxdb2.models.source import Source -from influxdb2.models.source_links import SourceLinks -from influxdb2.models.sources import Sources -from influxdb2.models.statement import Statement -from influxdb2.models.string_literal import StringLiteral -from influxdb2.models.table_view_properties import TableViewProperties -from influxdb2.models.task import Task -from influxdb2.models.task_create_request import TaskCreateRequest -from influxdb2.models.task_links import TaskLinks -from influxdb2.models.task_update_request import TaskUpdateRequest -from influxdb2.models.tasks import Tasks -from influxdb2.models.telegraf import Telegraf -from influxdb2.models.telegraf_plugin_input_cpu import TelegrafPluginInputCpu -from influxdb2.models.telegraf_plugin_input_disk import TelegrafPluginInputDisk -from influxdb2.models.telegraf_plugin_input_diskio import TelegrafPluginInputDiskio -from influxdb2.models.telegraf_plugin_input_docker import TelegrafPluginInputDocker -from influxdb2.models.telegraf_plugin_input_docker_config import TelegrafPluginInputDockerConfig -from influxdb2.models.telegraf_plugin_input_file import TelegrafPluginInputFile -from influxdb2.models.telegraf_plugin_input_file_config import TelegrafPluginInputFileConfig -from influxdb2.models.telegraf_plugin_input_kernel import TelegrafPluginInputKernel -from influxdb2.models.telegraf_plugin_input_kubernetes import TelegrafPluginInputKubernetes -from influxdb2.models.telegraf_plugin_input_kubernetes_config import TelegrafPluginInputKubernetesConfig -from influxdb2.models.telegraf_plugin_input_log_parser import TelegrafPluginInputLogParser -from influxdb2.models.telegraf_plugin_input_log_parser_config import TelegrafPluginInputLogParserConfig -from influxdb2.models.telegraf_plugin_input_mem import TelegrafPluginInputMem -from influxdb2.models.telegraf_plugin_input_net import TelegrafPluginInputNet -from influxdb2.models.telegraf_plugin_input_net_response import TelegrafPluginInputNetResponse -from influxdb2.models.telegraf_plugin_input_nginx import TelegrafPluginInputNginx -from influxdb2.models.telegraf_plugin_input_processes import TelegrafPluginInputProcesses -from influxdb2.models.telegraf_plugin_input_procstat import TelegrafPluginInputProcstat -from influxdb2.models.telegraf_plugin_input_procstat_config import TelegrafPluginInputProcstatConfig -from influxdb2.models.telegraf_plugin_input_prometheus import TelegrafPluginInputPrometheus -from influxdb2.models.telegraf_plugin_input_prometheus_config import TelegrafPluginInputPrometheusConfig -from influxdb2.models.telegraf_plugin_input_redis import TelegrafPluginInputRedis -from influxdb2.models.telegraf_plugin_input_redis_config import TelegrafPluginInputRedisConfig -from influxdb2.models.telegraf_plugin_input_swap import TelegrafPluginInputSwap -from influxdb2.models.telegraf_plugin_input_syslog import TelegrafPluginInputSyslog -from influxdb2.models.telegraf_plugin_input_syslog_config import TelegrafPluginInputSyslogConfig -from influxdb2.models.telegraf_plugin_input_system import TelegrafPluginInputSystem -from influxdb2.models.telegraf_plugin_input_tail import TelegrafPluginInputTail -from influxdb2.models.telegraf_plugin_output_file import TelegrafPluginOutputFile -from influxdb2.models.telegraf_plugin_output_file_config import TelegrafPluginOutputFileConfig -from influxdb2.models.telegraf_plugin_output_file_config_files import TelegrafPluginOutputFileConfigFiles -from influxdb2.models.telegraf_plugin_output_influx_dbv2 import TelegrafPluginOutputInfluxDBV2 -from influxdb2.models.telegraf_plugin_output_influx_dbv2_config import TelegrafPluginOutputInfluxDBV2Config -from influxdb2.models.telegraf_request import TelegrafRequest -from influxdb2.models.telegraf_request_agent import TelegrafRequestAgent -from influxdb2.models.telegraf_request_plugin import TelegrafRequestPlugin -from influxdb2.models.telegrafs import Telegrafs -from influxdb2.models.test_statement import TestStatement -from influxdb2.models.unary_expression import UnaryExpression -from influxdb2.models.unsigned_integer_literal import UnsignedIntegerLiteral -from influxdb2.models.user import User -from influxdb2.models.user_links import UserLinks -from influxdb2.models.users import Users -from influxdb2.models.users_links import UsersLinks -from influxdb2.models.variable import Variable -from influxdb2.models.variable_assignment import VariableAssignment -from influxdb2.models.variable_links import VariableLinks -from influxdb2.models.variables import Variables -from influxdb2.models.view import View -from influxdb2.models.view_links import ViewLinks -from influxdb2.models.view_properties import ViewProperties -from influxdb2.models.write_precision import WritePrecision -from influxdb2.models.xy_view_properties import XYViewProperties diff --git a/influxdb2/models/dashboard_query.py b/influxdb2/models/dashboard_query.py deleted file mode 100644 index 37b1057b..00000000 --- a/influxdb2/models/dashboard_query.py +++ /dev/null @@ -1,221 +0,0 @@ -# coding: utf-8 - -""" - Influx API Service - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: 0.1.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class DashboardQuery(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'label': 'str', - 'range': 'DashboardQueryRange', - 'query': 'str', - 'source': 'str', - 'query_config': 'QueryConfig' - } - - attribute_map = { - 'label': 'label', - 'range': 'range', - 'query': 'query', - 'source': 'source', - 'query_config': 'queryConfig' - } - - def __init__(self, label=None, range=None, query=None, source=None, query_config=None): # noqa: E501 - """DashboardQuery - a model defined in OpenAPI""" # noqa: E501 - - self._label = None - self._range = None - self._query = None - self._source = None - self._query_config = None - self.discriminator = None - - if label is not None: - self.label = label - if range is not None: - self.range = range - self.query = query - if source is not None: - self.source = source - if query_config is not None: - self.query_config = query_config - - @property - def label(self): - """Gets the label of this DashboardQuery. # noqa: E501 - - Optional Y-axis user-facing label # noqa: E501 - - :return: The label of this DashboardQuery. # noqa: E501 - :rtype: str - """ - return self._label - - @label.setter - def label(self, label): - """Sets the label of this DashboardQuery. - - Optional Y-axis user-facing label # noqa: E501 - - :param label: The label of this DashboardQuery. # noqa: E501 - :type: str - """ - - self._label = label - - @property - def range(self): - """Gets the range of this DashboardQuery. # noqa: E501 - - - :return: The range of this DashboardQuery. # noqa: E501 - :rtype: DashboardQueryRange - """ - return self._range - - @range.setter - def range(self, range): - """Sets the range of this DashboardQuery. - - - :param range: The range of this DashboardQuery. # noqa: E501 - :type: DashboardQueryRange - """ - - self._range = range - - @property - def query(self): - """Gets the query of this DashboardQuery. # noqa: E501 - - - :return: The query of this DashboardQuery. # noqa: E501 - :rtype: str - """ - return self._query - - @query.setter - def query(self, query): - """Sets the query of this DashboardQuery. - - - :param query: The query of this DashboardQuery. # noqa: E501 - :type: str - """ - if query is None: - raise ValueError("Invalid value for `query`, must not be `None`") # noqa: E501 - - self._query = query - - @property - def source(self): - """Gets the source of this DashboardQuery. # noqa: E501 - - Optional URI for data source for this query # noqa: E501 - - :return: The source of this DashboardQuery. # noqa: E501 - :rtype: str - """ - return self._source - - @source.setter - def source(self, source): - """Sets the source of this DashboardQuery. - - Optional URI for data source for this query # noqa: E501 - - :param source: The source of this DashboardQuery. # noqa: E501 - :type: str - """ - - self._source = source - - @property - def query_config(self): - """Gets the query_config of this DashboardQuery. # noqa: E501 - - - :return: The query_config of this DashboardQuery. # noqa: E501 - :rtype: QueryConfig - """ - return self._query_config - - @query_config.setter - def query_config(self, query_config): - """Sets the query_config of this DashboardQuery. - - - :param query_config: The query_config of this DashboardQuery. # noqa: E501 - :type: QueryConfig - """ - - self._query_config = query_config - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, DashboardQuery): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/influxdb2/models/query_config.py b/influxdb2/models/query_config.py deleted file mode 100644 index a9b4e59a..00000000 --- a/influxdb2/models/query_config.py +++ /dev/null @@ -1,353 +0,0 @@ -# coding: utf-8 - -""" - Influx API Service - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: 0.1.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class QueryConfig(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'database': 'str', - 'measurement': 'str', - 'retention_policy': 'str', - 'are_tags_accepted': 'bool', - 'raw_text': 'str', - 'tags': 'object', - 'group_by': 'QueryConfigGroupBy', - 'fields': 'list[Field]', - 'range': 'QueryConfigRange' - } - - attribute_map = { - 'id': 'id', - 'database': 'database', - 'measurement': 'measurement', - 'retention_policy': 'retentionPolicy', - 'are_tags_accepted': 'areTagsAccepted', - 'raw_text': 'rawText', - 'tags': 'tags', - 'group_by': 'groupBy', - 'fields': 'fields', - 'range': 'range' - } - - def __init__(self, id=None, database=None, measurement=None, retention_policy=None, are_tags_accepted=None, raw_text=None, tags=None, group_by=None, fields=None, range=None): # noqa: E501 - """QueryConfig - a model defined in OpenAPI""" # noqa: E501 - - self._id = None - self._database = None - self._measurement = None - self._retention_policy = None - self._are_tags_accepted = None - self._raw_text = None - self._tags = None - self._group_by = None - self._fields = None - self._range = None - self.discriminator = None - - if id is not None: - self.id = id - self.database = database - self.measurement = measurement - self.retention_policy = retention_policy - self.are_tags_accepted = are_tags_accepted - if raw_text is not None: - self.raw_text = raw_text - self.tags = tags - self.group_by = group_by - self.fields = fields - if range is not None: - self.range = range - - @property - def id(self): - """Gets the id of this QueryConfig. # noqa: E501 - - - :return: The id of this QueryConfig. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this QueryConfig. - - - :param id: The id of this QueryConfig. # noqa: E501 - :type: str - """ - - self._id = id - - @property - def database(self): - """Gets the database of this QueryConfig. # noqa: E501 - - - :return: The database of this QueryConfig. # noqa: E501 - :rtype: str - """ - return self._database - - @database.setter - def database(self, database): - """Sets the database of this QueryConfig. - - - :param database: The database of this QueryConfig. # noqa: E501 - :type: str - """ - if database is None: - raise ValueError("Invalid value for `database`, must not be `None`") # noqa: E501 - - self._database = database - - @property - def measurement(self): - """Gets the measurement of this QueryConfig. # noqa: E501 - - - :return: The measurement of this QueryConfig. # noqa: E501 - :rtype: str - """ - return self._measurement - - @measurement.setter - def measurement(self, measurement): - """Sets the measurement of this QueryConfig. - - - :param measurement: The measurement of this QueryConfig. # noqa: E501 - :type: str - """ - if measurement is None: - raise ValueError("Invalid value for `measurement`, must not be `None`") # noqa: E501 - - self._measurement = measurement - - @property - def retention_policy(self): - """Gets the retention_policy of this QueryConfig. # noqa: E501 - - - :return: The retention_policy of this QueryConfig. # noqa: E501 - :rtype: str - """ - return self._retention_policy - - @retention_policy.setter - def retention_policy(self, retention_policy): - """Sets the retention_policy of this QueryConfig. - - - :param retention_policy: The retention_policy of this QueryConfig. # noqa: E501 - :type: str - """ - if retention_policy is None: - raise ValueError("Invalid value for `retention_policy`, must not be `None`") # noqa: E501 - - self._retention_policy = retention_policy - - @property - def are_tags_accepted(self): - """Gets the are_tags_accepted of this QueryConfig. # noqa: E501 - - - :return: The are_tags_accepted of this QueryConfig. # noqa: E501 - :rtype: bool - """ - return self._are_tags_accepted - - @are_tags_accepted.setter - def are_tags_accepted(self, are_tags_accepted): - """Sets the are_tags_accepted of this QueryConfig. - - - :param are_tags_accepted: The are_tags_accepted of this QueryConfig. # noqa: E501 - :type: bool - """ - if are_tags_accepted is None: - raise ValueError("Invalid value for `are_tags_accepted`, must not be `None`") # noqa: E501 - - self._are_tags_accepted = are_tags_accepted - - @property - def raw_text(self): - """Gets the raw_text of this QueryConfig. # noqa: E501 - - - :return: The raw_text of this QueryConfig. # noqa: E501 - :rtype: str - """ - return self._raw_text - - @raw_text.setter - def raw_text(self, raw_text): - """Sets the raw_text of this QueryConfig. - - - :param raw_text: The raw_text of this QueryConfig. # noqa: E501 - :type: str - """ - - self._raw_text = raw_text - - @property - def tags(self): - """Gets the tags of this QueryConfig. # noqa: E501 - - - :return: The tags of this QueryConfig. # noqa: E501 - :rtype: object - """ - return self._tags - - @tags.setter - def tags(self, tags): - """Sets the tags of this QueryConfig. - - - :param tags: The tags of this QueryConfig. # noqa: E501 - :type: object - """ - if tags is None: - raise ValueError("Invalid value for `tags`, must not be `None`") # noqa: E501 - - self._tags = tags - - @property - def group_by(self): - """Gets the group_by of this QueryConfig. # noqa: E501 - - - :return: The group_by of this QueryConfig. # noqa: E501 - :rtype: QueryConfigGroupBy - """ - return self._group_by - - @group_by.setter - def group_by(self, group_by): - """Sets the group_by of this QueryConfig. - - - :param group_by: The group_by of this QueryConfig. # noqa: E501 - :type: QueryConfigGroupBy - """ - if group_by is None: - raise ValueError("Invalid value for `group_by`, must not be `None`") # noqa: E501 - - self._group_by = group_by - - @property - def fields(self): - """Gets the fields of this QueryConfig. # noqa: E501 - - - :return: The fields of this QueryConfig. # noqa: E501 - :rtype: list[Field] - """ - return self._fields - - @fields.setter - def fields(self, fields): - """Sets the fields of this QueryConfig. - - - :param fields: The fields of this QueryConfig. # noqa: E501 - :type: list[Field] - """ - if fields is None: - raise ValueError("Invalid value for `fields`, must not be `None`") # noqa: E501 - - self._fields = fields - - @property - def range(self): - """Gets the range of this QueryConfig. # noqa: E501 - - - :return: The range of this QueryConfig. # noqa: E501 - :rtype: QueryConfigRange - """ - return self._range - - @range.setter - def range(self, range): - """Sets the range of this QueryConfig. - - - :param range: The range of this QueryConfig. # noqa: E501 - :type: QueryConfigRange - """ - - self._range = range - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, QueryConfig): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/influxdb2/models/view_properties.py b/influxdb2/models/view_properties.py deleted file mode 100644 index f43fc67b..00000000 --- a/influxdb2/models/view_properties.py +++ /dev/null @@ -1,194 +0,0 @@ -# coding: utf-8 - -""" - Influx API Service - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: 0.1.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class ViewProperties(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'queries': 'list[DashboardQuery]', - 'colors': 'list[DashboardColor]', - 'note': 'str', - 'show_note_when_empty': 'bool' - } - - attribute_map = { - 'queries': 'queries', - 'colors': 'colors', - 'note': 'note', - 'show_note_when_empty': 'showNoteWhenEmpty' - } - - def __init__(self, queries=None, colors=None, note=None, show_note_when_empty=None): # noqa: E501 - """ViewProperties - a model defined in OpenAPI""" # noqa: E501 - - self._queries = None - self._colors = None - self._note = None - self._show_note_when_empty = None - self.discriminator = None - - if queries is not None: - self.queries = queries - if colors is not None: - self.colors = colors - if note is not None: - self.note = note - if show_note_when_empty is not None: - self.show_note_when_empty = show_note_when_empty - - @property - def queries(self): - """Gets the queries of this ViewProperties. # noqa: E501 - - - :return: The queries of this ViewProperties. # noqa: E501 - :rtype: list[DashboardQuery] - """ - return self._queries - - @queries.setter - def queries(self, queries): - """Sets the queries of this ViewProperties. - - - :param queries: The queries of this ViewProperties. # noqa: E501 - :type: list[DashboardQuery] - """ - - self._queries = queries - - @property - def colors(self): - """Gets the colors of this ViewProperties. # noqa: E501 - - Colors define color encoding of data into a visualization # noqa: E501 - - :return: The colors of this ViewProperties. # noqa: E501 - :rtype: list[DashboardColor] - """ - return self._colors - - @colors.setter - def colors(self, colors): - """Sets the colors of this ViewProperties. - - Colors define color encoding of data into a visualization # noqa: E501 - - :param colors: The colors of this ViewProperties. # noqa: E501 - :type: list[DashboardColor] - """ - - self._colors = colors - - @property - def note(self): - """Gets the note of this ViewProperties. # noqa: E501 - - - :return: The note of this ViewProperties. # noqa: E501 - :rtype: str - """ - return self._note - - @note.setter - def note(self, note): - """Sets the note of this ViewProperties. - - - :param note: The note of this ViewProperties. # noqa: E501 - :type: str - """ - - self._note = note - - @property - def show_note_when_empty(self): - """Gets the show_note_when_empty of this ViewProperties. # noqa: E501 - - if true, will display note when empty # noqa: E501 - - :return: The show_note_when_empty of this ViewProperties. # noqa: E501 - :rtype: bool - """ - return self._show_note_when_empty - - @show_note_when_empty.setter - def show_note_when_empty(self, show_note_when_empty): - """Sets the show_note_when_empty of this ViewProperties. - - if true, will display note when empty # noqa: E501 - - :param show_note_when_empty: The show_note_when_empty of this ViewProperties. # noqa: E501 - :type: bool - """ - - self._show_note_when_empty = show_note_when_empty - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ViewProperties): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/influxdb2/models/xy_view_properties.py b/influxdb2/models/xy_view_properties.py deleted file mode 100644 index 19c74559..00000000 --- a/influxdb2/models/xy_view_properties.py +++ /dev/null @@ -1,234 +0,0 @@ -# coding: utf-8 - -""" - Influx API Service - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: 0.1.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class XYViewProperties(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'axes': 'Axes', - 'shape': 'str', - 'type': 'str', - 'legend': 'Legend', - 'geom': 'str' - } - - attribute_map = { - 'axes': 'axes', - 'shape': 'shape', - 'type': 'type', - 'legend': 'legend', - 'geom': 'geom' - } - - def __init__(self, axes=None, shape=None, type=None, legend=None, geom=None): # noqa: E501 - """XYViewProperties - a model defined in OpenAPI""" # noqa: E501 - - self._axes = None - self._shape = None - self._type = None - self._legend = None - self._geom = None - self.discriminator = None - - if axes is not None: - self.axes = axes - if shape is not None: - self.shape = shape - if type is not None: - self.type = type - if legend is not None: - self.legend = legend - if geom is not None: - self.geom = geom - - @property - def axes(self): - """Gets the axes of this XYViewProperties. # noqa: E501 - - - :return: The axes of this XYViewProperties. # noqa: E501 - :rtype: Axes - """ - return self._axes - - @axes.setter - def axes(self, axes): - """Sets the axes of this XYViewProperties. - - - :param axes: The axes of this XYViewProperties. # noqa: E501 - :type: Axes - """ - - self._axes = axes - - @property - def shape(self): - """Gets the shape of this XYViewProperties. # noqa: E501 - - - :return: The shape of this XYViewProperties. # noqa: E501 - :rtype: str - """ - return self._shape - - @shape.setter - def shape(self, shape): - """Sets the shape of this XYViewProperties. - - - :param shape: The shape of this XYViewProperties. # noqa: E501 - :type: str - """ - allowed_values = ["chronograf-v2"] # noqa: E501 - if shape not in allowed_values: - raise ValueError( - "Invalid value for `shape` ({0}), must be one of {1}" # noqa: E501 - .format(shape, allowed_values) - ) - - self._shape = shape - - @property - def type(self): - """Gets the type of this XYViewProperties. # noqa: E501 - - - :return: The type of this XYViewProperties. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this XYViewProperties. - - - :param type: The type of this XYViewProperties. # noqa: E501 - :type: str - """ - allowed_values = ["xy"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) - - self._type = type - - @property - def legend(self): - """Gets the legend of this XYViewProperties. # noqa: E501 - - - :return: The legend of this XYViewProperties. # noqa: E501 - :rtype: Legend - """ - return self._legend - - @legend.setter - def legend(self, legend): - """Sets the legend of this XYViewProperties. - - - :param legend: The legend of this XYViewProperties. # noqa: E501 - :type: Legend - """ - - self._legend = legend - - @property - def geom(self): - """Gets the geom of this XYViewProperties. # noqa: E501 - - - :return: The geom of this XYViewProperties. # noqa: E501 - :rtype: str - """ - return self._geom - - @geom.setter - def geom(self, geom): - """Sets the geom of this XYViewProperties. - - - :param geom: The geom of this XYViewProperties. # noqa: E501 - :type: str - """ - allowed_values = ["line", "step", "stacked", "bar"] # noqa: E501 - if geom not in allowed_values: - raise ValueError( - "Invalid value for `geom` ({0}), must be one of {1}" # noqa: E501 - .format(geom, allowed_values) - ) - - self._geom = geom - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, XYViewProperties): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/influxdb2/service/__init__.py b/influxdb2/service/__init__.py new file mode 100644 index 00000000..d109302f --- /dev/null +++ b/influxdb2/service/__init__.py @@ -0,0 +1,30 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from influxdb2.service.authorizations_service import AuthorizationsService +from influxdb2.service.buckets_service import BucketsService +from influxdb2.service.cells_service import CellsService +from influxdb2.service.checks_service import ChecksService +from influxdb2.service.dashboards_service import DashboardsService +from influxdb2.service.health_service import HealthService +from influxdb2.service.labels_service import LabelsService +from influxdb2.service.notification_endpoints_service import NotificationEndpointsService +from influxdb2.service.notification_rules_service import NotificationRulesService +from influxdb2.service.operation_logs_service import OperationLogsService +from influxdb2.service.organizations_service import OrganizationsService +from influxdb2.service.query_service import QueryService +from influxdb2.service.ready_service import ReadyService +from influxdb2.service.scraper_targets_service import ScraperTargetsService +from influxdb2.service.secrets_service import SecretsService +from influxdb2.service.setup_service import SetupService +from influxdb2.service.sources_service import SourcesService +from influxdb2.service.tasks_service import TasksService +from influxdb2.service.telegrafs_service import TelegrafsService +from influxdb2.service.templates_service import TemplatesService +from influxdb2.service.users_service import UsersService +from influxdb2.service.variables_service import VariablesService +from influxdb2.service.views_service import ViewsService +from influxdb2.service.write_service import WriteService +from influxdb2.service.default_service import DefaultService diff --git a/influxdb2/api/authorizations_api.py b/influxdb2/service/authorizations_service.py similarity index 99% rename from influxdb2/api/authorizations_api.py rename to influxdb2/service/authorizations_service.py index 81ed8a15..cf4d3361 100644 --- a/influxdb2/api/authorizations_api.py +++ b/influxdb2/service/authorizations_service.py @@ -20,7 +20,7 @@ from influxdb2.api_client import ApiClient -class AuthorizationsApi(object): +class AuthorizationsService(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech diff --git a/influxdb2/api/buckets_api.py b/influxdb2/service/buckets_service.py similarity index 99% rename from influxdb2/api/buckets_api.py rename to influxdb2/service/buckets_service.py index 5a0915da..5235cd43 100644 --- a/influxdb2/api/buckets_api.py +++ b/influxdb2/service/buckets_service.py @@ -20,7 +20,7 @@ from influxdb2.api_client import ApiClient -class BucketsApi(object): +class BucketsService(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech diff --git a/influxdb2/api/cells_api.py b/influxdb2/service/cells_service.py similarity index 99% rename from influxdb2/api/cells_api.py rename to influxdb2/service/cells_service.py index e36ea27c..9082df52 100644 --- a/influxdb2/api/cells_api.py +++ b/influxdb2/service/cells_service.py @@ -20,7 +20,7 @@ from influxdb2.api_client import ApiClient -class CellsApi(object): +class CellsService(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech diff --git a/influxdb2/service/checks_service.py b/influxdb2/service/checks_service.py new file mode 100644 index 00000000..2be919f0 --- /dev/null +++ b/influxdb2/service/checks_service.py @@ -0,0 +1,545 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from influxdb2.api_client import ApiClient + + +class ChecksService(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_check(self, check, **kwargs): # noqa: E501 + """Add new check # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_check(check, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Check check: check to create (required) + :return: Check + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_check_with_http_info(check, **kwargs) # noqa: E501 + else: + (data) = self.create_check_with_http_info(check, **kwargs) # noqa: E501 + return data + + def create_check_with_http_info(self, check, **kwargs): # noqa: E501 + """Add new check # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_check_with_http_info(check, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Check check: check to create (required) + :return: Check + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['check'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_check" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'check' is set + if ('check' not in local_var_params or + local_var_params['check'] is None): + raise ValueError("Missing the required parameter `check` when calling `create_check`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'check' in local_var_params: + body_params = local_var_params['check'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/checks', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Check', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_checks_id(self, check_id, **kwargs): # noqa: E501 + """Delete a check # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_checks_id(check_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str check_id: ID of check (required) + :param str zap_trace_span: OpenTracing span context + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_checks_id_with_http_info(check_id, **kwargs) # noqa: E501 + else: + (data) = self.delete_checks_id_with_http_info(check_id, **kwargs) # noqa: E501 + return data + + def delete_checks_id_with_http_info(self, check_id, **kwargs): # noqa: E501 + """Delete a check # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_checks_id_with_http_info(check_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str check_id: ID of check (required) + :param str zap_trace_span: OpenTracing span context + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['check_id', 'zap_trace_span'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_checks_id" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'check_id' is set + if ('check_id' not in local_var_params or + local_var_params['check_id'] is None): + raise ValueError("Missing the required parameter `check_id` when calling `delete_checks_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'check_id' in local_var_params: + path_params['checkID'] = local_var_params['check_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'zap_trace_span' in local_var_params: + header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/checks/{checkID}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_checks(self, org_id, **kwargs): # noqa: E501 + """Get all checks # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_checks(org_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str org_id: only show checks belonging to specified organization (required) + :param int offset: + :param int limit: + :return: Checks + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_checks_with_http_info(org_id, **kwargs) # noqa: E501 + else: + (data) = self.get_checks_with_http_info(org_id, **kwargs) # noqa: E501 + return data + + def get_checks_with_http_info(self, org_id, **kwargs): # noqa: E501 + """Get all checks # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_checks_with_http_info(org_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str org_id: only show checks belonging to specified organization (required) + :param int offset: + :param int limit: + :return: Checks + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['org_id', 'offset', 'limit'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_checks" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'org_id' is set + if ('org_id' not in local_var_params or + local_var_params['org_id'] is None): + raise ValueError("Missing the required parameter `org_id` when calling `get_checks`") # noqa: E501 + + if 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 + raise ValueError("Invalid value for parameter `offset` when calling `get_checks`, must be a value greater than or equal to `0`") # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] > 100: # noqa: E501 + raise ValueError("Invalid value for parameter `limit` when calling `get_checks`, must be a value less than or equal to `100`") # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 + raise ValueError("Invalid value for parameter `limit` when calling `get_checks`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'offset' in local_var_params: + query_params.append(('offset', local_var_params['offset'])) # noqa: E501 + if 'limit' in local_var_params: + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'org_id' in local_var_params: + query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/checks', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Checks', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_checks_id(self, check_id, **kwargs): # noqa: E501 + """Get an check # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_checks_id(check_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str check_id: ID of check (required) + :param str zap_trace_span: OpenTracing span context + :return: Check + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_checks_id_with_http_info(check_id, **kwargs) # noqa: E501 + else: + (data) = self.get_checks_id_with_http_info(check_id, **kwargs) # noqa: E501 + return data + + def get_checks_id_with_http_info(self, check_id, **kwargs): # noqa: E501 + """Get an check # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_checks_id_with_http_info(check_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str check_id: ID of check (required) + :param str zap_trace_span: OpenTracing span context + :return: Check + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['check_id', 'zap_trace_span'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_checks_id" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'check_id' is set + if ('check_id' not in local_var_params or + local_var_params['check_id'] is None): + raise ValueError("Missing the required parameter `check_id` when calling `get_checks_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'check_id' in local_var_params: + path_params['checkID'] = local_var_params['check_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'zap_trace_span' in local_var_params: + header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/checks/{checkID}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Check', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def patch_checks_id(self, check_id, check, **kwargs): # noqa: E501 + """Update a check # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.patch_checks_id(check_id, check, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str check_id: ID of check (required) + :param Check check: check update to apply (required) + :param str zap_trace_span: OpenTracing span context + :return: Check + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.patch_checks_id_with_http_info(check_id, check, **kwargs) # noqa: E501 + else: + (data) = self.patch_checks_id_with_http_info(check_id, check, **kwargs) # noqa: E501 + return data + + def patch_checks_id_with_http_info(self, check_id, check, **kwargs): # noqa: E501 + """Update a check # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.patch_checks_id_with_http_info(check_id, check, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str check_id: ID of check (required) + :param Check check: check update to apply (required) + :param str zap_trace_span: OpenTracing span context + :return: Check + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['check_id', 'check', 'zap_trace_span'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_checks_id" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'check_id' is set + if ('check_id' not in local_var_params or + local_var_params['check_id'] is None): + raise ValueError("Missing the required parameter `check_id` when calling `patch_checks_id`") # noqa: E501 + # verify the required parameter 'check' is set + if ('check' not in local_var_params or + local_var_params['check'] is None): + raise ValueError("Missing the required parameter `check` when calling `patch_checks_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'check_id' in local_var_params: + path_params['checkID'] = local_var_params['check_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'zap_trace_span' in local_var_params: + header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'check' in local_var_params: + body_params = local_var_params['check'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/checks/{checkID}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Check', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/influxdb2/api/dashboards_api.py b/influxdb2/service/dashboards_service.py similarity index 99% rename from influxdb2/api/dashboards_api.py rename to influxdb2/service/dashboards_service.py index 85954b87..73605517 100644 --- a/influxdb2/api/dashboards_api.py +++ b/influxdb2/service/dashboards_service.py @@ -20,7 +20,7 @@ from influxdb2.api_client import ApiClient -class DashboardsApi(object): +class DashboardsService(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech diff --git a/influxdb2/api/default_api.py b/influxdb2/service/default_service.py similarity index 99% rename from influxdb2/api/default_api.py rename to influxdb2/service/default_service.py index 1cb6249e..a18ab0c3 100644 --- a/influxdb2/api/default_api.py +++ b/influxdb2/service/default_service.py @@ -20,7 +20,7 @@ from influxdb2.api_client import ApiClient -class DefaultApi(object): +class DefaultService(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech diff --git a/influxdb2/api/health_api.py b/influxdb2/service/health_service.py similarity index 96% rename from influxdb2/api/health_api.py rename to influxdb2/service/health_service.py index e436563f..eb6d4a35 100644 --- a/influxdb2/api/health_api.py +++ b/influxdb2/service/health_service.py @@ -20,7 +20,7 @@ from influxdb2.api_client import ApiClient -class HealthApi(object): +class HealthService(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech @@ -42,7 +42,7 @@ def get_health(self, **kwargs): # noqa: E501 :param async_req bool :param str zap_trace_span: OpenTracing span context - :return: Check + :return: HealthCheck If the method is called asynchronously, returns the request thread. """ @@ -63,7 +63,7 @@ def get_health_with_http_info(self, **kwargs): # noqa: E501 :param async_req bool :param str zap_trace_span: OpenTracing span context - :return: Check + :return: HealthCheck If the method is called asynchronously, returns the request thread. """ @@ -114,7 +114,7 @@ def get_health_with_http_info(self, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='Check', # noqa: E501 + response_type='HealthCheck', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 diff --git a/influxdb2/api/labels_api.py b/influxdb2/service/labels_service.py similarity index 99% rename from influxdb2/api/labels_api.py rename to influxdb2/service/labels_service.py index 27799361..d7d10d3d 100644 --- a/influxdb2/api/labels_api.py +++ b/influxdb2/service/labels_service.py @@ -20,7 +20,7 @@ from influxdb2.api_client import ApiClient -class LabelsApi(object): +class LabelsService(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech diff --git a/influxdb2/service/notification_endpoints_service.py b/influxdb2/service/notification_endpoints_service.py new file mode 100644 index 00000000..2c091b16 --- /dev/null +++ b/influxdb2/service/notification_endpoints_service.py @@ -0,0 +1,545 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from influxdb2.api_client import ApiClient + + +class NotificationEndpointsService(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_notification_endpoint(self, notification_endpoint, **kwargs): # noqa: E501 + """Add new notification endpoint # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_notification_endpoint(notification_endpoint, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param NotificationEndpoint notification_endpoint: notificationEndpoint to create (required) + :return: NotificationRule + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_notification_endpoint_with_http_info(notification_endpoint, **kwargs) # noqa: E501 + else: + (data) = self.create_notification_endpoint_with_http_info(notification_endpoint, **kwargs) # noqa: E501 + return data + + def create_notification_endpoint_with_http_info(self, notification_endpoint, **kwargs): # noqa: E501 + """Add new notification endpoint # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_notification_endpoint_with_http_info(notification_endpoint, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param NotificationEndpoint notification_endpoint: notificationEndpoint to create (required) + :return: NotificationRule + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['notification_endpoint'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_notification_endpoint" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'notification_endpoint' is set + if ('notification_endpoint' not in local_var_params or + local_var_params['notification_endpoint'] is None): + raise ValueError("Missing the required parameter `notification_endpoint` when calling `create_notification_endpoint`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'notification_endpoint' in local_var_params: + body_params = local_var_params['notification_endpoint'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/notificationEndpoints', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='NotificationRule', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_notification_endpoints_id(self, endpoint_id, **kwargs): # noqa: E501 + """Delete a notification endpoint # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_notification_endpoints_id(endpoint_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str endpoint_id: ID of notification endpoint (required) + :param str zap_trace_span: OpenTracing span context + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_notification_endpoints_id_with_http_info(endpoint_id, **kwargs) # noqa: E501 + else: + (data) = self.delete_notification_endpoints_id_with_http_info(endpoint_id, **kwargs) # noqa: E501 + return data + + def delete_notification_endpoints_id_with_http_info(self, endpoint_id, **kwargs): # noqa: E501 + """Delete a notification endpoint # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_notification_endpoints_id_with_http_info(endpoint_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str endpoint_id: ID of notification endpoint (required) + :param str zap_trace_span: OpenTracing span context + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['endpoint_id', 'zap_trace_span'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_notification_endpoints_id" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'endpoint_id' is set + if ('endpoint_id' not in local_var_params or + local_var_params['endpoint_id'] is None): + raise ValueError("Missing the required parameter `endpoint_id` when calling `delete_notification_endpoints_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'endpoint_id' in local_var_params: + path_params['endpointID'] = local_var_params['endpoint_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'zap_trace_span' in local_var_params: + header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/notificationEndpoints/{endpointID}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_notification_endpoints(self, org_id, **kwargs): # noqa: E501 + """Get all notification endpoints # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_notification_endpoints(org_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str org_id: only show notification endpoints belonging to specified organization (required) + :param int offset: + :param int limit: + :return: NotificationEndpoints + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_notification_endpoints_with_http_info(org_id, **kwargs) # noqa: E501 + else: + (data) = self.get_notification_endpoints_with_http_info(org_id, **kwargs) # noqa: E501 + return data + + def get_notification_endpoints_with_http_info(self, org_id, **kwargs): # noqa: E501 + """Get all notification endpoints # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_notification_endpoints_with_http_info(org_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str org_id: only show notification endpoints belonging to specified organization (required) + :param int offset: + :param int limit: + :return: NotificationEndpoints + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['org_id', 'offset', 'limit'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_notification_endpoints" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'org_id' is set + if ('org_id' not in local_var_params or + local_var_params['org_id'] is None): + raise ValueError("Missing the required parameter `org_id` when calling `get_notification_endpoints`") # noqa: E501 + + if 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 + raise ValueError("Invalid value for parameter `offset` when calling `get_notification_endpoints`, must be a value greater than or equal to `0`") # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] > 100: # noqa: E501 + raise ValueError("Invalid value for parameter `limit` when calling `get_notification_endpoints`, must be a value less than or equal to `100`") # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 + raise ValueError("Invalid value for parameter `limit` when calling `get_notification_endpoints`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'offset' in local_var_params: + query_params.append(('offset', local_var_params['offset'])) # noqa: E501 + if 'limit' in local_var_params: + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'org_id' in local_var_params: + query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/notificationEndpoints', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='NotificationEndpoints', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_notification_endpoints_id(self, endpoint_id, **kwargs): # noqa: E501 + """Get a notification endpoint # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_notification_endpoints_id(endpoint_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str endpoint_id: ID of notification endpoint (required) + :param str zap_trace_span: OpenTracing span context + :return: NotificationEndpoint + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_notification_endpoints_id_with_http_info(endpoint_id, **kwargs) # noqa: E501 + else: + (data) = self.get_notification_endpoints_id_with_http_info(endpoint_id, **kwargs) # noqa: E501 + return data + + def get_notification_endpoints_id_with_http_info(self, endpoint_id, **kwargs): # noqa: E501 + """Get a notification endpoint # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_notification_endpoints_id_with_http_info(endpoint_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str endpoint_id: ID of notification endpoint (required) + :param str zap_trace_span: OpenTracing span context + :return: NotificationEndpoint + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['endpoint_id', 'zap_trace_span'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_notification_endpoints_id" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'endpoint_id' is set + if ('endpoint_id' not in local_var_params or + local_var_params['endpoint_id'] is None): + raise ValueError("Missing the required parameter `endpoint_id` when calling `get_notification_endpoints_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'endpoint_id' in local_var_params: + path_params['endpointID'] = local_var_params['endpoint_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'zap_trace_span' in local_var_params: + header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/notificationEndpoints/{endpointID}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='NotificationEndpoint', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def patch_notification_endpoints_id(self, endpoint_id, notification_endpoint, **kwargs): # noqa: E501 + """Update a notification endpoint # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.patch_notification_endpoints_id(endpoint_id, notification_endpoint, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str endpoint_id: ID of notification endpoint (required) + :param NotificationEndpoint notification_endpoint: check update to apply (required) + :param str zap_trace_span: OpenTracing span context + :return: NotificationEndpoint + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.patch_notification_endpoints_id_with_http_info(endpoint_id, notification_endpoint, **kwargs) # noqa: E501 + else: + (data) = self.patch_notification_endpoints_id_with_http_info(endpoint_id, notification_endpoint, **kwargs) # noqa: E501 + return data + + def patch_notification_endpoints_id_with_http_info(self, endpoint_id, notification_endpoint, **kwargs): # noqa: E501 + """Update a notification endpoint # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.patch_notification_endpoints_id_with_http_info(endpoint_id, notification_endpoint, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str endpoint_id: ID of notification endpoint (required) + :param NotificationEndpoint notification_endpoint: check update to apply (required) + :param str zap_trace_span: OpenTracing span context + :return: NotificationEndpoint + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['endpoint_id', 'notification_endpoint', 'zap_trace_span'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_notification_endpoints_id" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'endpoint_id' is set + if ('endpoint_id' not in local_var_params or + local_var_params['endpoint_id'] is None): + raise ValueError("Missing the required parameter `endpoint_id` when calling `patch_notification_endpoints_id`") # noqa: E501 + # verify the required parameter 'notification_endpoint' is set + if ('notification_endpoint' not in local_var_params or + local_var_params['notification_endpoint'] is None): + raise ValueError("Missing the required parameter `notification_endpoint` when calling `patch_notification_endpoints_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'endpoint_id' in local_var_params: + path_params['endpointID'] = local_var_params['endpoint_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'zap_trace_span' in local_var_params: + header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'notification_endpoint' in local_var_params: + body_params = local_var_params['notification_endpoint'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/notificationEndpoints/{endpointID}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='NotificationEndpoint', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/influxdb2/service/notification_rules_service.py b/influxdb2/service/notification_rules_service.py new file mode 100644 index 00000000..81308a8a --- /dev/null +++ b/influxdb2/service/notification_rules_service.py @@ -0,0 +1,659 @@ +# coding: utf-8 + +""" + Influx API Service + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + OpenAPI spec version: 0.1.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from influxdb2.api_client import ApiClient + + +class NotificationRulesService(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_notification_rule(self, notification_rule, **kwargs): # noqa: E501 + """Add new notification rule # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_notification_rule(notification_rule, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param NotificationRule notification_rule: notificationRule to create (required) + :return: NotificationRule + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_notification_rule_with_http_info(notification_rule, **kwargs) # noqa: E501 + else: + (data) = self.create_notification_rule_with_http_info(notification_rule, **kwargs) # noqa: E501 + return data + + def create_notification_rule_with_http_info(self, notification_rule, **kwargs): # noqa: E501 + """Add new notification rule # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_notification_rule_with_http_info(notification_rule, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param NotificationRule notification_rule: notificationRule to create (required) + :return: NotificationRule + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['notification_rule'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_notification_rule" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'notification_rule' is set + if ('notification_rule' not in local_var_params or + local_var_params['notification_rule'] is None): + raise ValueError("Missing the required parameter `notification_rule` when calling `create_notification_rule`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'notification_rule' in local_var_params: + body_params = local_var_params['notification_rule'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/notificationRules', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='NotificationRule', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_notification_rules_id(self, rule_id, **kwargs): # noqa: E501 + """Delete a notification rule # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_notification_rules_id(rule_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str rule_id: ID of notification rule (required) + :param str zap_trace_span: OpenTracing span context + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_notification_rules_id_with_http_info(rule_id, **kwargs) # noqa: E501 + else: + (data) = self.delete_notification_rules_id_with_http_info(rule_id, **kwargs) # noqa: E501 + return data + + def delete_notification_rules_id_with_http_info(self, rule_id, **kwargs): # noqa: E501 + """Delete a notification rule # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_notification_rules_id_with_http_info(rule_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str rule_id: ID of notification rule (required) + :param str zap_trace_span: OpenTracing span context + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['rule_id', 'zap_trace_span'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_notification_rules_id" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'rule_id' is set + if ('rule_id' not in local_var_params or + local_var_params['rule_id'] is None): + raise ValueError("Missing the required parameter `rule_id` when calling `delete_notification_rules_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'rule_id' in local_var_params: + path_params['ruleID'] = local_var_params['rule_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'zap_trace_span' in local_var_params: + header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/notificationRules/{ruleID}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_notification_rules(self, org_id, **kwargs): # noqa: E501 + """Get all notification rules # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_notification_rules(org_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str org_id: only show notification rules belonging to specified organization (required) + :param int offset: + :param int limit: + :param str check_id: only show notifications that belong to the specified check + :return: NotificationRules + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_notification_rules_with_http_info(org_id, **kwargs) # noqa: E501 + else: + (data) = self.get_notification_rules_with_http_info(org_id, **kwargs) # noqa: E501 + return data + + def get_notification_rules_with_http_info(self, org_id, **kwargs): # noqa: E501 + """Get all notification rules # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_notification_rules_with_http_info(org_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str org_id: only show notification rules belonging to specified organization (required) + :param int offset: + :param int limit: + :param str check_id: only show notifications that belong to the specified check + :return: NotificationRules + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['org_id', 'offset', 'limit', 'check_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_notification_rules" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'org_id' is set + if ('org_id' not in local_var_params or + local_var_params['org_id'] is None): + raise ValueError("Missing the required parameter `org_id` when calling `get_notification_rules`") # noqa: E501 + + if 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 + raise ValueError("Invalid value for parameter `offset` when calling `get_notification_rules`, must be a value greater than or equal to `0`") # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] > 100: # noqa: E501 + raise ValueError("Invalid value for parameter `limit` when calling `get_notification_rules`, must be a value less than or equal to `100`") # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 + raise ValueError("Invalid value for parameter `limit` when calling `get_notification_rules`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'offset' in local_var_params: + query_params.append(('offset', local_var_params['offset'])) # noqa: E501 + if 'limit' in local_var_params: + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'org_id' in local_var_params: + query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 + if 'check_id' in local_var_params: + query_params.append(('checkID', local_var_params['check_id'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/notificationRules', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='NotificationRules', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_notification_rules_id(self, rule_id, **kwargs): # noqa: E501 + """Get a notification rule # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_notification_rules_id(rule_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str rule_id: ID of notification rule (required) + :param str zap_trace_span: OpenTracing span context + :return: NotificationRule + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_notification_rules_id_with_http_info(rule_id, **kwargs) # noqa: E501 + else: + (data) = self.get_notification_rules_id_with_http_info(rule_id, **kwargs) # noqa: E501 + return data + + def get_notification_rules_id_with_http_info(self, rule_id, **kwargs): # noqa: E501 + """Get a notification rule # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_notification_rules_id_with_http_info(rule_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str rule_id: ID of notification rule (required) + :param str zap_trace_span: OpenTracing span context + :return: NotificationRule + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['rule_id', 'zap_trace_span'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_notification_rules_id" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'rule_id' is set + if ('rule_id' not in local_var_params or + local_var_params['rule_id'] is None): + raise ValueError("Missing the required parameter `rule_id` when calling `get_notification_rules_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'rule_id' in local_var_params: + path_params['ruleID'] = local_var_params['rule_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'zap_trace_span' in local_var_params: + header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/notificationRules/{ruleID}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='NotificationRule', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def patch_notification_rules_id(self, rule_id, notification_rule_update, **kwargs): # noqa: E501 + """Update a notification rule # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.patch_notification_rules_id(rule_id, notification_rule_update, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str rule_id: ID of notification rule (required) + :param NotificationRuleUpdate notification_rule_update: notification rule update to apply (required) + :param str zap_trace_span: OpenTracing span context + :return: NotificationRule + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.patch_notification_rules_id_with_http_info(rule_id, notification_rule_update, **kwargs) # noqa: E501 + else: + (data) = self.patch_notification_rules_id_with_http_info(rule_id, notification_rule_update, **kwargs) # noqa: E501 + return data + + def patch_notification_rules_id_with_http_info(self, rule_id, notification_rule_update, **kwargs): # noqa: E501 + """Update a notification rule # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.patch_notification_rules_id_with_http_info(rule_id, notification_rule_update, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str rule_id: ID of notification rule (required) + :param NotificationRuleUpdate notification_rule_update: notification rule update to apply (required) + :param str zap_trace_span: OpenTracing span context + :return: NotificationRule + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['rule_id', 'notification_rule_update', 'zap_trace_span'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_notification_rules_id" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'rule_id' is set + if ('rule_id' not in local_var_params or + local_var_params['rule_id'] is None): + raise ValueError("Missing the required parameter `rule_id` when calling `patch_notification_rules_id`") # noqa: E501 + # verify the required parameter 'notification_rule_update' is set + if ('notification_rule_update' not in local_var_params or + local_var_params['notification_rule_update'] is None): + raise ValueError("Missing the required parameter `notification_rule_update` when calling `patch_notification_rules_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'rule_id' in local_var_params: + path_params['ruleID'] = local_var_params['rule_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'zap_trace_span' in local_var_params: + header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'notification_rule_update' in local_var_params: + body_params = local_var_params['notification_rule_update'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/notificationRules/{ruleID}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='NotificationRule', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def put_notification_rules_id(self, rule_id, notification_rule, **kwargs): # noqa: E501 + """Update a notification rule # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.put_notification_rules_id(rule_id, notification_rule, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str rule_id: ID of notification rule (required) + :param NotificationRule notification_rule: notification rule update to apply (required) + :param str zap_trace_span: OpenTracing span context + :return: NotificationRule + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.put_notification_rules_id_with_http_info(rule_id, notification_rule, **kwargs) # noqa: E501 + else: + (data) = self.put_notification_rules_id_with_http_info(rule_id, notification_rule, **kwargs) # noqa: E501 + return data + + def put_notification_rules_id_with_http_info(self, rule_id, notification_rule, **kwargs): # noqa: E501 + """Update a notification rule # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.put_notification_rules_id_with_http_info(rule_id, notification_rule, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str rule_id: ID of notification rule (required) + :param NotificationRule notification_rule: notification rule update to apply (required) + :param str zap_trace_span: OpenTracing span context + :return: NotificationRule + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['rule_id', 'notification_rule', 'zap_trace_span'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method put_notification_rules_id" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'rule_id' is set + if ('rule_id' not in local_var_params or + local_var_params['rule_id'] is None): + raise ValueError("Missing the required parameter `rule_id` when calling `put_notification_rules_id`") # noqa: E501 + # verify the required parameter 'notification_rule' is set + if ('notification_rule' not in local_var_params or + local_var_params['notification_rule'] is None): + raise ValueError("Missing the required parameter `notification_rule` when calling `put_notification_rules_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'rule_id' in local_var_params: + path_params['ruleID'] = local_var_params['rule_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'zap_trace_span' in local_var_params: + header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'notification_rule' in local_var_params: + body_params = local_var_params['notification_rule'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/notificationRules/{ruleID}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='NotificationRule', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/influxdb2/api/operation_logs_api.py b/influxdb2/service/operation_logs_service.py similarity index 99% rename from influxdb2/api/operation_logs_api.py rename to influxdb2/service/operation_logs_service.py index 850844f6..d481ec46 100644 --- a/influxdb2/api/operation_logs_api.py +++ b/influxdb2/service/operation_logs_service.py @@ -20,7 +20,7 @@ from influxdb2.api_client import ApiClient -class OperationLogsApi(object): +class OperationLogsService(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech diff --git a/influxdb2/api/organizations_api.py b/influxdb2/service/organizations_service.py similarity index 99% rename from influxdb2/api/organizations_api.py rename to influxdb2/service/organizations_service.py index 7adf0e9f..2794a4a7 100644 --- a/influxdb2/api/organizations_api.py +++ b/influxdb2/service/organizations_service.py @@ -20,7 +20,7 @@ from influxdb2.api_client import ApiClient -class OrganizationsApi(object): +class OrganizationsService(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech diff --git a/influxdb2/api/query_api.py b/influxdb2/service/query_service.py similarity index 97% rename from influxdb2/api/query_api.py rename to influxdb2/service/query_service.py index e47e3ef6..d4ca95ed 100644 --- a/influxdb2/api/query_api.py +++ b/influxdb2/service/query_service.py @@ -20,7 +20,7 @@ from influxdb2.api_client import ApiClient -class QueryApi(object): +class QueryService(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech @@ -230,6 +230,7 @@ def post_query(self, **kwargs): # noqa: E501 :param async_req bool :param str zap_trace_span: OpenTracing span context + :param str accept_encoding: The Accept-Encoding request HTTP header advertises which content encoding, usually a compression algorithm, the client is able to understand. :param str content_type: :param str org: specifies the name of the organization executing the query; if both orgID and org are specified, orgID takes precedence. :param str org_id: specifies the ID of the organization executing the query; if both orgID and org are specified, orgID takes precedence. @@ -255,6 +256,7 @@ def post_query_with_http_info(self, **kwargs): # noqa: E501 :param async_req bool :param str zap_trace_span: OpenTracing span context + :param str accept_encoding: The Accept-Encoding request HTTP header advertises which content encoding, usually a compression algorithm, the client is able to understand. :param str content_type: :param str org: specifies the name of the organization executing the query; if both orgID and org are specified, orgID takes precedence. :param str org_id: specifies the ID of the organization executing the query; if both orgID and org are specified, orgID takes precedence. @@ -266,7 +268,7 @@ def post_query_with_http_info(self, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['zap_trace_span', 'content_type', 'org', 'org_id', 'query'] # noqa: E501 + all_params = ['zap_trace_span', 'accept_encoding', 'content_type', 'org', 'org_id', 'query'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -294,6 +296,8 @@ def post_query_with_http_info(self, **kwargs): # noqa: E501 header_params = {} if 'zap_trace_span' in local_var_params: header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 + if 'accept_encoding' in local_var_params: + header_params['Accept-Encoding'] = local_var_params['accept_encoding'] # noqa: E501 if 'content_type' in local_var_params: header_params['Content-Type'] = local_var_params['content_type'] # noqa: E501 diff --git a/influxdb2/api/ready_api.py b/influxdb2/service/ready_service.py similarity index 99% rename from influxdb2/api/ready_api.py rename to influxdb2/service/ready_service.py index d8bb7ef7..4a2594a0 100644 --- a/influxdb2/api/ready_api.py +++ b/influxdb2/service/ready_service.py @@ -20,7 +20,7 @@ from influxdb2.api_client import ApiClient -class ReadyApi(object): +class ReadyService(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech diff --git a/influxdb2/api/scraper_targets_api.py b/influxdb2/service/scraper_targets_service.py similarity index 99% rename from influxdb2/api/scraper_targets_api.py rename to influxdb2/service/scraper_targets_service.py index 382605f3..0e4d4d54 100644 --- a/influxdb2/api/scraper_targets_api.py +++ b/influxdb2/service/scraper_targets_service.py @@ -20,7 +20,7 @@ from influxdb2.api_client import ApiClient -class ScraperTargetsApi(object): +class ScraperTargetsService(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech diff --git a/influxdb2/api/secrets_api.py b/influxdb2/service/secrets_service.py similarity index 99% rename from influxdb2/api/secrets_api.py rename to influxdb2/service/secrets_service.py index b8198db1..d0983a7d 100644 --- a/influxdb2/api/secrets_api.py +++ b/influxdb2/service/secrets_service.py @@ -20,7 +20,7 @@ from influxdb2.api_client import ApiClient -class SecretsApi(object): +class SecretsService(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech diff --git a/influxdb2/api/setup_api.py b/influxdb2/service/setup_service.py similarity index 99% rename from influxdb2/api/setup_api.py rename to influxdb2/service/setup_service.py index bd6610c9..6ea1ee2a 100644 --- a/influxdb2/api/setup_api.py +++ b/influxdb2/service/setup_service.py @@ -20,7 +20,7 @@ from influxdb2.api_client import ApiClient -class SetupApi(object): +class SetupService(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech diff --git a/influxdb2/api/sources_api.py b/influxdb2/service/sources_service.py similarity index 99% rename from influxdb2/api/sources_api.py rename to influxdb2/service/sources_service.py index d8e01ec1..2b45d177 100644 --- a/influxdb2/api/sources_api.py +++ b/influxdb2/service/sources_service.py @@ -20,7 +20,7 @@ from influxdb2.api_client import ApiClient -class SourcesApi(object): +class SourcesService(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech @@ -435,7 +435,7 @@ def get_sources_id_health(self, source_id, **kwargs): # noqa: E501 :param async_req bool :param str source_id: ID of the source (required) :param str zap_trace_span: OpenTracing span context - :return: Check + :return: HealthCheck If the method is called asynchronously, returns the request thread. """ @@ -457,7 +457,7 @@ def get_sources_id_health_with_http_info(self, source_id, **kwargs): # noqa: E5 :param async_req bool :param str source_id: ID of the source (required) :param str zap_trace_span: OpenTracing span context - :return: Check + :return: HealthCheck If the method is called asynchronously, returns the request thread. """ @@ -514,7 +514,7 @@ def get_sources_id_health_with_http_info(self, source_id, **kwargs): # noqa: E5 body=body_params, post_params=form_params, files=local_var_files, - response_type='Check', # noqa: E501 + response_type='HealthCheck', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 diff --git a/influxdb2/api/tasks_api.py b/influxdb2/service/tasks_service.py similarity index 98% rename from influxdb2/api/tasks_api.py rename to influxdb2/service/tasks_service.py index de5732af..0e895b54 100644 --- a/influxdb2/api/tasks_api.py +++ b/influxdb2/service/tasks_service.py @@ -20,7 +20,7 @@ from influxdb2.api_client import ApiClient -class TasksApi(object): +class TasksService(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech @@ -450,6 +450,112 @@ def delete_tasks_id_owners_id_with_http_info(self, user_id, task_id, **kwargs): _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) + def delete_tasks_id_runs_id(self, task_id, run_id, **kwargs): # noqa: E501 + """Cancel a single running task # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_tasks_id_runs_id(task_id, run_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_id: task ID (required) + :param str run_id: run ID (required) + :param str zap_trace_span: OpenTracing span context + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_tasks_id_runs_id_with_http_info(task_id, run_id, **kwargs) # noqa: E501 + else: + (data) = self.delete_tasks_id_runs_id_with_http_info(task_id, run_id, **kwargs) # noqa: E501 + return data + + def delete_tasks_id_runs_id_with_http_info(self, task_id, run_id, **kwargs): # noqa: E501 + """Cancel a single running task # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_tasks_id_runs_id_with_http_info(task_id, run_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_id: task ID (required) + :param str run_id: run ID (required) + :param str zap_trace_span: OpenTracing span context + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['task_id', 'run_id', 'zap_trace_span'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_tasks_id_runs_id" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'task_id' is set + if ('task_id' not in local_var_params or + local_var_params['task_id'] is None): + raise ValueError("Missing the required parameter `task_id` when calling `delete_tasks_id_runs_id`") # noqa: E501 + # verify the required parameter 'run_id' is set + if ('run_id' not in local_var_params or + local_var_params['run_id'] is None): + raise ValueError("Missing the required parameter `run_id` when calling `delete_tasks_id_runs_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_id' in local_var_params: + path_params['taskID'] = local_var_params['task_id'] # noqa: E501 + if 'run_id' in local_var_params: + path_params['runID'] = local_var_params['run_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'zap_trace_span' in local_var_params: + header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{taskID}/runs/{runID}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + def get_tasks(self, **kwargs): # noqa: E501 """List tasks. # noqa: E501 @@ -2139,111 +2245,3 @@ def post_tasks_id_runs_id_retry_with_http_info(self, task_id, run_id, **kwargs): _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - - def tasks_task_id_runs_run_id_delete(self, task_id, run_id, **kwargs): # noqa: E501 - """Cancel a run # noqa: E501 - - cancels a currently running run. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.tasks_task_id_runs_run_id_delete(task_id, run_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: task ID (required) - :param str run_id: run ID (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.tasks_task_id_runs_run_id_delete_with_http_info(task_id, run_id, **kwargs) # noqa: E501 - else: - (data) = self.tasks_task_id_runs_run_id_delete_with_http_info(task_id, run_id, **kwargs) # noqa: E501 - return data - - def tasks_task_id_runs_run_id_delete_with_http_info(self, task_id, run_id, **kwargs): # noqa: E501 - """Cancel a run # noqa: E501 - - cancels a currently running run. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.tasks_task_id_runs_run_id_delete_with_http_info(task_id, run_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: task ID (required) - :param str run_id: run ID (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['task_id', 'run_id', 'zap_trace_span'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method tasks_task_id_runs_run_id_delete" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'task_id' is set - if ('task_id' not in local_var_params or - local_var_params['task_id'] is None): - raise ValueError("Missing the required parameter `task_id` when calling `tasks_task_id_runs_run_id_delete`") # noqa: E501 - # verify the required parameter 'run_id' is set - if ('run_id' not in local_var_params or - local_var_params['run_id'] is None): - raise ValueError("Missing the required parameter `run_id` when calling `tasks_task_id_runs_run_id_delete`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_id' in local_var_params: - path_params['taskID'] = local_var_params['task_id'] # noqa: E501 - if 'run_id' in local_var_params: - path_params['runID'] = local_var_params['run_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{taskID}/runs/{runID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) diff --git a/influxdb2/api/telegrafs_api.py b/influxdb2/service/telegrafs_service.py similarity index 99% rename from influxdb2/api/telegrafs_api.py rename to influxdb2/service/telegrafs_service.py index fe40fb79..d864c0e2 100644 --- a/influxdb2/api/telegrafs_api.py +++ b/influxdb2/service/telegrafs_service.py @@ -20,7 +20,7 @@ from influxdb2.api_client import ApiClient -class TelegrafsApi(object): +class TelegrafsService(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech diff --git a/influxdb2/api/templates_api.py b/influxdb2/service/templates_service.py similarity index 99% rename from influxdb2/api/templates_api.py rename to influxdb2/service/templates_service.py index 2290d224..b0187cec 100644 --- a/influxdb2/api/templates_api.py +++ b/influxdb2/service/templates_service.py @@ -20,7 +20,7 @@ from influxdb2.api_client import ApiClient -class TemplatesApi(object): +class TemplatesService(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech diff --git a/influxdb2/api/users_api.py b/influxdb2/service/users_service.py similarity index 99% rename from influxdb2/api/users_api.py rename to influxdb2/service/users_service.py index 52b794a9..09005d4f 100644 --- a/influxdb2/api/users_api.py +++ b/influxdb2/service/users_service.py @@ -20,7 +20,7 @@ from influxdb2.api_client import ApiClient -class UsersApi(object): +class UsersService(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech diff --git a/influxdb2/api/variables_api.py b/influxdb2/service/variables_service.py similarity index 99% rename from influxdb2/api/variables_api.py rename to influxdb2/service/variables_service.py index 45f0a5df..02683032 100644 --- a/influxdb2/api/variables_api.py +++ b/influxdb2/service/variables_service.py @@ -20,7 +20,7 @@ from influxdb2.api_client import ApiClient -class VariablesApi(object): +class VariablesService(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech diff --git a/influxdb2/api/views_api.py b/influxdb2/service/views_service.py similarity index 99% rename from influxdb2/api/views_api.py rename to influxdb2/service/views_service.py index 39a55099..d1b2829c 100644 --- a/influxdb2/api/views_api.py +++ b/influxdb2/service/views_service.py @@ -20,7 +20,7 @@ from influxdb2.api_client import ApiClient -class ViewsApi(object): +class ViewsService(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech diff --git a/influxdb2/api/write_api.py b/influxdb2/service/write_service.py similarity index 99% rename from influxdb2/api/write_api.py rename to influxdb2/service/write_service.py index 37678b54..87596bbb 100644 --- a/influxdb2/api/write_api.py +++ b/influxdb2/service/write_service.py @@ -20,7 +20,7 @@ from influxdb2.api_client import ApiClient -class WriteApi(object): +class WriteService(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech diff --git a/influxdb2_test/__init__.py b/influxdb2_test/__init__.py index 3559fe61..d109302f 100644 --- a/influxdb2_test/__init__.py +++ b/influxdb2_test/__init__.py @@ -3,25 +3,28 @@ # flake8: noqa # import apis into api package -from influxdb2.api.authorizations_api import AuthorizationsApi -from influxdb2.api.buckets_api import BucketsApi -from influxdb2.api.cells_api import CellsApi -from influxdb2.api.dashboards_api import DashboardsApi -from influxdb2.api.health_api import HealthApi -from influxdb2.api.labels_api import LabelsApi -from influxdb2.api.operation_logs_api import OperationLogsApi -from influxdb2.api.organizations_api import OrganizationsApi -from influxdb2.api.query_api import QueryApi -from influxdb2.api.ready_api import ReadyApi -from influxdb2.api.scraper_targets_api import ScraperTargetsApi -from influxdb2.api.secrets_api import SecretsApi -from influxdb2.api.setup_api import SetupApi -from influxdb2.api.sources_api import SourcesApi -from influxdb2.api.tasks_api import TasksApi -from influxdb2.api.telegrafs_api import TelegrafsApi -from influxdb2.api.templates_api import TemplatesApi -from influxdb2.api.users_api import UsersApi -from influxdb2.api.variables_api import VariablesApi -from influxdb2.api.views_api import ViewsApi -from influxdb2.api.write_api import WriteApi -from influxdb2.api.default_api import DefaultApi +from influxdb2.service.authorizations_service import AuthorizationsService +from influxdb2.service.buckets_service import BucketsService +from influxdb2.service.cells_service import CellsService +from influxdb2.service.checks_service import ChecksService +from influxdb2.service.dashboards_service import DashboardsService +from influxdb2.service.health_service import HealthService +from influxdb2.service.labels_service import LabelsService +from influxdb2.service.notification_endpoints_service import NotificationEndpointsService +from influxdb2.service.notification_rules_service import NotificationRulesService +from influxdb2.service.operation_logs_service import OperationLogsService +from influxdb2.service.organizations_service import OrganizationsService +from influxdb2.service.query_service import QueryService +from influxdb2.service.ready_service import ReadyService +from influxdb2.service.scraper_targets_service import ScraperTargetsService +from influxdb2.service.secrets_service import SecretsService +from influxdb2.service.setup_service import SetupService +from influxdb2.service.sources_service import SourcesService +from influxdb2.service.tasks_service import TasksService +from influxdb2.service.telegrafs_service import TelegrafsService +from influxdb2.service.templates_service import TemplatesService +from influxdb2.service.users_service import UsersService +from influxdb2.service.variables_service import VariablesService +from influxdb2.service.views_service import ViewsService +from influxdb2.service.write_service import WriteService +from influxdb2.service.default_service import DefaultService diff --git a/influxdb2_test/base_test.py b/influxdb2_test/base_test.py index 327a0641..73fd1e3a 100644 --- a/influxdb2_test/base_test.py +++ b/influxdb2_test/base_test.py @@ -26,15 +26,15 @@ def setUp(self) -> None: self.client = InfluxDBClient(conf.host, auth_token, debug=conf.debug, org="my-org") self.api_client = self.client.api_client - self.write_api = influxdb2.api.write_api.WriteApi(self.api_client) - self.write_client = self.client.write_client() + self.write_api = influxdb2.service.write_service.WriteService(self.api_client) + self.write_client = self.client.write_api() - self.query_client = self.client.query_client() - self.buckets_client = self.client.buckets_client() + self.query_client = self.client.query_api() + self.buckets_client = self.client.buckets_api() self.my_organization = self.find_my_org() - self.users_client = self.client.users_client() - self.organizations_client = self.client.organizations_client() - self.authorizations_client = self.client.authorizations_client() + self.users_client = self.client.users_api() + self.organizations_client = self.client.organizations_api() + self.authorizations_client = self.client.authorizations_api() def tearDown(self) -> None: self.client.__del__() @@ -49,7 +49,7 @@ def delete_test_bucket(self, bucket): return self.buckets_client.delete_bucket(bucket) def find_my_org(self): - org_api = influxdb2.api.organizations_api.OrganizationsApi(self.api_client) + org_api = influxdb2.service.organizations_service.OrganizationsService(self.api_client) orgs = org_api.get_orgs() for org in orgs.orgs: if org.name == self.org: diff --git a/influxdb2_test/example.py b/influxdb2_test/example.py index 10d39a39..916f2fdc 100644 --- a/influxdb2_test/example.py +++ b/influxdb2_test/example.py @@ -13,22 +13,22 @@ client = InfluxDBClient(url="http://localhost:9999/api/v2", token="my-token-123", org="my-org") -write_client = client.write_client() -query_client = client.query_client() +write_api = client.write_api() +query_api = client.query_api() p = Point("my_measurement").tag("location", "Prague").field("temperature", 25.3).time(datetime.now(), WritePrecision.MS) # write using point structure -write_client.write(org="my-org", bucket=bucket, record=p) +write_api.write(org="my-org", bucket=bucket, record=p) line_protocol = p.to_line_protocol() print(line_protocol) # write using line protocol string -write_client.write(org="my-org", bucket=bucket, record=line_protocol) +write_api.write(org="my-org", bucket=bucket, record=line_protocol) # using Table structure -tables = query_client.query('from(bucket:"my-bucket") |> range(start: -1m)') +tables = query_api.query('from(bucket:"my-bucket") |> range(start: -1m)') for table in tables: print(table) for record in table.records: @@ -36,12 +36,12 @@ print(record.values) # using csv library -csv_result = query_client.query_csv('from(bucket:"my-bucket") |> range(start: -10m)') +csv_result = query_api.query_csv('from(bucket:"my-bucket") |> range(start: -10m)') val_count = 0 for record in csv_result: for cell in record: val_count += 1 print("val count: ", val_count) -response = query_client.query_raw('from(bucket:"my-bucket") |> range(start: -10m)') +response = query_api.query_raw('from(bucket:"my-bucket") |> range(start: -10m)') print (codecs.decode(response.data)) diff --git a/influxdb2_test/test_AuthorizationClient.py b/influxdb2_test/test_AuthorizationApi.py similarity index 94% rename from influxdb2_test/test_AuthorizationClient.py rename to influxdb2_test/test_AuthorizationApi.py index 81263f56..9d28c124 100644 --- a/influxdb2_test/test_AuthorizationClient.py +++ b/influxdb2_test/test_AuthorizationApi.py @@ -1,7 +1,7 @@ import pytest from influxdb2 import PermissionResource, Permission, Authorization -from influxdb2.client.authorizations_client import AuthorizationsClient +from influxdb2.client.authorizations_api import AuthorizationsApi from influxdb2.rest import ApiException from influxdb2_test.base_test import BaseTest @@ -83,10 +83,10 @@ def test_createAuthorizationTask(self): self.assertEqual(authorization.permissions[1].action, "write") def test_createAuthorizationBucket(self): - organization = self.client.organizations_client().create_organization(self.generate_name("Auth Organization")) - bucket = self.client.buckets_client().create_bucket(bucket_name=self.generate_name("Auth Bucket"), - retention_rules=BaseTest.retention_rule(), - org_id=self.organization.id) + organization = self.client.organizations_api().create_organization(self.generate_name("Auth Organization")) + bucket = self.client.buckets_api().create_bucket(bucket_name=self.generate_name("Auth Bucket"), + retention_rules=BaseTest.retention_rule(), + org_id=self.organization.id) resource = PermissionResource(org_id=organization.id, type="buckets", id=bucket.id) create_bucket = Permission(action="read", resource=resource) delete_bucket = Permission(action="write", resource=resource) @@ -203,8 +203,8 @@ def test_cloneAuthorizationNotFound(self): self.authorization_api().find_authorization_by_id("020f755c3c082000") self.assertIn("authorization not found", e.value.body) - def authorization_api(self) -> AuthorizationsClient: - return self.client.authorizations_client() + def authorization_api(self) -> AuthorizationsApi: + return self.client.authorizations_api() def new_permissions(self): resource = PermissionResource(org_id=self.organization.id, type="users") diff --git a/influxdb2_test/test_BucketsClient.py b/influxdb2_test/test_BucketsApi.py similarity index 100% rename from influxdb2_test/test_BucketsClient.py rename to influxdb2_test/test_BucketsApi.py diff --git a/influxdb2_test/test_QueryClient.py b/influxdb2_test/test_QueryApi.py similarity index 90% rename from influxdb2_test/test_QueryClient.py rename to influxdb2_test/test_QueryApi.py index 44ab9fbd..1c97c75e 100644 --- a/influxdb2_test/test_QueryClient.py +++ b/influxdb2_test/test_QueryApi.py @@ -8,7 +8,7 @@ class SimpleQueryTest(BaseTest): def test_query_raw(self): client = self.client - query_client = client.query_client() + query_client = client.query_api() bucket = "my-bucket" result = query_client.query_raw( @@ -21,7 +21,7 @@ def test_query_flux_table(self): client = self.client bucket = "my-bucket" - query_client = client.query_client() + query_client = client.query_api() tables = query_client.query( 'from(bucket:"' + bucket + '") |> range(start: 1970-01-01T00:00:00.000000001Z) |> last()') @@ -36,7 +36,7 @@ def test_query_flux_table(self): def test_query_flux_csv(self): client = self.client bucket = "my-bucket" - query_client = client.query_client() + query_client = client.query_api() csv_result = query_client.query_csv( 'from(bucket:"' + bucket + '") |> range(start: 1970-01-01T00:00:00.000000001Z) |> last()') diff --git a/influxdb2_test/test_WriteApiTest.py b/influxdb2_test/test_WriteApi.py similarity index 81% rename from influxdb2_test/test_WriteApiTest.py rename to influxdb2_test/test_WriteApi.py index 569d60d1..0b342c70 100644 --- a/influxdb2_test/test_WriteApiTest.py +++ b/influxdb2_test/test_WriteApi.py @@ -5,8 +5,8 @@ import datetime import unittest -from influxdb2 import QueryApi, OrganizationsApi, WritePrecision, BucketsApi -from influxdb2_test.base_test import BaseTest, generate_bucket_name +from influxdb2 import WritePrecision +from influxdb2_test.base_test import BaseTest class SimpleWriteTest(BaseTest): @@ -35,8 +35,8 @@ def test_write_line_protocol(self): def test_write_precission(self): bucket = self.create_test_bucket() - self.client.write_client().write(org="my-org", bucket=bucket.name, record="air,location=Python humidity=99", - write_precision=WritePrecision.MS) + self.client.write_api().write(org="my-org", bucket=bucket.name, record="air,location=Python humidity=99", + write_precision=WritePrecision.MS) result = self.query_client.query( "from(bucket:\"" + bucket.name + "\") |> range(start: 1970-01-01T00:00:00.000000001Z) |> last()", self.org) @@ -53,14 +53,14 @@ def test_WriteRecordsList(self): list = [_record1, _record2] - self.client.write_client().write(bucket.name, self.org, list) + self.client.write_api().write(bucket.name, self.org, list) - self.client.write_client().flush() + self.client.write_api().flush() query = 'from(bucket:"' + bucket.name + '") |> range(start: 1970-01-01T00:00:00.000000001Z)' print(query) - flux_result = self.client.query_client().query(query) + flux_result = self.client.query_api().query(query) self.assertEqual(1, len(flux_result)) diff --git a/influxdb2_test/test_point.py b/influxdb2_test/test_point.py index bc41c4e3..02af6e69 100644 --- a/influxdb2_test/test_point.py +++ b/influxdb2_test/test_point.py @@ -16,7 +16,7 @@ from pytz import UTC, timezone from influxdb2.client.write.point import Point -from influxdb2.models.write_precision import WritePrecision +from influxdb2.domain.write_precision import WritePrecision from influxdb2_test.base_test import BaseTest diff --git a/openapi-generator/src/main/java/org/influxdata/codegen/InfluxPythonGenerator.java b/openapi-generator/src/main/java/org/influxdata/codegen/InfluxPythonGenerator.java index 3b40ece9..de8f841d 100644 --- a/openapi-generator/src/main/java/org/influxdata/codegen/InfluxPythonGenerator.java +++ b/openapi-generator/src/main/java/org/influxdata/codegen/InfluxPythonGenerator.java @@ -1,9 +1,21 @@ package org.influxdata.codegen; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + import org.openapitools.codegen.languages.PythonClientCodegen; +import static org.openapitools.codegen.utils.StringUtils.camelize; +import static org.openapitools.codegen.utils.StringUtils.underscore; + public class InfluxPythonGenerator extends PythonClientCodegen { + public InfluxPythonGenerator() { + apiPackage = "service"; + modelPackage = "domain"; + } + /** * Configures a friendly name for the generator. This will be used by the generator * to select the library with the -g flag. @@ -24,4 +36,47 @@ public String getHelp() { return "Generates a influx-python client library."; } + @Override + public void processOpts() { + + super.processOpts(); + + List useless = Arrays.asList( + ".gitignore", ".travis.yml", "README.md", "setup.py", "requirements.txt", "test-requirements.txt", + "git_push.sh"); + + // + // Remove useless supports file + // + supportingFiles = supportingFiles.stream() + .filter(supportingFile -> !useless.contains(supportingFile.destinationFilename)) + .collect(Collectors.toList()); + } + + @Override + public String toApiName(String name) { + if (name.length() == 0) { + return "DefaultService"; + } + // e.g. phone_number_service => PhoneNumberService + return camelize(name) + "Service"; + } + + @Override + public String toApiVarName(String name) { + + if (name.length() == 0) { + return "default_service"; + } + return underscore(name) + "_service"; + } + + @Override + public String toApiFilename(String name) { + // replace - with _ e.g. created-at => created_at + name = name.replaceAll("-", "_"); + + // e.g. PhoneNumberService.py => phone_number_service.py + return underscore(name) + "_service"; + } } diff --git a/scripts/generate-sources.sh b/scripts/generate-sources.sh index cc88d4d7..48ecf982 100755 --- a/scripts/generate-sources.sh +++ b/scripts/generate-sources.sh @@ -2,19 +2,20 @@ #!/usr/bin/env bash -SCRIPT_PATH="$( cd "$(dirname "$0")" ; pwd -P )" +SCRIPT_PATH="$( cd "$(dirname "$0")" || exit ; pwd -P )" # Generate OpenAPI generator -cd ${SCRIPT_PATH}/../openapi-generator/ +cd "${SCRIPT_PATH}"/../openapi-generator/ || exit mvn clean install -DskipTests # delete old sources -#rm ${SCRIPT_PATH}/../Client/InfluxDB.Client.Api/Domain/*.cs +rm "${SCRIPT_PATH}"/../influxdb2/domain/*.py +rm "${SCRIPT_PATH}"/../influxdb2/service/*.py # Generate client -cd ${SCRIPT_PATH}/ +cd "${SCRIPT_PATH}"/ || exit mvn org.openapitools:openapi-generator-maven-plugin:generate -#mvn -Dlibrary=asyncio org.openapitools:openapi-generator-maven-plugin:generate -#mvn -Dlibrary=tornado org.openapitools:openapi-generator-maven-plugin:generate - +cp "${SCRIPT_PATH}"/../influxdb2/service/__init__.py "${SCRIPT_PATH}"/../influxdb2/client/ +cp "${SCRIPT_PATH}"/../influxdb2/service/__init__.py "${SCRIPT_PATH}"/../influxdb2/client/write/ +cp "${SCRIPT_PATH}"/../influxdb2/service/__init__.py "${SCRIPT_PATH}"/../influxdb2_test/ \ No newline at end of file diff --git a/scripts/pom.xml b/scripts/pom.xml index 3c8ae421..c939a6d6 100644 --- a/scripts/pom.xml +++ b/scripts/pom.xml @@ -16,7 +16,7 @@ openapi-generator-maven-plugin 3.3.4 - ${project.basedir}/swagger.yaml + ${project.basedir}/swagger.yml influx-python optionalProjectFile=true @@ -28,18 +28,13 @@ false false true - true + false true false false ${project.basedir}/.. false - - - - ${library} - diff --git a/scripts/swagger.yaml b/scripts/swagger.yml similarity index 85% rename from scripts/swagger.yaml rename to scripts/swagger.yml index 1fd19c84..c612a319 100644 --- a/scripts/swagger.yaml +++ b/scripts/swagger.yml @@ -1666,13 +1666,13 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Check" + $ref: "#/components/schemas/HealthCheck" '503': description: the instance is unhealthy content: application/json: schema: - $ref: "#/components/schemas/Check" + $ref: "#/components/schemas/HealthCheck" default: description: unexpected error content: @@ -1852,13 +1852,13 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Check" + $ref: "#/components/schemas/HealthCheck" '503': description: the source is not healthy content: application/json: schema: - $ref: "#/components/schemas/Check" + $ref: "#/components/schemas/HealthCheck" default: description: unexpected error content: @@ -2841,19 +2841,19 @@ paths: application/json: schema: $ref: "#/components/schemas/Error" - /query/suggestions/{name}: - parameters: - - $ref: '#/components/parameters/TraceSpan' - - in: path - name: name - schema: - type: string - required: true - description: name of branching suggestion + '/query/suggestions/{name}': get: operationId: GetQuerySuggestionsName tags: - Query + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: name + schema: + type: string + required: true + description: name of branching suggestion responses: '200': description: Suggestions for next functions in call chain @@ -3073,6 +3073,16 @@ paths: summary: query an influx parameters: - $ref: '#/components/parameters/TraceSpan' + - in: header + name: Accept-Encoding + description: The Accept-Encoding request HTTP header advertises which content encoding, usually a compression algorithm, the client is able to understand. + schema: + type: string + description: specifies that the query response in the body should be encoded with gzip or not encoded with identity. + default: identity + enum: + - gzip + - identity - in: header name: Content-Type schema: @@ -3102,6 +3112,16 @@ paths: responses: '200': description: query results + headers: + Content-Encoding: + description: The Content-Encoding entity header is used to compress the media-type. When present, its value indicates which encodings were applied to the entity-body + schema: + type: string + description: specifies that the response in the body is encoded with gzip or not encoded with identity. + default: identity + enum: + - gzip + - identity content: text/csv: schema: @@ -4441,10 +4461,10 @@ paths: schema: $ref: "#/components/schemas/Error" delete: + operationId: DeleteTasksIDRunsID tags: - Tasks - summary: Cancel a run - description: cancels a currently running run. + summary: Cancel a single running task parameters: - $ref: '#/components/parameters/TraceSpan' - in: path @@ -4461,7 +4481,7 @@ paths: description: run ID responses: '204': - description: Cancel has been accepted + description: delete has been accepted default: description: unexpected error content: @@ -5079,237 +5099,722 @@ paths: application/json: schema: $ref: "#/components/schemas/Error" -components: - parameters: - Offset: - in: query - name: offset - required: false - schema: - type: integer - minimum: 0 - Limit: - in: query - name: limit - required: false - schema: - type: integer - minimum: 1 - maximum: 100 - default: 20 - Descending: - in: query - name: descending - required: false - schema: - type: boolean - default: false - SortBy: - in: query - name: sortBy - required: false - schema: - type: string - TraceSpan: - in: header - name: Zap-Trace-Span - description: OpenTracing span context - example: - trace_id: '1' - span_id: '1' - baggage: - key: value - required: false - schema: - type: string - schemas: - LanguageRequest: - description: flux query to be analyzed. - type: object - required: - - query - properties: - query: - description: flux query script to be analyzed - type: string - Query: - description: query influx with specified return formatting. - type: object - required: - - query - properties: - extern: - $ref: "#/components/schemas/File" - query: - description: query script to execute. - type: string - type: - description: type of query - type: string - default: flux - enum: - - flux - - influxql - db: - description: required for influxql type queries - type: string - rp: - description: required for influxql type queries - type: string - cluster: - description: required for influxql type queries - type: string - dialect: - $ref: "#/components/schemas/Dialect" - Package: - description: represents a complete package source tree - type: object - properties: - type: - $ref: "#/components/schemas/NodeType" - path: - description: package import path - type: string - package: - description: package name - type: string - files: - description: package files - type: array - items: - $ref: "#/components/schemas/File" - File: - description: represents a source from a single file - type: object - properties: - type: - $ref: "#/components/schemas/NodeType" - name: - description: name of the file - type: string - package: - $ref: "#/components/schemas/PackageClause" - imports: - description: a list of package imports - type: array - items: - $ref: "#/components/schemas/ImportDeclaration" - body: - description: list of Flux statements - type: array - items: - $ref: "#/components/schemas/Statement" - PackageClause: - description: defines a package identifier - type: object - properties: - type: - $ref: "#/components/schemas/NodeType" - name: - $ref: "#/components/schemas/Identifier" - ImportDeclaration: - description: declares a package import - type: object - properties: - type: - $ref: "#/components/schemas/NodeType" - as: - $ref: "#/components/schemas/Identifier" - path: - $ref: "#/components/schemas/StringLiteral" - Node: - oneOf: - - $ref: "#/components/schemas/Expression" - - $ref: "#/components/schemas/Block" - Block: - description: a set of statements - type: object - properties: - type: - $ref: "#/components/schemas/NodeType" - body: - description: block body - type: array - items: - $ref: "#/components/schemas/Statement" - Statement: - oneOf: - - $ref: "#/components/schemas/BadStatement" - - $ref: "#/components/schemas/VariableAssignment" - - $ref: "#/components/schemas/MemberAssignment" - - $ref: "#/components/schemas/ExpressionStatement" - - $ref: "#/components/schemas/ReturnStatement" - - $ref: "#/components/schemas/OptionStatement" - - $ref: "#/components/schemas/BuiltinStatement" - - $ref: "#/components/schemas/TestStatement" - BadStatement: - description: a placeholder for statements for which no correct statement nodes can be created - type: object - properties: - type: - $ref: "#/components/schemas/NodeType" - text: - description: raw source text - type: string - VariableAssignment: - description: represents the declaration of a variable - type: object - properties: - type: - $ref: "#/components/schemas/NodeType" - id: - $ref: "#/components/schemas/Identifier" - init: - $ref: "#/components/schemas/Expression" - MemberAssignment: - description: object property assignment - type: object - properties: - type: - $ref: "#/components/schemas/NodeType" - member: - $ref: "#/components/schemas/MemberExpression" - init: - $ref: "#/components/schemas/Expression" - ExpressionStatement: - description: may consist of an expression that does not return a value and is executed solely for its side-effects - type: object - properties: - type: - $ref: "#/components/schemas/NodeType" - expression: - $ref: "#/components/schemas/Expression" - ReturnStatement: - description: defines an expression to return - type: object - properties: - type: - $ref: "#/components/schemas/NodeType" - argument: - $ref: "#/components/schemas/Expression" - OptionStatement: - description: a single variable declaration - type: object - properties: - type: - $ref: "#/components/schemas/NodeType" - assignment: - oneOf: - - $ref: "#/components/schemas/VariableAssignment" - - $ref: "#/components/schemas/MemberAssignment" - BuiltinStatement: - description: declares a builtin identifier and its type - type: object - properties: - type: - $ref: "#/components/schemas/NodeType" - id: - $ref: "#/components/schemas/Identifier" - TestStatement: - description: declares a Flux test case - type: object - properties: - type: + /checks: + get: + operationId: GetChecks + tags: + - Checks + summary: Get all checks + parameters: + - $ref: '#/components/parameters/Offset' + - $ref: '#/components/parameters/Limit' + - in: query + name: orgID + required: true + description: only show checks belonging to specified organization + schema: + type: string + responses: + '200': + description: A list of checks + content: + application/json: + schema: + $ref: "#/components/schemas/Checks" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: CreateCheck + tags: + - Checks + summary: Add new check + requestBody: + description: check to create + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Check" + responses: + '201': + description: Check created + content: + application/json: + schema: + $ref: "#/components/schemas/Check" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/checks/{checkID}': + get: + operationId: GetChecksID + tags: + - Checks + summary: Get an check + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: checkID + schema: + type: string + required: true + description: ID of check + responses: + '200': + description: the check requested + content: + application/json: + schema: + $ref: "#/components/schemas/Check" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + patch: + operationId: PatchChecksID + tags: + - Checks + summary: Update a check + requestBody: + description: check update to apply + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Check" + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: checkID + schema: + type: string + required: true + description: ID of check + responses: + '200': + description: An updated check + content: + application/json: + schema: + $ref: "#/components/schemas/Check" + '404': + description: The check was not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + delete: + operationId: DeleteChecksID + tags: + - Checks + summary: Delete a check + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: checkID + schema: + type: string + required: true + description: ID of check + responses: + '204': + description: delete has been accepted + '404': + description: The check was not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /notificationRules: + get: + operationId: GetNotificationRules + tags: + - NotificationRules + summary: Get all notification rules + parameters: + - $ref: '#/components/parameters/Offset' + - $ref: '#/components/parameters/Limit' + - in: query + name: orgID + required: true + description: only show notification rules belonging to specified organization + schema: + type: string + - in: query + name: checkID + description: only show notifications that belong to the specified check + schema: + type: string + responses: + '200': + description: A list of notification rules + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationRules" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: CreateNotificationRule + tags: + - NotificationRules + summary: Add new notification rule + requestBody: + description: notificationRule to create + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationRule" + responses: + '201': + description: Notification rule created + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationRule" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/notificationRules/{ruleID}': + get: + operationId: GetNotificationRulesID + tags: + - NotificationRules + summary: Get a notification rule + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: ruleID + schema: + type: string + required: true + description: ID of notification rule + responses: + '200': + description: the notification rule requested + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationRule" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + put: + operationId: PutNotificationRulesID + tags: + - NotificationRules + summary: Update a notification rule + requestBody: + description: notification rule update to apply + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationRule" + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: ruleID + schema: + type: string + required: true + description: ID of notification rule + responses: + '200': + description: An updated notification rule + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationRule" + '404': + description: The notification rule was not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + patch: + operationId: PatchNotificationRulesID + tags: + - NotificationRules + summary: Update a notification rule + requestBody: + description: notification rule update to apply + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationRuleUpdate" + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: ruleID + schema: + type: string + required: true + description: ID of notification rule + responses: + '200': + description: An updated notification rule + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationRule" + '404': + description: The notification rule was not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + delete: + operationId: DeleteNotificationRulesID + tags: + - NotificationRules + summary: Delete a notification rule + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: ruleID + schema: + type: string + required: true + description: ID of notification rule + responses: + '204': + description: delete has been accepted + '404': + description: The check was not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /notificationEndpoints: + get: + operationId: GetNotificationEndpoints + tags: + - NotificationEndpoints + summary: Get all notification endpoints + parameters: + - $ref: '#/components/parameters/Offset' + - $ref: '#/components/parameters/Limit' + - in: query + name: orgID + required: true + description: only show notification endpoints belonging to specified organization + schema: + type: string + responses: + '200': + description: A list of notification rules + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationEndpoints" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: CreateNotificationEndpoint + tags: + - NotificationEndpoints + summary: Add new notification endpoint + requestBody: + description: notificationEndpoint to create + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationEndpoint" + responses: + '201': + description: Notification rule created + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationRule" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/notificationEndpoints/{endpointID}': + get: + operationId: GetNotificationEndpointsID + tags: + - NotificationEndpoints + summary: Get a notification endpoint + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: endpointID + schema: + type: string + required: true + description: ID of notification endpoint + responses: + '200': + description: the notification endpoint requested + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationEndpoint" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + patch: + operationId: PatchNotificationEndpointsID + tags: + - NotificationEndpoints + summary: Update a notification endpoint + requestBody: + description: check update to apply + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationEndpoint" + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: endpointID + schema: + type: string + required: true + description: ID of notification endpoint + responses: + '200': + description: An updated notification endpoint + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationEndpoint" + '404': + description: The notification endpoint was not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + delete: + operationId: DeleteNotificationEndpointsID + tags: + - NotificationEndpoints + summary: Delete a notification endpoint + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: endpointID + schema: + type: string + required: true + description: ID of notification endpoint + responses: + '204': + description: delete has been accepted + '404': + description: The endpoint was not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" +components: + parameters: + Offset: + in: query + name: offset + required: false + schema: + type: integer + minimum: 0 + Limit: + in: query + name: limit + required: false + schema: + type: integer + minimum: 1 + maximum: 100 + default: 20 + Descending: + in: query + name: descending + required: false + schema: + type: boolean + default: false + SortBy: + in: query + name: sortBy + required: false + schema: + type: string + TraceSpan: + in: header + name: Zap-Trace-Span + description: OpenTracing span context + example: + trace_id: '1' + span_id: '1' + baggage: + key: value + required: false + schema: + type: string + schemas: + LanguageRequest: + description: flux query to be analyzed. + type: object + required: + - query + properties: + query: + description: flux query script to be analyzed + type: string + Query: + description: query influx with specified return formatting. + type: object + required: + - query + properties: + extern: + $ref: "#/components/schemas/File" + query: + description: query script to execute. + type: string + type: + description: type of query + type: string + default: flux + enum: + - flux + - influxql + db: + description: required for influxql type queries + type: string + rp: + description: required for influxql type queries + type: string + cluster: + description: required for influxql type queries + type: string + dialect: + $ref: "#/components/schemas/Dialect" + Package: + description: represents a complete package source tree + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + path: + description: package import path + type: string + package: + description: package name + type: string + files: + description: package files + type: array + items: + $ref: "#/components/schemas/File" + File: + description: represents a source from a single file + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + name: + description: name of the file + type: string + package: + $ref: "#/components/schemas/PackageClause" + imports: + description: a list of package imports + type: array + items: + $ref: "#/components/schemas/ImportDeclaration" + body: + description: list of Flux statements + type: array + items: + $ref: "#/components/schemas/Statement" + PackageClause: + description: defines a package identifier + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + name: + $ref: "#/components/schemas/Identifier" + ImportDeclaration: + description: declares a package import + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + as: + $ref: "#/components/schemas/Identifier" + path: + $ref: "#/components/schemas/StringLiteral" + Node: + oneOf: + - $ref: "#/components/schemas/Expression" + - $ref: "#/components/schemas/Block" + Block: + description: a set of statements + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + body: + description: block body + type: array + items: + $ref: "#/components/schemas/Statement" + Statement: + oneOf: + - $ref: "#/components/schemas/BadStatement" + - $ref: "#/components/schemas/VariableAssignment" + - $ref: "#/components/schemas/MemberAssignment" + - $ref: "#/components/schemas/ExpressionStatement" + - $ref: "#/components/schemas/ReturnStatement" + - $ref: "#/components/schemas/OptionStatement" + - $ref: "#/components/schemas/BuiltinStatement" + - $ref: "#/components/schemas/TestStatement" + BadStatement: + description: a placeholder for statements for which no correct statement nodes can be created + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + text: + description: raw source text + type: string + VariableAssignment: + description: represents the declaration of a variable + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + id: + $ref: "#/components/schemas/Identifier" + init: + $ref: "#/components/schemas/Expression" + MemberAssignment: + description: object property assignment + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + member: + $ref: "#/components/schemas/MemberExpression" + init: + $ref: "#/components/schemas/Expression" + ExpressionStatement: + description: may consist of an expression that does not return a value and is executed solely for its side-effects + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + expression: + $ref: "#/components/schemas/Expression" + ReturnStatement: + description: defines an expression to return + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + argument: + $ref: "#/components/schemas/Expression" + OptionStatement: + description: a single variable declaration + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + assignment: + oneOf: + - $ref: "#/components/schemas/VariableAssignment" + - $ref: "#/components/schemas/MemberAssignment" + BuiltinStatement: + description: declares a builtin identifier and its type + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + id: + $ref: "#/components/schemas/Identifier" + TestStatement: + description: declares a Flux test case + type: object + properties: + type: $ref: "#/components/schemas/NodeType" assignment: $ref: "#/components/schemas/VariableAssignment" @@ -5634,6 +6139,9 @@ components: - labels - views - documents + - notificationRules + - notificationEndpoints + - checks id: type: string nullable: true @@ -6050,12 +6558,7 @@ components: description: An optional description of the task. type: string status: - description: The current status of the task. When updated to 'inactive', cancels all queued jobs of this task. - default: active - type: string - enum: - - active - - inactive + $ref: "#/components/schemas/TaskStatusType" labels: $ref: "#/components/schemas/Labels" authorizationID: @@ -6110,11 +6613,16 @@ components: labels: $ref: "#/components/schemas/Link" required: [id, name, orgID, flux] + TaskStatusType: + type: string + enum: [active, inactive] User: properties: id: readOnly: true type: string + oauthID: + type: string name: type: string status: @@ -6401,250 +6909,530 @@ components: type: array items: $ref: '#/components/schemas/Field' - QueryConfig: + BuilderConfig: type: object - required: - - database - - measurement - - retentionPolicy - - areTagsAccepted - - tags - - groupBy - - fields + properties: + buckets: + type: array + items: + type: string + tags: + type: array + items: + $ref: '#/components/schemas/BuilderTagsType' + functions: + type: array + items: + $ref: '#/components/schemas/BuilderFunctionsType' + aggregateWindow: + type: object + properties: + period: + type: string + BuilderTagsType: + type: object + properties: + key: + type: string + values: + type: array + items: + type: string + BuilderFunctionsType: + type: object + properties: + name: + type: string + DashboardQuery: + type: object + properties: + text: + type: string + description: The text of the flux query + editMode: + $ref: '#/components/schemas/QueryEditMode' + name: + type: string + builderConfig: + $ref: '#/components/schemas/BuilderConfig' + QueryEditMode: + type: string + enum: ['builder', 'advanced'] + Axis: + type: object + description: A description of a particular axis for a visualization + properties: + bounds: + type: array + minItems: 0 + maxItems: 2 + description: >- + The extents of an axis in the form [lower, upper]. Clients determine + whether bounds are to be inclusive or exclusive of their limits + items: + type: string + label: + description: label is a description of this Axis + type: string + prefix: + description: Prefix represents a label prefix for formatting axis values. + type: string + suffix: + description: Suffix represents a label suffix for formatting axis values. + type: string + base: + description: Base represents the radix for formatting axis values. + type: string + enum: ['', '2', '10'] + scale: + $ref: '#/components/schemas/AxisScale' + AxisScale: + description: 'Scale is the axis formatting scale. Supported: "log", "linear"' + type: string + enum: ['log', 'linear'] + DashboardColor: + type: object + description: Color defines an encoding of data value into color space + required: [id, type, hex, name, value] properties: id: + description: ID is the unique id of the view color + type: string + type: + description: Type is how the color is used. + type: string + enum: + - min + - max + - threshold + - scale + - text + - background + hex: + description: Hex is the hex number of the color + type: string + maxLength: 7 + minLength: 7 + name: + description: Name is the user-facing name of the hex color + type: string + value: + description: Value is the data value mapped to this color + type: number + format: float + RenamableField: + description: Describes a field that can be renamed and made visible or invisible + type: object + properties: + internalName: + description: This is the calculated name of a field + readOnly: true + type: string + displayName: + description: This is the name that a field is renamed to by the user + type: string + visible: + description: Indicates whether this field should be visible on the table + type: boolean + XYViewProperties: + type: object + required: + - type + - geom + - queries + - shape + - axes + - colors + - legend + - note + - showNoteWhenEmpty + properties: + type: + type: string + enum: [xy] + queries: + type: array + items: + $ref: "#/components/schemas/DashboardQuery" + colors: + description: Colors define color encoding of data into a visualization + type: array + items: + $ref: "#/components/schemas/DashboardColor" + shape: + type: string + enum: ['chronograf-v2'] + note: + type: string + showNoteWhenEmpty: + description: if true, will display note when empty + type: boolean + axes: + $ref: '#/components/schemas/Axes' + legend: + $ref: '#/components/schemas/Legend' + xColumn: + type: string + yColumn: + type: string + shadeBelow: + type: boolean + geom: + $ref: '#/components/schemas/XYGeom' + XYGeom: + type: string + enum: [line, step, stacked, bar, monotoneX] + LinePlusSingleStatProperties: + type: object + required: + - type + - queries + - shape + - axes + - colors + - legend + - note + - showNoteWhenEmpty + - prefix + - suffix + - decimalPlaces + properties: + type: + type: string + enum: [line-plus-single-stat] + queries: + type: array + items: + $ref: "#/components/schemas/DashboardQuery" + colors: + description: Colors define color encoding of data into a visualization + type: array + items: + $ref: "#/components/schemas/DashboardColor" + shape: + type: string + enum: ['chronograf-v2'] + note: + type: string + showNoteWhenEmpty: + description: if true, will display note when empty + type: boolean + axes: + $ref: '#/components/schemas/Axes' + legend: + $ref: '#/components/schemas/Legend' + xColumn: + type: string + yColumn: + type: string + shadeBelow: + type: boolean + prefix: + type: string + suffix: + type: string + decimalPlaces: + $ref: '#/components/schemas/DecimalPlaces' + ScatterViewProperties: + type: object + required: + - type + - queries + - colors + - shape + - note + - showNoteWhenEmpty + - xColumn + - yColumn + - fillColumns + - symbolColumns + - xDomain + - yDomain + - xAxisLabel + - yAxisLabel + - xPrefix + - yPrefix + - xSuffix + - ySuffix + properties: + type: + type: string + enum: [scatter] + queries: + type: array + items: + $ref: "#/components/schemas/DashboardQuery" + colors: + description: Colors define color encoding of data into a visualization + type: array + items: + type: string + shape: + type: string + enum: ['chronograf-v2'] + note: + type: string + showNoteWhenEmpty: + description: if true, will display note when empty + type: boolean + xColumn: + type: string + yColumn: + type: string + fillColumns: + type: array + items: + type: string + symbolColumns: + type: array + items: + type: string + xDomain: + type: array + items: + type: number + maxItems: 2 + yDomain: + type: array + items: + type: number + maxItems: 2 + xAxisLabel: + type: string + yAxisLabel: + type: string + xPrefix: + type: string + xSuffix: + type: string + yPrefix: type: string - database: + ySuffix: type: string - measurement: + HeatmapViewProperties: + type: object + required: + - type + - queries + - colors + - shape + - note + - showNoteWhenEmpty + - xColumn + - yColumn + - xDomain + - yDomain + - xAxisLabel + - yAxisLabel + - xPrefix + - yPrefix + - xSuffix + - ySuffix + - binSize + properties: + type: + type: string + enum: [heatmap] + queries: + type: array + items: + $ref: "#/components/schemas/DashboardQuery" + colors: + description: Colors define color encoding of data into a visualization + type: array + items: + type: string + shape: type: string - retentionPolicy: + enum: ['chronograf-v2'] + note: type: string - areTagsAccepted: + showNoteWhenEmpty: + description: if true, will display note when empty type: boolean - rawText: + xColumn: type: string - tags: - type: object - groupBy: - type: object - properties: - time: - type: string - tags: - type: array - items: - type: string - required: - - time - - tags - fields: + yColumn: + type: string + xDomain: type: array items: - $ref: '#/components/schemas/Field' - range: - type: object - properties: - lower: - type: string - upper: - type: string - required: - - lower - - upper - DashboardQuery: - type: object - required: - - query - properties: - label: + type: number + maxItems: 2 + yDomain: + type: array + items: + type: number + maxItems: 2 + xAxisLabel: type: string - description: Optional Y-axis user-facing label - range: - description: Optional default range of the Y-axis - type: object - required: - - upper - - lower - properties: - upper: - description: Upper bound of the display range of the Y-axis - type: integer - format: int64 - lower: - description: Lower bound of the display range of the Y-axis - type: integer - format: int64 - query: + yAxisLabel: type: string - source: + xPrefix: type: string - format: uri - description: Optional URI for data source for this query - queryConfig: - $ref: '#/components/schemas/QueryConfig' - Axis: + xSuffix: + type: string + yPrefix: + type: string + ySuffix: + type: string + binSize: + type: number + SingleStatViewProperties: type: object - description: A description of a particular axis for a visualization + required: + - type + - queries + - colors + - shape + - note + - showNoteWhenEmpty + - prefix + - suffix + - legend + - decimalPlaces properties: - bounds: + type: + type: string + enum: [single-stat] + queries: type: array - minItems: 0 - maxItems: 2 - description: >- - The extents of an axis in the form [lower, upper]. Clients determine - whether bounds are to be inclusive or exclusive of their limits items: - type: integer - format: int64 - label: - description: label is a description of this Axis + $ref: "#/components/schemas/DashboardQuery" + colors: + description: Colors define color encoding of data into a visualization + type: array + items: + $ref: "#/components/schemas/DashboardColor" + shape: + type: string + enum: ['chronograf-v2'] + note: type: string + showNoteWhenEmpty: + description: if true, will display note when empty + type: boolean prefix: - description: Prefix represents a label prefix for formatting axis values. type: string suffix: - description: Suffix represents a label suffix for formatting axis values. - type: string - base: - description: Base represents the radix for formatting axis values. - type: string - scale: - description: 'Scale is the axis formatting scale. Supported: "log", "linear"' type: string - DashboardColor: + legend: + $ref: '#/components/schemas/Legend' + decimalPlaces: + $ref: "#/components/schemas/DecimalPlaces" + HistogramViewProperties: type: object - description: Color defines an encoding of data value into color space + required: + - type + - queries + - colors + - shape + - note + - showNoteWhenEmpty + - xColumn + - fillColumns + - xDomain + - xAxisLabel + - position + - binCount properties: - id: - description: ID is the unique id of the view color - type: string type: - description: Type is how the color is used. type: string - enum: - - min - - max - - threshold - hex: - description: Hex is the hex number of the color + enum: [histogram] + queries: + type: array + items: + $ref: "#/components/schemas/DashboardQuery" + colors: + description: Colors define color encoding of data into a visualization + type: array + items: + $ref: "#/components/schemas/DashboardColor" + shape: type: string - maxLength: 7 - minLength: 7 - name: - description: Name is the user-facing name of the hex color + enum: ['chronograf-v2'] + note: type: string - value: - description: Value is the data value mapped to this color + showNoteWhenEmpty: + description: if true, will display note when empty + type: boolean + xColumn: type: string - RenamableField: - description: Describes a field that can be renamed and made visible or invisible - type: object - properties: - internalName: - description: This is the calculated name of a field - readOnly: true + fillColumns: + type: array + items: + type: string + xDomain: + type: array + items: + type: number + format: float + xAxisLabel: type: string - displayName: - description: This is the name that a field is renamed to by the user + position: type: string - visible: - description: Indicates whether this field should be visible on the table - type: boolean - LogViewProperties: - description: Contains the configuration for the log viewer + enum: [overlaid, stacked] + binCount: + type: integer + GaugeViewProperties: type: object required: - - columns - - shape - - type + - type + - queries + - colors + - shape + - note + - showNoteWhenEmpty + - prefix + - suffix + - legend + - decimalPlaces properties: - shape: - type: string - enum: ["chronograf-v2"] type: - type: string - enum: ["log-viewer"] - columns: - description: Defines the order, names, and visibility of columns in the log - viewer table + type: string + enum: [gauge] + queries: type: array items: - "$ref": "#/components/schemas/LogViewerColumn" - example: - columns: - - name: severity - position: 0 - settings: - - type: label - value: icon - - type: label - value: text - - type: visibility - value: visible - - type: color - name: ruby - value: emergency - - type: color - name: rainforest - value: info - - type: displayName - value: Log Severity! - - name: messages - position: 1 - settings: - - type: visibility - value: hidden - LogViewerColumn: - description: Contains a specific column's settings. + $ref: "#/components/schemas/DashboardQuery" + colors: + description: Colors define color encoding of data into a visualization + type: array + items: + $ref: "#/components/schemas/DashboardColor" + shape: + type: string + enum: ['chronograf-v2'] + note: + type: string + showNoteWhenEmpty: + description: if true, will display note when empty + type: boolean + prefix: + type: string + suffix: + type: string + legend: + $ref: '#/components/schemas/Legend' + decimalPlaces: + $ref: "#/components/schemas/DecimalPlaces" + TableViewProperties: type: object required: - - name - - position - - settings + - type + - queries + - colors + - shape + - note + - showNoteWhenEmpty + - tableOptions + - fieldOptions + - timeFormat + - decimalPlaces properties: - name: - description: Unique identifier name of the column + type: type: string - position: - type: integer - format: int32 - settings: - description: Composable settings options for the column - type: array - items: - description: Type and value and optional name of a setting. - type: object - required: - - type - - value - properties: - type: - type: string - value: - type: string - name: - type: string - example: - name: severity - position: 0 - settings: - - type: label - value: icon - - type: label - value: text - - type: visibility - value: visible - - type: color - name: ruby - value: emergency - - type: color - name: rainforest - value: info - - type: displayName - value: Log Severity! - ViewProperties: - properties: + enum: [table] queries: type: array items: @@ -6654,191 +7442,91 @@ components: type: array items: $ref: "#/components/schemas/DashboardColor" + shape: + type: string + enum: ['chronograf-v2'] note: type: string showNoteWhenEmpty: description: if true, will display note when empty type: boolean - LinePlusSingleStatProperties: - allOf: - - $ref: '#/components/schemas/ViewProperties' - - type: object - properties: - axes: - $ref: '#/components/schemas/Axes' - shape: - type: string - enum: ["chronograf-v2"] - type: - type: string - enum: ["line-plus-single-stat"] - legend: - $ref: '#/components/schemas/Legend' - prefix: - type: string - suffix: - type: string - decimalPlaces: - $ref: '#/components/schemas/DecimalPlaces' - XYViewProperties: - allOf: - - $ref: '#/components/schemas/ViewProperties' - - type: object - properties: - axes: - $ref: '#/components/schemas/Axes' - shape: - type: string - enum: ["chronograf-v2"] - type: - type: string - enum: ["xy"] - legend: - $ref: '#/components/schemas/Legend' - geom: - type: string - enum: ["line", "step", "stacked", "bar"] - SingleStatViewProperties: - allOf: - - $ref: '#/components/schemas/ViewProperties' - - type: object - properties: - shape: - type: string - enum: ["chronograf-v2"] - type: - type: string - enum: ["single-stat"] - prefix: - type: string - suffix: - type: string - legend: - $ref: '#/components/schemas/Legend' - decimalPlaces: - $ref: "#/components/schemas/DecimalPlaces" - HistogramViewProperties: - allOf: - - $ref: '#/components/schemas/ViewProperties' - - type: object - properties: - shape: - type: string - enum: ["chronograf-v2"] - type: - type: string - enum: ["histogram"] - xColumn: - type: string - fillColumns: - type: array - items: - type: string - xDomain: - type: array - items: - type: number - format: float - xAxisLabel: - type: string - position: - type: string - binCount: - type: integer - GaugeViewProperties: - allOf: - - $ref: '#/components/schemas/ViewProperties' - - type: object - properties: - shape: - type: string - enum: ["chronograf-v2"] - type: - type: string - enum: ["gauge"] - prefix: - type: string - suffix: - type: string - legend: - $ref: '#/components/schemas/Legend' - decimalPlaces: - $ref: '#/components/schemas/DecimalPlaces' - TableViewProperties: - allOf: - - $ref: '#/components/schemas/ViewProperties' - - type: object + tableOptions: properties: - shape: - type: string - enum: ["chronograf-v2"] - type: - type: string - enum: ["table"] - tableOptions: - properties: - verticalTimeAxis: - description: >- - verticalTimeAxis describes the orientation of the table by - indicating whether the time axis will be displayed vertically - type: boolean - sortBy: - $ref: "#/components/schemas/RenamableField" - wrapping: - description: wrapping describes the text wrapping style to be used in table views - type: string - enum: - - truncate - - wrap - - single-line - fixFirstColumn: - description: >- - fixFirstColumn indicates whether the first column of the table - should be locked - type: boolean - fieldOptions: + verticalTimeAxis: description: >- - fieldOptions represent the fields retrieved by the query with - customization options - type: array - items: - $ref: '#/components/schemas/RenamableField' - timeFormat: - description: >- - timeFormat describes the display format for time values according to - moment.js date formatting + verticalTimeAxis describes the orientation of the table by + indicating whether the time axis will be displayed vertically + type: boolean + sortBy: + $ref: "#/components/schemas/RenamableField" + wrapping: + description: wrapping describes the text wrapping style to be used in table views type: string - decimalPlaces: - $ref: '#/components/schemas/DecimalPlaces' + enum: + - truncate + - wrap + - single-line + fixFirstColumn: + description: >- + fixFirstColumn indicates whether the first column of the table + should be locked + type: boolean + fieldOptions: + description: >- + fieldOptions represent the fields retrieved by the query with + customization options + type: array + items: + $ref: '#/components/schemas/RenamableField' + timeFormat: + description: >- + timeFormat describes the display format for time values according to + moment.js date formatting + type: string + decimalPlaces: + $ref: '#/components/schemas/DecimalPlaces' MarkdownViewProperties: type: object + required: + - type + - shape + - note properties: - shape: - type: string - enum: ["chronograf-v2"] type: type: string - enum: ["markdown"] + enum: [markdown] + shape: + type: string + enum: ['chronograf-v2'] note: type: string - EmptyViewProperties: - properties: + CheckViewProperties: + type: object + required: + - type + - shape + - checkID + - check + properties: + type: + type: string + enum: [check] shape: type: string - enum: ["chronograf-v2"] - type: + enum: ['chronograf-v2'] + checkID: type: string - enum: ["empty"] + check: + $ref: '#/components/schemas/Check' Axes: description: The viewport for a View's visualizations type: object + required: ['x', 'y'] properties: x: $ref: '#/components/schemas/Axis' "y": # Quoted to prevent YAML parser from interpreting y as shorthand for true. $ref: '#/components/schemas/Axis' - y2: - $ref: '#/components/schemas/Axis' Legend: description: Legend define encoding of data into a view's legend type: object @@ -6873,7 +7561,7 @@ components: properties: type: type: string - enum: ["constant"] + enum: [constant] values: type: array items: @@ -6882,7 +7570,7 @@ components: properties: type: type: string - enum: ["map"] + enum: [map] values: type: object additionalProperties: @@ -6891,7 +7579,7 @@ components: properties: type: type: string - enum: ["query"] + enum: [query] values: type: object properties: @@ -6933,13 +7621,19 @@ components: items: type: string labels: - $ref: "#/components/schemas/Labels" + $ref: "#/components/schemas/Labels" arguments: type: object oneOf: - $ref: "#/components/schemas/QueryVariableProperties" - $ref: "#/components/schemas/ConstantVariableProperties" - $ref: "#/components/schemas/MapVariableProperties" + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time Variables: type: object example: @@ -6979,7 +7673,22 @@ components: type: array items: $ref: "#/components/schemas/Variable" + ViewProperties: + oneOf: + - $ref: "#/components/schemas/LinePlusSingleStatProperties" + - $ref: "#/components/schemas/XYViewProperties" + - $ref: "#/components/schemas/SingleStatViewProperties" + - $ref: "#/components/schemas/HistogramViewProperties" + - $ref: "#/components/schemas/GaugeViewProperties" + - $ref: "#/components/schemas/TableViewProperties" + - $ref: "#/components/schemas/MarkdownViewProperties" + - $ref: "#/components/schemas/CheckViewProperties" + - $ref: "#/components/schemas/ScatterViewProperties" + - $ref: "#/components/schemas/HeatmapViewProperties" View: + required: + - name + - properties properties: links: type: object @@ -6993,16 +7702,19 @@ components: name: type: string properties: - oneOf: - - $ref: "#/components/schemas/LinePlusSingleStatProperties" - - $ref: "#/components/schemas/XYViewProperties" - - $ref: "#/components/schemas/SingleStatViewProperties" - - $ref: "#/components/schemas/HistogramViewProperties" - - $ref: "#/components/schemas/GaugeViewProperties" - - $ref: "#/components/schemas/TableViewProperties" - - $ref: "#/components/schemas/MarkdownViewProperties" - - $ref: "#/components/schemas/LogViewProperties" - - $ref: "#/components/schemas/EmptyViewProperties" + $ref: '#/components/schemas/ViewProperties' + Views: + type: object + properties: + links: + type: object + properties: + self: + type: string + views: + type: array + items: + $ref: "#/components/schemas/View" CellUpdate: type: object properties: @@ -7170,7 +7882,7 @@ components: cells: $ref: "#/components/schemas/Cells" labels: - $ref: "#/components/schemas/Labels" + $ref: "#/components/schemas/Labels" Dashboards: type: object properties: @@ -7991,7 +8703,7 @@ components: up: type: string example: "14m45.911966424s" - Check: + HealthCheck: type: object required: - name @@ -8004,7 +8716,7 @@ components: checks: type: array items: - $ref: "#/components/schemas/Check" + $ref: "#/components/schemas/HealthCheck" status: type: string enum: @@ -8096,12 +8808,7 @@ components: description: The name of the organization that owns this Task. type: string status: - description: Starting state of the task. 'inactive' tasks are not run until they are updated to 'active' - default: active - type: string - enum: - - active - - inactive + $ref: "#/components/schemas/TaskStatusType" flux: description: The Flux script to run for this task. type: string @@ -8109,19 +8816,14 @@ components: description: An optional description of the task. type: string token: - description: The token to use for authenticating this task when it executes queries. If omitted, uses the token associated with the request that creates the task. + description: The token to use for authenticating this task when it executes queries. type: string - required: [flux] + required: [flux, token] TaskUpdateRequest: type: object properties: status: - description: Starting state of the task. 'inactive' tasks are not run until they are updated to 'active' - default: active - type: string - enum: - - active - - inactive + $ref: "#/components/schemas/TaskStatusType" flux: description: The Flux script to run for this task. type: string @@ -8143,6 +8845,360 @@ components: token: description: Override the existing token associated with the task. type: string + Check: + oneOf: + - $ref: "#/components/schemas/DeadmanCheck" + - $ref: "#/components/schemas/ThresholdCheck" + Checks: + properties: + checks: + type: array + items: + $ref: "#/components/schemas/Check" + links: + $ref: "#/components/schemas/Links" + CheckBase: + properties: + id: + readOnly: true + type: string + name: + type: string + orgID: + description: the ID of the organization that owns this check. + type: string + authorizationID: + description: The ID of the authorization used to create this check. + type: string + readOnly: true + createdAt: + type: string + format: date-time + readOnly: true + updatedAt: + type: string + format: date-time + readOnly: true + query: + $ref: "#/components/schemas/DashboardQuery" + status: + $ref: "#/components/schemas/TaskStatusType" + every: + description: Check repetition interval + type: string + offset: + description: Duration to delay after the schedule, before executing check. + type: string + cron: + description: Check repetition interval in the form '* * * * * *'; + type: string + tags: + description: tags to write to each status + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + description: + description: An optional description of the check + type: string + statusMessageTemplate: + description: template that is used to generate and write a status message + type: string + labels: + $ref: "#/components/schemas/Labels" + required: [name, orgID, query] + ThresholdCheck: + allOf: + - $ref: "#/components/schemas/CheckBase" + - type: object + properties: + type: + type: string + enum: [threshold] + thresholds: + type: array + items: + $ref: "#/components/schemas/Threshold" + DeadmanCheck: + allOf: + - $ref: "#/components/schemas/CheckBase" + - type: object + properties: + type: + type: string + enum: [deadman] + timeSince: + description: seconds before deadman triggers + type: integer + reportZero: + description: if only zero values reported since time, trigger alert + type: boolean + level: + $ref: "#/components/schemas/CheckStatusLevel" + Threshold: + properties: + level: + $ref: "#/components/schemas/CheckStatusLevel" + allValues: + description: if true, only alert if all values meet threshold + type: boolean + lowerBound: + type: number + format: float + upperBound: + type: number + format: float + CheckStatusLevel: + description: the state to record if check matches a criteria + type: string + enum: ["UNKNOWN", "OK", "INFO", "CRIT", "WARN"] + NotificationRuleUpdate: + type: object + properties: + name: + type: string + description: + type: string + status: + type: string + enum: + - active + - inactive + NotificationRule: + oneOf: + - $ref: "#/components/schemas/SlackNotificationRule" + - $ref: "#/components/schemas/SMTPNotificationRule" + - $ref: "#/components/schemas/PagerDutyNotificationRule" + NotificationRules: + properties: + notificationRules: + type: array + items: + $ref: "#/components/schemas/NotificationRule" + links: + $ref: "#/components/schemas/Links" + NotificationRuleBase: + type: object + required: + - id + - orgid + - status + - name + - tagRules + - statusRules + properties: + id: + readOnly: true + type: string + notifyEndpointID: + type: string + readOnly: true + orgID: + description: the ID of the organization that owns this notification rule. + type: string + authorizationID: + description: The ID of the authorization used to create this notification rule. + type: string + readOnly: true + createdAt: + type: string + format: date-time + readOnly: true + updatedAt: + type: string + format: date-time + readOnly: true + status: + $ref: "#/components/schemas/TaskStatusType" + name: + description: human-readable name describing the notification rule + type: string + sleepUntil: + type: string + every: + description: notification repetition interval + type: string + offset: + description: Duration to delay after the schedule, before executing check. + type: string + cron: + description: notification repetition interval in the form '* * * * * *'; + type: string + runbookLink: + type: string + limitEvery: + description: don't notify me more than times every seconds. If set, limit cannot be empty. + type: integer + limit: + description: don't notify me more than times every seconds. If set, limitEvery cannot be empty. + type: integer + tagRules: + description: list of tag rules the notification rule attempts to match + type: array + items: + $ref: "#/components/schemas/TagRule" + description: + description: An optional description of the notification rule + type: string + statusRules: + description: list of status rules the notification rule attempts to match + type: array + minItems: 1 + items: + $ref: "#/components/schemas/StatusRule" + labels: + $ref: "#/components/schemas/Labels" + TagRule: + type: object + properties: + key: + type: string + value: + type: string + operator: + type: string + enum: ["equal", "notequal", "equalregex","notequalregex"] + StatusRule: + type: object + properties: + currentLevel: + $ref: "#/components/schemas/LevelRule" + previousLevel: + $ref: "#/components/schemas/LevelRule" + count: + type: integer + period: + type: string + LevelRule: + type: object + properties: + level: + $ref: "#/components/schemas/CheckStatusLevel" + operation: + type: string + enum: ["equal", "notequal"] + SlackNotificationRule: + allOf: + - $ref: "#/components/schemas/NotificationRuleBase" + - type: object + required: [type, messageTemplate] + properties: + type: + type: string + enum: [slack] + channel: + type: string + messageTemplate: + type: string + SMTPNotificationRule: + allOf: + - $ref: "#/components/schemas/NotificationRuleBase" + - type: object + required: [type, subjectTemplate, to] + properties: + type: + type: string + enum: [smtp] + subjectTemplate: + type: string + bodyTemplate: + type: string + to: + type: string + PagerDutyNotificationRule: + allOf: + - $ref: "#/components/schemas/NotificationRuleBase" + - type: object + required: [type, messageTemplate] + properties: + type: + type: string + enum: [pagerduty] + messageTemplate: + type: string + NotificationEndpoint: + oneOf: + - $ref: "#/components/schemas/SlackNotificationEndpoint" + - $ref: "#/components/schemas/SMTPNotificationEndpoint" + - $ref: "#/components/schemas/PagerDutyNotificationEndpoint" + - $ref: "#/components/schemas/WebhookNotificationEndpoint" + NotificationEndpoints: + type: object + properties: + notificationEndpoints: + type: array + items: + $ref: "#/components/schemas/NotificationEndpoint" + links: + $ref: "#/components/schemas/Links" + NotificationEndpointBase: + type: object + properties: + id: + type: string + orgID: + type: string + userID: + type: string + createdAt: + type: string + format: date-time + readOnly: true + updatedAt: + type: string + format: date-time + readOnly: true + description: + description: An optional description of the notification endpoint + type: string + status: + description: The status of the endpoint. + default: active + type: string + enum: ["active", "inactive"] + labels: + $ref: "#/components/schemas/Labels" + required: [type] + SlackNotificationEndpoint: + type: object + allOf: + - $ref: "#/components/schemas/NotificationEndpointBase" + - type: object + properties: + name: + type: string + enum: ["slack"] + SMTPNotificationEndpoint: + type: object + allOf: + - $ref: "#/components/schemas/NotificationEndpointBase" + - type: object + properties: + name: + type: string + enum: ["smtp"] + PagerDutyNotificationEndpoint: + type: object + allOf: + - $ref: "#/components/schemas/NotificationEndpointBase" + - type: object + properties: + name: + type: string + enum: ["pagerduty"] + WebhookNotificationEndpoint: + type: object + allOf: + - $ref: "#/components/schemas/NotificationEndpointBase" + - type: object + properties: + name: + type: string + enum: ["webhook"] securitySchemes: BasicAuth: type: http diff --git a/test/__init__.py b/test/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/test/test_authorizations_api.py b/test/test_authorizations_api.py deleted file mode 100644 index ede98aa9..00000000 --- a/test/test_authorizations_api.py +++ /dev/null @@ -1,68 +0,0 @@ -# coding: utf-8 - -""" - Influx API Service - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: 0.1.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import influxdb2 -from influxdb2.api.authorizations_api import AuthorizationsApi # noqa: E501 -from influxdb2.rest import ApiException - - -class TestAuthorizationsApi(unittest.TestCase): - """AuthorizationsApi unit test stubs""" - - def setUp(self): - self.api = influxdb2.api.authorizations_api.AuthorizationsApi() # noqa: E501 - - def tearDown(self): - pass - - def test_delete_authorizations_id(self): - """Test case for delete_authorizations_id - - Delete a authorization # noqa: E501 - """ - pass - - def test_get_authorizations(self): - """Test case for get_authorizations - - List all authorizations # noqa: E501 - """ - pass - - def test_get_authorizations_id(self): - """Test case for get_authorizations_id - - Retrieve an authorization # noqa: E501 - """ - pass - - def test_patch_authorizations_id(self): - """Test case for patch_authorizations_id - - update authorization to be active or inactive. requests using an inactive authorization will be rejected. # noqa: E501 - """ - pass - - def test_post_authorizations(self): - """Test case for post_authorizations - - Create an authorization # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_buckets_api.py b/test/test_buckets_api.py deleted file mode 100644 index c3548f9b..00000000 --- a/test/test_buckets_api.py +++ /dev/null @@ -1,145 +0,0 @@ -# coding: utf-8 - -""" - Influx API Service - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: 0.1.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import influxdb2 -from influxdb2.api.buckets_api import BucketsApi # noqa: E501 -from influxdb2.rest import ApiException - - -class TestBucketsApi(unittest.TestCase): - """BucketsApi unit test stubs""" - - def setUp(self): - self.api = influxdb2.api.buckets_api.BucketsApi() # noqa: E501 - - def tearDown(self): - pass - - def test_delete_buckets_id(self): - """Test case for delete_buckets_id - - Delete a bucket # noqa: E501 - """ - pass - - def test_delete_buckets_id_labels_id(self): - """Test case for delete_buckets_id_labels_id - - delete a label from a bucket # noqa: E501 - """ - pass - - def test_delete_buckets_id_members_id(self): - """Test case for delete_buckets_id_members_id - - removes a member from an bucket # noqa: E501 - """ - pass - - def test_delete_buckets_id_owners_id(self): - """Test case for delete_buckets_id_owners_id - - removes an owner from a bucket # noqa: E501 - """ - pass - - def test_get_buckets(self): - """Test case for get_buckets - - List all buckets # noqa: E501 - """ - pass - - def test_get_buckets_id(self): - """Test case for get_buckets_id - - Retrieve a bucket # noqa: E501 - """ - pass - - def test_get_buckets_id_labels(self): - """Test case for get_buckets_id_labels - - list all labels for a bucket # noqa: E501 - """ - pass - - def test_get_buckets_id_logs(self): - """Test case for get_buckets_id_logs - - Retrieve operation logs for a bucket # noqa: E501 - """ - pass - - def test_get_buckets_id_members(self): - """Test case for get_buckets_id_members - - List all users with member privileges for a bucket # noqa: E501 - """ - pass - - def test_get_buckets_id_owners(self): - """Test case for get_buckets_id_owners - - List all owners of a bucket # noqa: E501 - """ - pass - - def test_get_sources_id_buckets(self): - """Test case for get_sources_id_buckets - - Get a sources buckets (will return dbrps in the form of buckets if it is a v1 source) # noqa: E501 - """ - pass - - def test_patch_buckets_id(self): - """Test case for patch_buckets_id - - Update a bucket # noqa: E501 - """ - pass - - def test_post_buckets(self): - """Test case for post_buckets - - Create a bucket # noqa: E501 - """ - pass - - def test_post_buckets_id_labels(self): - """Test case for post_buckets_id_labels - - add a label to a bucket # noqa: E501 - """ - pass - - def test_post_buckets_id_members(self): - """Test case for post_buckets_id_members - - Add bucket member # noqa: E501 - """ - pass - - def test_post_buckets_id_owners(self): - """Test case for post_buckets_id_owners - - Add bucket owner # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_cells_api.py b/test/test_cells_api.py deleted file mode 100644 index 8fe6d110..00000000 --- a/test/test_cells_api.py +++ /dev/null @@ -1,75 +0,0 @@ -# coding: utf-8 - -""" - Influx API Service - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: 0.1.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import influxdb2 -from influxdb2.api.cells_api import CellsApi # noqa: E501 -from influxdb2.rest import ApiException - - -class TestCellsApi(unittest.TestCase): - """CellsApi unit test stubs""" - - def setUp(self): - self.api = influxdb2.api.cells_api.CellsApi() # noqa: E501 - - def tearDown(self): - pass - - def test_delete_dashboards_id_cells_id(self): - """Test case for delete_dashboards_id_cells_id - - Delete a dashboard cell # noqa: E501 - """ - pass - - def test_get_dashboards_id_cells_id_view(self): - """Test case for get_dashboards_id_cells_id_view - - Retrieve the view for a cell in a dashboard # noqa: E501 - """ - pass - - def test_patch_dashboards_id_cells_id(self): - """Test case for patch_dashboards_id_cells_id - - Update the non positional information related to a cell (because updates to a single cells positional data could cause grid conflicts) # noqa: E501 - """ - pass - - def test_patch_dashboards_id_cells_id_view(self): - """Test case for patch_dashboards_id_cells_id_view - - Update the view for a cell # noqa: E501 - """ - pass - - def test_post_dashboards_id_cells(self): - """Test case for post_dashboards_id_cells - - Create a dashboard cell # noqa: E501 - """ - pass - - def test_put_dashboards_id_cells(self): - """Test case for put_dashboards_id_cells - - Replace a dashboards cells # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_dashboards_api.py b/test/test_dashboards_api.py deleted file mode 100644 index 7330a91b..00000000 --- a/test/test_dashboards_api.py +++ /dev/null @@ -1,180 +0,0 @@ -# coding: utf-8 - -""" - Influx API Service - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: 0.1.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import influxdb2 -from influxdb2.api.dashboards_api import DashboardsApi # noqa: E501 -from influxdb2.rest import ApiException - - -class TestDashboardsApi(unittest.TestCase): - """DashboardsApi unit test stubs""" - - def setUp(self): - self.api = influxdb2.api.dashboards_api.DashboardsApi() # noqa: E501 - - def tearDown(self): - pass - - def test_delete_dashboards_id(self): - """Test case for delete_dashboards_id - - Delete a dashboard # noqa: E501 - """ - pass - - def test_delete_dashboards_id_cells_id(self): - """Test case for delete_dashboards_id_cells_id - - Delete a dashboard cell # noqa: E501 - """ - pass - - def test_delete_dashboards_id_labels_id(self): - """Test case for delete_dashboards_id_labels_id - - delete a label from a dashboard # noqa: E501 - """ - pass - - def test_delete_dashboards_id_members_id(self): - """Test case for delete_dashboards_id_members_id - - removes a member from an dashboard # noqa: E501 - """ - pass - - def test_delete_dashboards_id_owners_id(self): - """Test case for delete_dashboards_id_owners_id - - removes an owner from a dashboard # noqa: E501 - """ - pass - - def test_get_dashboards(self): - """Test case for get_dashboards - - Get all dashboards # noqa: E501 - """ - pass - - def test_get_dashboards_id(self): - """Test case for get_dashboards_id - - Get a single Dashboard # noqa: E501 - """ - pass - - def test_get_dashboards_id_cells_id_view(self): - """Test case for get_dashboards_id_cells_id_view - - Retrieve the view for a cell in a dashboard # noqa: E501 - """ - pass - - def test_get_dashboards_id_labels(self): - """Test case for get_dashboards_id_labels - - list all labels for a dashboard # noqa: E501 - """ - pass - - def test_get_dashboards_id_logs(self): - """Test case for get_dashboards_id_logs - - Retrieve operation logs for a dashboard # noqa: E501 - """ - pass - - def test_get_dashboards_id_members(self): - """Test case for get_dashboards_id_members - - List all dashboard members # noqa: E501 - """ - pass - - def test_get_dashboards_id_owners(self): - """Test case for get_dashboards_id_owners - - List all dashboard owners # noqa: E501 - """ - pass - - def test_patch_dashboards_id(self): - """Test case for patch_dashboards_id - - Update a single dashboard # noqa: E501 - """ - pass - - def test_patch_dashboards_id_cells_id(self): - """Test case for patch_dashboards_id_cells_id - - Update the non positional information related to a cell (because updates to a single cells positional data could cause grid conflicts) # noqa: E501 - """ - pass - - def test_patch_dashboards_id_cells_id_view(self): - """Test case for patch_dashboards_id_cells_id_view - - Update the view for a cell # noqa: E501 - """ - pass - - def test_post_dashboards(self): - """Test case for post_dashboards - - Create a dashboard # noqa: E501 - """ - pass - - def test_post_dashboards_id_cells(self): - """Test case for post_dashboards_id_cells - - Create a dashboard cell # noqa: E501 - """ - pass - - def test_post_dashboards_id_labels(self): - """Test case for post_dashboards_id_labels - - add a label to a dashboard # noqa: E501 - """ - pass - - def test_post_dashboards_id_members(self): - """Test case for post_dashboards_id_members - - Add dashboard member # noqa: E501 - """ - pass - - def test_post_dashboards_id_owners(self): - """Test case for post_dashboards_id_owners - - Add dashboard owner # noqa: E501 - """ - pass - - def test_put_dashboards_id_cells(self): - """Test case for put_dashboards_id_cells - - Replace a dashboards cells # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_default_api.py b/test/test_default_api.py deleted file mode 100644 index f9e59133..00000000 --- a/test/test_default_api.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - Influx API Service - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: 0.1.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import influxdb2 -from influxdb2.api.default_api import DefaultApi # noqa: E501 -from influxdb2.rest import ApiException - - -class TestDefaultApi(unittest.TestCase): - """DefaultApi unit test stubs""" - - def setUp(self): - self.api = influxdb2.api.default_api.DefaultApi() # noqa: E501 - - def tearDown(self): - pass - - def test_get_routes(self): - """Test case for get_routes - - Map of all top level routes available # noqa: E501 - """ - pass - - def test_post_signin(self): - """Test case for post_signin - - Exchange basic auth credentials for session # noqa: E501 - """ - pass - - def test_post_signout(self): - """Test case for post_signout - - Expire the current session # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_health_api.py b/test/test_health_api.py deleted file mode 100644 index a201c82b..00000000 --- a/test/test_health_api.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - Influx API Service - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: 0.1.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import influxdb2 -from influxdb2.api.health_api import HealthApi # noqa: E501 -from influxdb2.rest import ApiException - - -class TestHealthApi(unittest.TestCase): - """HealthApi unit test stubs""" - - def setUp(self): - self.api = influxdb2.api.health_api.HealthApi() # noqa: E501 - - def tearDown(self): - pass - - def test_get_health(self): - """Test case for get_health - - Get the health of an instance anytime during execution. Allow us to check if the instance is still healthy. # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_labels_api.py b/test/test_labels_api.py deleted file mode 100644 index be91d9d6..00000000 --- a/test/test_labels_api.py +++ /dev/null @@ -1,68 +0,0 @@ -# coding: utf-8 - -""" - Influx API Service - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: 0.1.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import influxdb2 -from influxdb2.api.labels_api import LabelsApi # noqa: E501 -from influxdb2.rest import ApiException - - -class TestLabelsApi(unittest.TestCase): - """LabelsApi unit test stubs""" - - def setUp(self): - self.api = influxdb2.api.labels_api.LabelsApi() # noqa: E501 - - def tearDown(self): - pass - - def test_delete_labels_id(self): - """Test case for delete_labels_id - - Delete a label # noqa: E501 - """ - pass - - def test_get_labels(self): - """Test case for get_labels - - Get all labels # noqa: E501 - """ - pass - - def test_get_labels_id(self): - """Test case for get_labels_id - - Get a label # noqa: E501 - """ - pass - - def test_patch_labels_id(self): - """Test case for patch_labels_id - - Update a single label # noqa: E501 - """ - pass - - def test_post_labels(self): - """Test case for post_labels - - Create a label # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_operation_logs_api.py b/test/test_operation_logs_api.py deleted file mode 100644 index 75603c8e..00000000 --- a/test/test_operation_logs_api.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding: utf-8 - -""" - Influx API Service - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: 0.1.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import influxdb2 -from influxdb2.api.operation_logs_api import OperationLogsApi # noqa: E501 -from influxdb2.rest import ApiException - - -class TestOperationLogsApi(unittest.TestCase): - """OperationLogsApi unit test stubs""" - - def setUp(self): - self.api = influxdb2.api.operation_logs_api.OperationLogsApi() # noqa: E501 - - def tearDown(self): - pass - - def test_get_buckets_id_logs(self): - """Test case for get_buckets_id_logs - - Retrieve operation logs for a bucket # noqa: E501 - """ - pass - - def test_get_dashboards_id_logs(self): - """Test case for get_dashboards_id_logs - - Retrieve operation logs for a dashboard # noqa: E501 - """ - pass - - def test_get_orgs_id_logs(self): - """Test case for get_orgs_id_logs - - Retrieve operation logs for an organization # noqa: E501 - """ - pass - - def test_get_users_id_logs(self): - """Test case for get_users_id_logs - - Retrieve operation logs for a user # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_organizations_api.py b/test/test_organizations_api.py deleted file mode 100644 index 29c20e3e..00000000 --- a/test/test_organizations_api.py +++ /dev/null @@ -1,159 +0,0 @@ -# coding: utf-8 - -""" - Influx API Service - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: 0.1.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import influxdb2 -from influxdb2.api.organizations_api import OrganizationsApi # noqa: E501 -from influxdb2.rest import ApiException - - -class TestOrganizationsApi(unittest.TestCase): - """OrganizationsApi unit test stubs""" - - def setUp(self): - self.api = influxdb2.api.organizations_api.OrganizationsApi() # noqa: E501 - - def tearDown(self): - pass - - def test_delete_orgs_id(self): - """Test case for delete_orgs_id - - Delete an organization # noqa: E501 - """ - pass - - def test_delete_orgs_id_labels_id(self): - """Test case for delete_orgs_id_labels_id - - delete a label from an organization # noqa: E501 - """ - pass - - def test_delete_orgs_id_members_id(self): - """Test case for delete_orgs_id_members_id - - removes a member from an organization # noqa: E501 - """ - pass - - def test_delete_orgs_id_owners_id(self): - """Test case for delete_orgs_id_owners_id - - removes an owner from an organization # noqa: E501 - """ - pass - - def test_get_orgs(self): - """Test case for get_orgs - - List all organizations # noqa: E501 - """ - pass - - def test_get_orgs_id(self): - """Test case for get_orgs_id - - Retrieve an organization # noqa: E501 - """ - pass - - def test_get_orgs_id_labels(self): - """Test case for get_orgs_id_labels - - list all labels for a organization # noqa: E501 - """ - pass - - def test_get_orgs_id_logs(self): - """Test case for get_orgs_id_logs - - Retrieve operation logs for an organization # noqa: E501 - """ - pass - - def test_get_orgs_id_members(self): - """Test case for get_orgs_id_members - - List all members of an organization # noqa: E501 - """ - pass - - def test_get_orgs_id_owners(self): - """Test case for get_orgs_id_owners - - List all owners of an organization # noqa: E501 - """ - pass - - def test_get_orgs_id_secrets(self): - """Test case for get_orgs_id_secrets - - List all secret keys for an organization # noqa: E501 - """ - pass - - def test_patch_orgs_id(self): - """Test case for patch_orgs_id - - Update an organization # noqa: E501 - """ - pass - - def test_patch_orgs_id_secrets(self): - """Test case for patch_orgs_id_secrets - - Apply patch to the provided secrets # noqa: E501 - """ - pass - - def test_post_orgs(self): - """Test case for post_orgs - - Create an organization # noqa: E501 - """ - pass - - def test_post_orgs_id_labels(self): - """Test case for post_orgs_id_labels - - add a label to an organization # noqa: E501 - """ - pass - - def test_post_orgs_id_members(self): - """Test case for post_orgs_id_members - - Add organization member # noqa: E501 - """ - pass - - def test_post_orgs_id_owners(self): - """Test case for post_orgs_id_owners - - Add organization owner # noqa: E501 - """ - pass - - def test_post_orgs_id_secrets(self): - """Test case for post_orgs_id_secrets - - delete provided secrets # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_query_api.py b/test/test_query_api.py deleted file mode 100644 index 625b1d8c..00000000 --- a/test/test_query_api.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding: utf-8 - -""" - Influx API Service - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: 0.1.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import influxdb2 -from influxdb2.api.query_api import QueryApi # noqa: E501 -from influxdb2.rest import ApiException - - -class TestQueryApi(unittest.TestCase): - """QueryApi unit test stubs""" - - def setUp(self): - self.api = influxdb2.api.query_api.QueryApi() # noqa: E501 - - def tearDown(self): - pass - - def test_get_query_suggestions(self): - """Test case for get_query_suggestions - - """ - pass - - def test_get_query_suggestions_name(self): - """Test case for get_query_suggestions_name - - """ - pass - - def test_post_query(self): - """Test case for post_query - - query an influx # noqa: E501 - """ - pass - - def test_post_query_analyze(self): - """Test case for post_query_analyze - - analyze an influxql or flux query # noqa: E501 - """ - pass - - def test_post_query_ast(self): - """Test case for post_query_ast - - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_ready_api.py b/test/test_ready_api.py deleted file mode 100644 index f80edf8b..00000000 --- a/test/test_ready_api.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - Influx API Service - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: 0.1.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import influxdb2 -from influxdb2.api.ready_api import ReadyApi # noqa: E501 -from influxdb2.rest import ApiException - - -class TestReadyApi(unittest.TestCase): - """ReadyApi unit test stubs""" - - def setUp(self): - self.api = influxdb2.api.ready_api.ReadyApi() # noqa: E501 - - def tearDown(self): - pass - - def test_get_ready(self): - """Test case for get_ready - - Get the readiness of a instance at startup. Allow us to confirm the instance is prepared to accept requests. # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_scraper_targets_api.py b/test/test_scraper_targets_api.py deleted file mode 100644 index 2478f57d..00000000 --- a/test/test_scraper_targets_api.py +++ /dev/null @@ -1,138 +0,0 @@ -# coding: utf-8 - -""" - Influx API Service - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: 0.1.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import influxdb2 -from influxdb2.api.scraper_targets_api import ScraperTargetsApi # noqa: E501 -from influxdb2.rest import ApiException - - -class TestScraperTargetsApi(unittest.TestCase): - """ScraperTargetsApi unit test stubs""" - - def setUp(self): - self.api = influxdb2.api.scraper_targets_api.ScraperTargetsApi() # noqa: E501 - - def tearDown(self): - pass - - def test_delete_scrapers_id(self): - """Test case for delete_scrapers_id - - delete a scraper target # noqa: E501 - """ - pass - - def test_delete_scrapers_id_labels_id(self): - """Test case for delete_scrapers_id_labels_id - - delete a label from a scraper target # noqa: E501 - """ - pass - - def test_delete_scrapers_id_members_id(self): - """Test case for delete_scrapers_id_members_id - - removes a member from a scraper target # noqa: E501 - """ - pass - - def test_delete_scrapers_id_owners_id(self): - """Test case for delete_scrapers_id_owners_id - - removes an owner from a scraper target # noqa: E501 - """ - pass - - def test_get_scrapers(self): - """Test case for get_scrapers - - get all scraper targets # noqa: E501 - """ - pass - - def test_get_scrapers_id(self): - """Test case for get_scrapers_id - - get a scraper target by id # noqa: E501 - """ - pass - - def test_get_scrapers_id_labels(self): - """Test case for get_scrapers_id_labels - - list all labels for a scraper targets # noqa: E501 - """ - pass - - def test_get_scrapers_id_members(self): - """Test case for get_scrapers_id_members - - List all users with member privileges for a scraper target # noqa: E501 - """ - pass - - def test_get_scrapers_id_owners(self): - """Test case for get_scrapers_id_owners - - List all owners of a scraper target # noqa: E501 - """ - pass - - def test_patch_scrapers_id(self): - """Test case for patch_scrapers_id - - update a scraper target # noqa: E501 - """ - pass - - def test_patch_scrapers_id_labels_id(self): - """Test case for patch_scrapers_id_labels_id - - update a label from a scraper target # noqa: E501 - """ - pass - - def test_post_scrapers(self): - """Test case for post_scrapers - - create a scraper target # noqa: E501 - """ - pass - - def test_post_scrapers_id_labels(self): - """Test case for post_scrapers_id_labels - - add a label to a scraper target # noqa: E501 - """ - pass - - def test_post_scrapers_id_members(self): - """Test case for post_scrapers_id_members - - Add scraper target member # noqa: E501 - """ - pass - - def test_post_scrapers_id_owners(self): - """Test case for post_scrapers_id_owners - - Add scraper target owner # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_secrets_api.py b/test/test_secrets_api.py deleted file mode 100644 index 36410fb2..00000000 --- a/test/test_secrets_api.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - Influx API Service - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: 0.1.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import influxdb2 -from influxdb2.api.secrets_api import SecretsApi # noqa: E501 -from influxdb2.rest import ApiException - - -class TestSecretsApi(unittest.TestCase): - """SecretsApi unit test stubs""" - - def setUp(self): - self.api = influxdb2.api.secrets_api.SecretsApi() # noqa: E501 - - def tearDown(self): - pass - - def test_get_orgs_id_secrets(self): - """Test case for get_orgs_id_secrets - - List all secret keys for an organization # noqa: E501 - """ - pass - - def test_patch_orgs_id_secrets(self): - """Test case for patch_orgs_id_secrets - - Apply patch to the provided secrets # noqa: E501 - """ - pass - - def test_post_orgs_id_secrets(self): - """Test case for post_orgs_id_secrets - - delete provided secrets # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_setup_api.py b/test/test_setup_api.py deleted file mode 100644 index 5bbb9e68..00000000 --- a/test/test_setup_api.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding: utf-8 - -""" - Influx API Service - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: 0.1.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import influxdb2 -from influxdb2.api.setup_api import SetupApi # noqa: E501 -from influxdb2.rest import ApiException - - -class TestSetupApi(unittest.TestCase): - """SetupApi unit test stubs""" - - def setUp(self): - self.api = influxdb2.api.setup_api.SetupApi() # noqa: E501 - - def tearDown(self): - pass - - def test_get_setup(self): - """Test case for get_setup - - check if database has default user, org, bucket created, returns true if not. # noqa: E501 - """ - pass - - def test_post_setup(self): - """Test case for post_setup - - post onboarding request, to setup initial user, org and bucket # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_sources_api.py b/test/test_sources_api.py deleted file mode 100644 index 61ee181f..00000000 --- a/test/test_sources_api.py +++ /dev/null @@ -1,82 +0,0 @@ -# coding: utf-8 - -""" - Influx API Service - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: 0.1.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import influxdb2 -from influxdb2.api.sources_api import SourcesApi # noqa: E501 -from influxdb2.rest import ApiException - - -class TestSourcesApi(unittest.TestCase): - """SourcesApi unit test stubs""" - - def setUp(self): - self.api = influxdb2.api.sources_api.SourcesApi() # noqa: E501 - - def tearDown(self): - pass - - def test_delete_sources_id(self): - """Test case for delete_sources_id - - Delete a source # noqa: E501 - """ - pass - - def test_get_sources(self): - """Test case for get_sources - - Get all sources # noqa: E501 - """ - pass - - def test_get_sources_id(self): - """Test case for get_sources_id - - Get a source # noqa: E501 - """ - pass - - def test_get_sources_id_buckets(self): - """Test case for get_sources_id_buckets - - Get a sources buckets (will return dbrps in the form of buckets if it is a v1 source) # noqa: E501 - """ - pass - - def test_get_sources_id_health(self): - """Test case for get_sources_id_health - - Get a sources health # noqa: E501 - """ - pass - - def test_patch_sources_id(self): - """Test case for patch_sources_id - - Updates a Source # noqa: E501 - """ - pass - - def test_post_sources(self): - """Test case for post_sources - - Creates a Source # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_tasks_api.py b/test/test_tasks_api.py deleted file mode 100644 index 1585a982..00000000 --- a/test/test_tasks_api.py +++ /dev/null @@ -1,180 +0,0 @@ -# coding: utf-8 - -""" - Influx API Service - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: 0.1.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import influxdb2 -from influxdb2.api.tasks_api import TasksApi # noqa: E501 -from influxdb2.rest import ApiException - - -class TestTasksApi(unittest.TestCase): - """TasksApi unit test stubs""" - - def setUp(self): - self.api = influxdb2.api.tasks_api.TasksApi() # noqa: E501 - - def tearDown(self): - pass - - def test_delete_tasks_id(self): - """Test case for delete_tasks_id - - Delete a task # noqa: E501 - """ - pass - - def test_delete_tasks_id_labels_id(self): - """Test case for delete_tasks_id_labels_id - - delete a label from a task # noqa: E501 - """ - pass - - def test_delete_tasks_id_members_id(self): - """Test case for delete_tasks_id_members_id - - removes a member from an task # noqa: E501 - """ - pass - - def test_delete_tasks_id_owners_id(self): - """Test case for delete_tasks_id_owners_id - - removes an owner from an task # noqa: E501 - """ - pass - - def test_get_tasks(self): - """Test case for get_tasks - - List tasks. # noqa: E501 - """ - pass - - def test_get_tasks_id(self): - """Test case for get_tasks_id - - Retrieve an task # noqa: E501 - """ - pass - - def test_get_tasks_id_labels(self): - """Test case for get_tasks_id_labels - - list all labels for a task # noqa: E501 - """ - pass - - def test_get_tasks_id_logs(self): - """Test case for get_tasks_id_logs - - Retrieve all logs for a task # noqa: E501 - """ - pass - - def test_get_tasks_id_members(self): - """Test case for get_tasks_id_members - - List all task members # noqa: E501 - """ - pass - - def test_get_tasks_id_owners(self): - """Test case for get_tasks_id_owners - - List all task owners # noqa: E501 - """ - pass - - def test_get_tasks_id_runs(self): - """Test case for get_tasks_id_runs - - Retrieve list of run records for a task # noqa: E501 - """ - pass - - def test_get_tasks_id_runs_id(self): - """Test case for get_tasks_id_runs_id - - Retrieve a single run record for a task # noqa: E501 - """ - pass - - def test_get_tasks_id_runs_id_logs(self): - """Test case for get_tasks_id_runs_id_logs - - Retrieve all logs for a run # noqa: E501 - """ - pass - - def test_patch_tasks_id(self): - """Test case for patch_tasks_id - - Update a task # noqa: E501 - """ - pass - - def test_post_tasks(self): - """Test case for post_tasks - - Create a new task # noqa: E501 - """ - pass - - def test_post_tasks_id_labels(self): - """Test case for post_tasks_id_labels - - add a label to a task # noqa: E501 - """ - pass - - def test_post_tasks_id_members(self): - """Test case for post_tasks_id_members - - Add task member # noqa: E501 - """ - pass - - def test_post_tasks_id_owners(self): - """Test case for post_tasks_id_owners - - Add task owner # noqa: E501 - """ - pass - - def test_post_tasks_id_runs(self): - """Test case for post_tasks_id_runs - - manually start a run of the task now overriding the current schedule. # noqa: E501 - """ - pass - - def test_post_tasks_id_runs_id_retry(self): - """Test case for post_tasks_id_runs_id_retry - - Retry a task run # noqa: E501 - """ - pass - - def test_tasks_task_id_runs_run_id_delete(self): - """Test case for tasks_task_id_runs_run_id_delete - - Cancel a run # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_telegrafs_api.py b/test/test_telegrafs_api.py deleted file mode 100644 index 3436ac12..00000000 --- a/test/test_telegrafs_api.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" - Influx API Service - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: 0.1.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import influxdb2 -from influxdb2.api.telegrafs_api import TelegrafsApi # noqa: E501 -from influxdb2.rest import ApiException - - -class TestTelegrafsApi(unittest.TestCase): - """TelegrafsApi unit test stubs""" - - def setUp(self): - self.api = influxdb2.api.telegrafs_api.TelegrafsApi() # noqa: E501 - - def tearDown(self): - pass - - def test_delete_telegrafs_id(self): - """Test case for delete_telegrafs_id - - delete a telegraf config # noqa: E501 - """ - pass - - def test_delete_telegrafs_id_labels_id(self): - """Test case for delete_telegrafs_id_labels_id - - delete a label from a telegraf config # noqa: E501 - """ - pass - - def test_delete_telegrafs_id_members_id(self): - """Test case for delete_telegrafs_id_members_id - - removes a member from a telegraf config # noqa: E501 - """ - pass - - def test_delete_telegrafs_id_owners_id(self): - """Test case for delete_telegrafs_id_owners_id - - removes an owner from a telegraf config # noqa: E501 - """ - pass - - def test_get_telegrafs(self): - """Test case for get_telegrafs - - """ - pass - - def test_get_telegrafs_id(self): - """Test case for get_telegrafs_id - - Retrieve a telegraf config # noqa: E501 - """ - pass - - def test_get_telegrafs_id_labels(self): - """Test case for get_telegrafs_id_labels - - list all labels for a telegraf config # noqa: E501 - """ - pass - - def test_get_telegrafs_id_members(self): - """Test case for get_telegrafs_id_members - - List all users with member privileges for a telegraf config # noqa: E501 - """ - pass - - def test_get_telegrafs_id_owners(self): - """Test case for get_telegrafs_id_owners - - List all owners of a telegraf config # noqa: E501 - """ - pass - - def test_post_telegrafs(self): - """Test case for post_telegrafs - - Create a telegraf config # noqa: E501 - """ - pass - - def test_post_telegrafs_id_labels(self): - """Test case for post_telegrafs_id_labels - - add a label to a telegraf config # noqa: E501 - """ - pass - - def test_post_telegrafs_id_members(self): - """Test case for post_telegrafs_id_members - - Add telegraf config member # noqa: E501 - """ - pass - - def test_post_telegrafs_id_owners(self): - """Test case for post_telegrafs_id_owners - - Add telegraf config owner # noqa: E501 - """ - pass - - def test_put_telegrafs_id(self): - """Test case for put_telegrafs_id - - Update a telegraf config # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_templates_api.py b/test/test_templates_api.py deleted file mode 100644 index 2cc89ba1..00000000 --- a/test/test_templates_api.py +++ /dev/null @@ -1,86 +0,0 @@ -# coding: utf-8 - -""" - Influx API Service - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: 0.1.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import influxdb2 -from influxdb2.api.templates_api import TemplatesApi # noqa: E501 -from influxdb2.rest import ApiException - - -class TestTemplatesApi(unittest.TestCase): - """TemplatesApi unit test stubs""" - - def setUp(self): - self.api = influxdb2.api.templates_api.TemplatesApi() # noqa: E501 - - def tearDown(self): - pass - - def test_delete_documents_templates_id(self): - """Test case for delete_documents_templates_id - - delete a template document # noqa: E501 - """ - pass - - def test_delete_documents_templates_id_labels_id(self): - """Test case for delete_documents_templates_id_labels_id - - delete a label from a template # noqa: E501 - """ - pass - - def test_get_documents_templates(self): - """Test case for get_documents_templates - - """ - pass - - def test_get_documents_templates_id(self): - """Test case for get_documents_templates_id - - """ - pass - - def test_get_documents_templates_id_labels(self): - """Test case for get_documents_templates_id_labels - - list all labels for a template # noqa: E501 - """ - pass - - def test_post_documents_templates(self): - """Test case for post_documents_templates - - Create a template # noqa: E501 - """ - pass - - def test_post_documents_templates_id_labels(self): - """Test case for post_documents_templates_id_labels - - add a label to a template # noqa: E501 - """ - pass - - def test_put_documents_templates_id(self): - """Test case for put_documents_templates_id - - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_users_api.py b/test/test_users_api.py deleted file mode 100644 index 46f4b221..00000000 --- a/test/test_users_api.py +++ /dev/null @@ -1,348 +0,0 @@ -# coding: utf-8 - -""" - Influx API Service - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: 0.1.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import influxdb2 -from influxdb2.api.users_api import UsersApi # noqa: E501 -from influxdb2.rest import ApiException - - -class TestUsersApi(unittest.TestCase): - """UsersApi unit test stubs""" - - def setUp(self): - self.api = influxdb2.api.users_api.UsersApi() # noqa: E501 - - def tearDown(self): - pass - - def test_delete_buckets_id_members_id(self): - """Test case for delete_buckets_id_members_id - - removes a member from an bucket # noqa: E501 - """ - pass - - def test_delete_buckets_id_owners_id(self): - """Test case for delete_buckets_id_owners_id - - removes an owner from a bucket # noqa: E501 - """ - pass - - def test_delete_dashboards_id_members_id(self): - """Test case for delete_dashboards_id_members_id - - removes a member from an dashboard # noqa: E501 - """ - pass - - def test_delete_dashboards_id_owners_id(self): - """Test case for delete_dashboards_id_owners_id - - removes an owner from a dashboard # noqa: E501 - """ - pass - - def test_delete_orgs_id_members_id(self): - """Test case for delete_orgs_id_members_id - - removes a member from an organization # noqa: E501 - """ - pass - - def test_delete_orgs_id_owners_id(self): - """Test case for delete_orgs_id_owners_id - - removes an owner from an organization # noqa: E501 - """ - pass - - def test_delete_scrapers_id_members_id(self): - """Test case for delete_scrapers_id_members_id - - removes a member from a scraper target # noqa: E501 - """ - pass - - def test_delete_scrapers_id_owners_id(self): - """Test case for delete_scrapers_id_owners_id - - removes an owner from a scraper target # noqa: E501 - """ - pass - - def test_delete_tasks_id_members_id(self): - """Test case for delete_tasks_id_members_id - - removes a member from an task # noqa: E501 - """ - pass - - def test_delete_tasks_id_owners_id(self): - """Test case for delete_tasks_id_owners_id - - removes an owner from an task # noqa: E501 - """ - pass - - def test_delete_telegrafs_id_members_id(self): - """Test case for delete_telegrafs_id_members_id - - removes a member from a telegraf config # noqa: E501 - """ - pass - - def test_delete_telegrafs_id_owners_id(self): - """Test case for delete_telegrafs_id_owners_id - - removes an owner from a telegraf config # noqa: E501 - """ - pass - - def test_delete_users_id(self): - """Test case for delete_users_id - - deletes a user # noqa: E501 - """ - pass - - def test_get_buckets_id_members(self): - """Test case for get_buckets_id_members - - List all users with member privileges for a bucket # noqa: E501 - """ - pass - - def test_get_buckets_id_owners(self): - """Test case for get_buckets_id_owners - - List all owners of a bucket # noqa: E501 - """ - pass - - def test_get_dashboards_id_members(self): - """Test case for get_dashboards_id_members - - List all dashboard members # noqa: E501 - """ - pass - - def test_get_dashboards_id_owners(self): - """Test case for get_dashboards_id_owners - - List all dashboard owners # noqa: E501 - """ - pass - - def test_get_me(self): - """Test case for get_me - - Returns currently authenticated user # noqa: E501 - """ - pass - - def test_get_orgs_id_members(self): - """Test case for get_orgs_id_members - - List all members of an organization # noqa: E501 - """ - pass - - def test_get_orgs_id_owners(self): - """Test case for get_orgs_id_owners - - List all owners of an organization # noqa: E501 - """ - pass - - def test_get_scrapers_id_members(self): - """Test case for get_scrapers_id_members - - List all users with member privileges for a scraper target # noqa: E501 - """ - pass - - def test_get_scrapers_id_owners(self): - """Test case for get_scrapers_id_owners - - List all owners of a scraper target # noqa: E501 - """ - pass - - def test_get_tasks_id_members(self): - """Test case for get_tasks_id_members - - List all task members # noqa: E501 - """ - pass - - def test_get_tasks_id_owners(self): - """Test case for get_tasks_id_owners - - List all task owners # noqa: E501 - """ - pass - - def test_get_telegrafs_id_members(self): - """Test case for get_telegrafs_id_members - - List all users with member privileges for a telegraf config # noqa: E501 - """ - pass - - def test_get_telegrafs_id_owners(self): - """Test case for get_telegrafs_id_owners - - List all owners of a telegraf config # noqa: E501 - """ - pass - - def test_get_users(self): - """Test case for get_users - - List all users # noqa: E501 - """ - pass - - def test_get_users_id(self): - """Test case for get_users_id - - Retrieve a user # noqa: E501 - """ - pass - - def test_get_users_id_logs(self): - """Test case for get_users_id_logs - - Retrieve operation logs for a user # noqa: E501 - """ - pass - - def test_patch_users_id(self): - """Test case for patch_users_id - - Update a user # noqa: E501 - """ - pass - - def test_post_buckets_id_members(self): - """Test case for post_buckets_id_members - - Add bucket member # noqa: E501 - """ - pass - - def test_post_buckets_id_owners(self): - """Test case for post_buckets_id_owners - - Add bucket owner # noqa: E501 - """ - pass - - def test_post_dashboards_id_members(self): - """Test case for post_dashboards_id_members - - Add dashboard member # noqa: E501 - """ - pass - - def test_post_dashboards_id_owners(self): - """Test case for post_dashboards_id_owners - - Add dashboard owner # noqa: E501 - """ - pass - - def test_post_orgs_id_members(self): - """Test case for post_orgs_id_members - - Add organization member # noqa: E501 - """ - pass - - def test_post_orgs_id_owners(self): - """Test case for post_orgs_id_owners - - Add organization owner # noqa: E501 - """ - pass - - def test_post_scrapers_id_members(self): - """Test case for post_scrapers_id_members - - Add scraper target member # noqa: E501 - """ - pass - - def test_post_scrapers_id_owners(self): - """Test case for post_scrapers_id_owners - - Add scraper target owner # noqa: E501 - """ - pass - - def test_post_tasks_id_members(self): - """Test case for post_tasks_id_members - - Add task member # noqa: E501 - """ - pass - - def test_post_tasks_id_owners(self): - """Test case for post_tasks_id_owners - - Add task owner # noqa: E501 - """ - pass - - def test_post_telegrafs_id_members(self): - """Test case for post_telegrafs_id_members - - Add telegraf config member # noqa: E501 - """ - pass - - def test_post_telegrafs_id_owners(self): - """Test case for post_telegrafs_id_owners - - Add telegraf config owner # noqa: E501 - """ - pass - - def test_post_users(self): - """Test case for post_users - - Create a user # noqa: E501 - """ - pass - - def test_put_me_password(self): - """Test case for put_me_password - - Update password # noqa: E501 - """ - pass - - def test_put_users_id_password(self): - """Test case for put_users_id_password - - Update password # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_variables_api.py b/test/test_variables_api.py deleted file mode 100644 index 1500ab29..00000000 --- a/test/test_variables_api.py +++ /dev/null @@ -1,96 +0,0 @@ -# coding: utf-8 - -""" - Influx API Service - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: 0.1.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import influxdb2 -from influxdb2.api.variables_api import VariablesApi # noqa: E501 -from influxdb2.rest import ApiException - - -class TestVariablesApi(unittest.TestCase): - """VariablesApi unit test stubs""" - - def setUp(self): - self.api = influxdb2.api.variables_api.VariablesApi() # noqa: E501 - - def tearDown(self): - pass - - def test_delete_variables_id(self): - """Test case for delete_variables_id - - delete a variable # noqa: E501 - """ - pass - - def test_delete_variables_id_labels_id(self): - """Test case for delete_variables_id_labels_id - - delete a label from a variable # noqa: E501 - """ - pass - - def test_get_variables(self): - """Test case for get_variables - - get all variables # noqa: E501 - """ - pass - - def test_get_variables_id(self): - """Test case for get_variables_id - - get a variable # noqa: E501 - """ - pass - - def test_get_variables_id_labels(self): - """Test case for get_variables_id_labels - - list all labels for a variable # noqa: E501 - """ - pass - - def test_patch_variables_id(self): - """Test case for patch_variables_id - - update a variable # noqa: E501 - """ - pass - - def test_post_variables(self): - """Test case for post_variables - - create a variable # noqa: E501 - """ - pass - - def test_post_variables_id_labels(self): - """Test case for post_variables_id_labels - - add a label to a variable # noqa: E501 - """ - pass - - def test_put_variables_id(self): - """Test case for put_variables_id - - replace a variable # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_views_api.py b/test/test_views_api.py deleted file mode 100644 index 0645a497..00000000 --- a/test/test_views_api.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding: utf-8 - -""" - Influx API Service - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: 0.1.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import influxdb2 -from influxdb2.api.views_api import ViewsApi # noqa: E501 -from influxdb2.rest import ApiException - - -class TestViewsApi(unittest.TestCase): - """ViewsApi unit test stubs""" - - def setUp(self): - self.api = influxdb2.api.views_api.ViewsApi() # noqa: E501 - - def tearDown(self): - pass - - def test_get_dashboards_id_cells_id_view(self): - """Test case for get_dashboards_id_cells_id_view - - Retrieve the view for a cell in a dashboard # noqa: E501 - """ - pass - - def test_patch_dashboards_id_cells_id_view(self): - """Test case for patch_dashboards_id_cells_id_view - - Update the view for a cell # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_write_api.py b/test/test_write_api.py deleted file mode 100644 index e2da2f0d..00000000 --- a/test/test_write_api.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - Influx API Service - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: 0.1.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import influxdb2 -from influxdb2.api.write_api import WriteApi # noqa: E501 -from influxdb2.rest import ApiException - - -class TestWriteApi(unittest.TestCase): - """WriteApi unit test stubs""" - - def setUp(self): - self.api = influxdb2.api.write_api.WriteApi() # noqa: E501 - - def tearDown(self): - pass - - def test_post_write(self): - """Test case for post_write - - write time-series data into influxdb # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main()