MCPcopy Create free account
hub / github.com/datastax/astrapy / FullDevOpsAPIURLOptions

Class FullDevOpsAPIURLOptions

astrapy/utils/api_options.py:795–855  ·  view source on GitHub ↗

The group of settings for the API Options that determines the URL used to reach the DevOps API. This is the "full" version of the class, with the guarantee that all of its members have defined values. As such, this is what classes such as DataAPIClient, Database, Table, Collect

Source from the content-addressed store, hash-verified

793
794@dataclass
795class FullDevOpsAPIURLOptions(DevOpsAPIURLOptions):
796 """
797 The group of settings for the API Options that determines the URL used to
798 reach the DevOps API.
799
800 This is the "full" version of the class, with the guarantee that all of its members
801 have defined values. As such, this is what classes such as DataAPIClient, Database,
802 Table, Collection and so on have in their `.api_options` attribute -- as opposed
803 to the (non-full) `DevOpsAPIURLOptions` counterpart class: the latter admits "unset"
804 attributes and is used to override specific settings. However, only in very specific
805 customized scenarios should it be necessary to override the default settings.
806
807 The default settings for this class depend on the environment; in particular,
808 for non-Astra environments (such as HCD or DSE) there is no DevOps API, hence
809 these settings are irrelevant.
810
811 Attributes:
812 dev_ops_url: This can be used to specify the URL to the DevOps API. The default
813 for production Astra DB is "https://api.astra.datastax.com" and should
814 never need to be overridden.
815 dev_ops_api_version: this specifies a version for the DevOps API
816 (the default is "v2"). It should never need to be overridden.
817 """
818
819 dev_ops_url: str
820 dev_ops_api_version: str | None
821
822 def __init__(
823 self,
824 *,
825 dev_ops_url: str,
826 dev_ops_api_version: str | None,
827 ) -> None:
828 DevOpsAPIURLOptions.__init__(
829 self,
830 dev_ops_url=dev_ops_url,
831 dev_ops_api_version=dev_ops_api_version,
832 )
833
834 def with_override(self, other: DevOpsAPIURLOptions) -> FullDevOpsAPIURLOptions:
835 """
836 Given an "overriding" set of options, possibly not defined in all its
837 attributes, apply the override logic and return a new full options object.
838
839 Args:
840 other: a not-necessarily-fully-specified options object. All its defined
841 settings take precedence.
842 """
843
844 return FullDevOpsAPIURLOptions(
845 dev_ops_url=(
846 other.dev_ops_url
847 if not isinstance(other.dev_ops_url, UnsetType)
848 else self.dev_ops_url
849 ),
850 dev_ops_api_version=(
851 other.dev_ops_api_version
852 if not isinstance(other.dev_ops_api_version, UnsetType)

Callers 2

with_overrideMethod · 0.85
defaultAPIOptionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…