Skip to content
Snippets Groups Projects
Commit 4843d5b6 authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

update references to {class} to :class: for RST compatibility

parent cb44245e
No related branches found
No related tags found
1 merge request!80Feature/update documentation
......@@ -53,7 +53,7 @@ class IptrunkSideBlock(IptrunkSideBlockProvisioning, lifecycle=[SubscriptionLife
class IptrunkBlockInactive(
ProductBlockModel, lifecycle=[SubscriptionLifecycle.INITIAL], product_block_name="IptrunkBlock"
):
"""A trunk that's currently inactive, see {class}`IptrunkBlock`."""
"""A trunk that's currently inactive, see :class:`IptrunkBlock`."""
geant_s_sid: Optional[str] = None
iptrunk_description: Optional[str] = None
......@@ -68,7 +68,7 @@ class IptrunkBlockInactive(
class IptrunkBlockProvisioning(IptrunkBlockInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING]):
"""A trunk that's currently being provisioned, see {class}`IptrunkBlock`."""
"""A trunk that's currently being provisioned, see :class:`IptrunkBlock`."""
geant_s_sid: Optional[str] = None
iptrunk_description: Optional[str] = None
......
"""Product block for {class}`Router` products."""
"""Product block for :class:`Router` products."""
import ipaddress
from typing import Optional
......@@ -27,7 +27,7 @@ class RouterRole(strEnum):
class RouterBlockInactive(
ProductBlockModel, lifecycle=[SubscriptionLifecycle.INITIAL], product_block_name="RouterBlock"
):
"""A router that's being currently inactive. See {class}`RouterBlock`."""
"""A router that's being currently inactive. See :class:`RouterBlock`."""
router_fqdn: Optional[str] = None
router_ts_port: Optional[PortNumber] = None
......@@ -49,7 +49,7 @@ def generate_fqdn(hostname: str, site_name: str, country_code: str) -> str:
class RouterBlockProvisioning(RouterBlockInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING]):
"""A router that's being provisioned. See {class}`RouterBlock`."""
"""A router that's being provisioned. See :class:`RouterBlock`."""
router_fqdn: str
router_ts_port: PortNumber
......@@ -88,10 +88,10 @@ class RouterBlock(RouterBlockProvisioning, lifecycle=[SubscriptionLifecycle.ACTI
router_ias_lt_ipv6_network: Optional[ipaddress.IPv6Network]
"""The IAS LT IPv6 network of the router."""
router_vendor: RouterVendor
"""The vendor of the router, can be any of the values defined in {class}`RouterVendor`."""
"""The vendor of the router, can be any of the values defined in :class:`RouterVendor`."""
router_role: RouterRole
"""The role of the router, which can be any of the values defined in {class}`RouterRole`."""
"""The role of the router, which can be any of the values defined in :class:`RouterRole`."""
router_site: SiteBlock
"""The {class}`Site` that this router resides in. Both physically and computationally."""
"""The :class:`Site` that this router resides in. Both physically and computationally."""
router_is_ias_connected: bool
"""The router is going to have a LT interface between inet0 and IAS"""
......@@ -21,7 +21,7 @@ class SiteTier(strEnum):
class SiteBlockInactive(ProductBlockModel, lifecycle=[SubscriptionLifecycle.INITIAL], product_block_name="SiteBlock"):
"""A site that's currently inactive, see {class}`SiteBlock`."""
"""A site that's currently inactive, see :class:`SiteBlock`."""
site_name: Optional[str] = None
site_city: Optional[str] = None
......@@ -36,7 +36,7 @@ class SiteBlockInactive(ProductBlockModel, lifecycle=[SubscriptionLifecycle.INIT
class SiteBlockProvisioning(SiteBlockInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING]):
"""A site that's currently being provisioned, see {class}`SiteBlock`."""
"""A site that's currently being provisioned, see :class:`SiteBlock`."""
site_name: Optional[str] = None
site_city: Optional[str] = None
......@@ -72,7 +72,7 @@ class SiteBlock(SiteBlockProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE])
site_bgp_community_id: int
"""The :term:`BGP` community ID of a site, used to advertise routes learned at this site."""
site_tier: SiteTier
"""The tier of a site, as described in {class}`SiteTier`."""
"""The tier of a site, as described in :class:`SiteTier`."""
site_ts_address: Optional[str] = None
"""The address of the terminal server that this router is connected to. The terminal server provides out of band
access. This is required in case a link goes down, or when a router is initially added to the network and it does
......
......@@ -21,7 +21,7 @@ def _setup_connection() -> tuple[connector.Connector, IPAMParams]:
"""Set up a new connection with an Infoblox instance.
:return: A tuple that has an Infoblox `Connector` instance, and :term:`IPAM` parameters.
:rtype: tuple[{class}`infoblox_client.connector.Connector`, IPAMParams]
:rtype: tuple[:class:`infoblox_client.connector.Connector`, IPAMParams]
"""
oss = load_oss_params().IPAM
options = {
......@@ -44,10 +44,10 @@ def _allocate_network(
"""Allocate a new network in Infoblox.
The function will go over all given containers, and try to allocate a network within the available IP space. If no
space is available, this method raises an {class}`AllocationError`.
space is available, this method raises an :class:`AllocationError`.
:param conn: An active Infoblox connection.
:type conn: {class}`infoblox_client.connector.Connector`
:type conn: :class:`infoblox_client.connector.Connector`
:param dns_view: The Infoblox `dns_view` in which the network should be allocated.
:type dns_view: str
:param netmask: The netmask of the desired network. Can be up to 32 for v4 networks, and 128 for v6 networks.
......@@ -72,7 +72,7 @@ def _allocate_network(
def hostname_available(hostname: str) -> bool:
"""Check whether a hostname is still available **in Infoblox**.
Check whether Infoblox already contains a {class}`infoblox_client.objects.HostRecord` that matches the given
Check whether Infoblox already contains a :class:`infoblox_client.objects.HostRecord` that matches the given
hostname. Be aware that this method only checks within the Infoblox instance, and not the rest of the internet.
The hostname could therefore still be taken elsewhere.
......@@ -135,7 +135,7 @@ def delete_network(ip_network: ipaddress.IPv4Network | ipaddress.IPv6Network) ->
"""Delete a network in Infoblox.
Delete a network that is allocated in Infoblox, by passing the :term:`CIDR` to be deleted. The :term:`CIDR` must
exactly match an existing entry in Infoblox, otherwise this method raises a {class}`DeletionError`
exactly match an existing entry in Infoblox, otherwise this method raises a :class:`DeletionError`
:param ip_network: The network that should get deleted.
:type ip_network: ipaddress.IPv4Network | ipaddress.IPv6Network
......@@ -154,7 +154,7 @@ def allocate_host(
Create a new host record in Infoblox, by providing a hostname, and the service type that is associated with this new
host. Most likely to be a loopback interface. If the hostname is not available in Infoblox (due to a potential
collision) this method raises an {class}`AllocationError`.
collision) this method raises an :class:`AllocationError`.
:param hostname: The :term:`FQDN` of the new host
:type hostname: str
......@@ -164,7 +164,7 @@ def allocate_host(
will be a single loopback address.
:type cname_aliases: list[str]
:param comment: A comment that is added to the host record in Infoblox, should be the `subscription_id` of the new
{class}`Router` subscription.
:class:`Router` subscription.
:type comment: str
"""
if not hostname_available(hostname):
......@@ -239,7 +239,7 @@ def delete_host_by_ip(ip_addr: ipaddress.IPv4Address | ipaddress.IPv6Address) ->
"""Delete a host from Infoblox.
Delete a host record in Infoblox, by providing the IP address that is associated with the record. Raises a
{class}`DeletionError` if no record can be found in Infoblox.
:class:`DeletionError` if no record can be found in Infoblox.
:param ip_addr: The IP address of the host record that should get deleted.
:type ip_addr: ipaddress.IPv4Address | ipaddress.IPv6Address
......@@ -255,7 +255,7 @@ def delete_host_by_fqdn(fqdn: str) -> None:
"""Delete a host from Infoblox.
Delete a host record in Infoblox, by providing the :term:`FQDN` that is associated with the record. Raises a
{class}`DeletionError` if no record can be found in Infoblox.
:class:`DeletionError` if no record can be found in Infoblox.
:param fqdn: The FQDN of the host record that should get deleted.
:type fqdn: str
......
......@@ -49,7 +49,7 @@ def _send_request(endpoint: str, parameters: dict, process_id: UUIDstr, operatio
playbook is completed.
:type process_id: UUIDstr
:param operation: The specific operation that's performed with the request.
:type operation: {class}`CUDOperation`
:type operation: :class:`CUDOperation`
:rtype: None
"""
oss = settings.load_oss_params()
......@@ -85,7 +85,7 @@ def provision_router(
"""Provision a new router using :term:`LSO`.
:param subscription: The subscription object that's to be provisioned.
:type subscription: {class}`RouterProvisioning`
:type subscription: :class:`RouterProvisioning`
:param process_id: The related process ID, used for callback.
:type process_id: UUIDstr
:param dry_run: A boolean indicating whether this should be a dry run or not, defaults to `True`.
......@@ -108,7 +108,7 @@ def provision_ip_trunk(
"""Provision an IP trunk service using :term:`LSO`.
:param subscription: The subscription object that's to be provisioned.
:type subscription: {class}`IptrunkProvisioning`
:type subscription: :class:`IptrunkProvisioning`
:param process_id: The related process ID, used for callback.
:type process_id: UUIDstr
:param config_object: The type of object that's deployed.
......@@ -133,7 +133,7 @@ def check_ip_trunk(subscription: IptrunkProvisioning, process_id: UUIDstr, tt_nu
"""Provision an IP trunk service using :term:`LSO`.
:param subscription: The subscription object that's to be provisioned.
:type subscription: {class}`IptrunkProvisioning`
:type subscription: :class:`IptrunkProvisioning`
:param process_id: The related process ID, used for callback.
:type process_id: UUIDstr
:param check_name: The name of the check to execute
......@@ -153,7 +153,7 @@ def deprovision_ip_trunk(subscription: Iptrunk, process_id: UUIDstr, tt_number:
"""Deprovision an IP trunk service using :term:`LSO`.
:param subscription: The subscription object that's to be provisioned.
:type subscription: {class}`IptrunkProvisioning`
:type subscription: :class:`IptrunkProvisioning`
:param process_id: The related process ID, used for callback.
:type process_id: UUIDstr
:param dry_run: A boolean indicating whether this should be a dry run or not, defaults to `True`.
......@@ -186,9 +186,9 @@ def migrate_ip_trunk(
"""Migrate an IP trunk service using :term:`LSO`.
:param subscription: The subscription object that's to be migrated.
:type subscription: {class}`Iptrunk`
:type subscription: :class:`Iptrunk`
:param new_node: The new node that is being migrated to
:type new_node: {class}`Router`
:type new_node: :class:`Router`
:param new_lag_interface: The name of the new aggregated Ethernet interface
:type new_lag_interface: str
:param new_lag_member_interfaces: The new list of interfaces that are part of the :term:`LAG`
......@@ -233,13 +233,13 @@ def _await_pp_results(subscription: SubscriptionModel, label_text: str = DEFAULT
output of the provisioning proxy.
:param subscription: The current subscription that the provisioning proxy is acting on.
:type subscription: {class}`orchestrator.domain.SubscriptionModel`
:type subscription: :class:`orchestrator.domain.SubscriptionModel`
:param label_text: A label that's displayed to the operator when the provisioning proxy has not returned its
results yet. Defaults to `DEFAULT_LABEL`.
:type label_text: str
:return: The input that's given by the provisioning proxy, that should contain run results, and a `confirm`
boolean set to `True`.
:rtype: {class}`orchestrator.types.FormGenerator`
:rtype: :class:`orchestrator.types.FormGenerator`
"""
class ProvisioningResultPage(FormPage):
......@@ -266,7 +266,7 @@ def _reset_pp_success_state() -> State:
"""Reset the boolean that indicates a successful provisioning proxy result in the state of a running workflow.
:return: A new state of the workflow, where the key `pp_did_succeed` has been (re)set to false.
:rtype: {class}`orchestrator.types.State`
:rtype: :class:`orchestrator.types.State`
"""
return {"pp_did_succeed": False}
......@@ -280,9 +280,9 @@ def _confirm_pp_results(state: State) -> FormGenerator:
execution will be retried. This will happen up to two times, after which the workflow will fail.
:param state: The current state of the workflow.
:type state: {class}`orchestrator.types.State`
:type state: :class:`orchestrator.types.State`
:return: Confirmation from the user, when presented with the run results.
:rtype: {class}`orchestrator.types.FormGenerator`
:rtype: :class:`orchestrator.types.FormGenerator`
"""
if "pp_run_results" not in state:
# FIXME: dirty hack that makes the skipping """work"""
......@@ -328,7 +328,7 @@ def pp_interaction(provisioning_step: Step, attempts: int, abort_on_failure: boo
- The input step that suspends the workflow, and will wait for results from the provisioning proxy.
- An input step that presents the user with the results, where they must be confirmed.
All these steps are wrapped in a {class}`orchestrator.workflow.conditional`. This ensures that when provisioning was
All these steps are wrapped in a :class:`orchestrator.workflow.conditional`. This ensures that when provisioning was
already successful, these steps are skipped. This mechanism is quite a dirty hack, and it's planned to be addressed
in a later release.
......@@ -336,13 +336,13 @@ def pp_interaction(provisioning_step: Step, attempts: int, abort_on_failure: boo
it's still not successful, the workflow will be aborted if so indicated with the `abort_on_failure` boolean.
:param provisioning_step: The step that executes an interaction with the provisioning proxy.
:type provisioning_step: {class}`orchestrator.workflow.Step`
:type provisioning_step: :class:`orchestrator.workflow.Step`
:param attempts: The maximum amount of times that a provisioning can be retried.
:type attempts: int
:param abort_on_failure: A boolean value that indicates whether a workflow should abort if the provisioning has
failed the maximum amount of tries. Defaults to `True`.
:return: A list of three steps that form one interaction with the provisioning proxy.
:rtype: {class}`orchestrator.workflow.StepList`
:rtype: :class:`orchestrator.workflow.StepList`
"""
should_retry_pp_steps = conditional(lambda state: not state.get("pp_did_succeed"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment