Skip to content

Conversation

@akinross
Copy link
Collaborator

@akinross akinross commented Jul 4, 2022

fixes #303

discussion still needed for completion on the following topics:

  • api accepts all direction types, but GUI checkmark on subject does not

  • when combined all directions do show in GUI

  • when choice is made for "both" or a "combination of provider2consumer / consumer2provider" an additional api call will be required or restructure of code

  • direction not saved as part of object config of subject, which is also not something that can be requested. check would then be needed on the children objects of subject.

  • filter_existing in exit_json() used to manipulate the current/previous output. done in aci.py because another get_existing() is done for current status there. if done in aci_contract_subject_to_filter.py manipulation of current status was not possible when aci.exit_json() is called

@akinross
Copy link
Collaborator Author

akinross commented Jul 5, 2022

after discussion decided to reflect the GUI behaviour

type: str
choices: [ AF11, AF12, AF13, AF21, AF22, AF23, AF31, AF32, AF33, AF41, AF42, AF43,
CS0, CS1, CS2, CS3, CS4, CS5, CS6, CS7, EF, VA, unspecified ]
aliases: [ target ]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dscp_provider_to_consumer, dscp_consumer_to_provider -> both the parameters have same aliases: [ target ]

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. regular dscp also which I also changed

- The contract subject name.
type: str
aliases: [ contract_subject, name, subject_name ]
direction:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usage of variable names similar to that on UI is recomended (direction -> apply_both_direction)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@lhercot
Copy link
Member

lhercot commented Oct 11, 2022

I am getting the following error when running the test cases:

TASK [aci_contract_subject_to_filter : create subject one-way] *****************
fatal: [cn-dmz-apic-m1-02-v42]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "annotation": "orchestrator:ansible",
            "apply_both_direction": "both",
            "certificate_name": null,
            "consumer_match": null,
            "contract": "contract1",
            "description": null,
            "direction": "one-way",
            "dscp": null,
            "dscp_consumer_to_provider": null,
            "dscp_provider_to_consumer": null,
            "host": "173.36.219.68",
            "name_alias": null,
            "output_level": "info",
            "output_path": null,
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "port": null,
            "priority": null,
            "priority_consumer_to_provider": null,
            "priority_provider_to_consumer": null,
            "private_key": null,
            "provider_match": null,
            "reverse_filter": null,
            "state": "present",
            "subject": "subjectoneway",
            "tenant": "anstest",
            "timeout": 30,
            "use_proxy": true,
            "use_ssl": true,
            "username": "ansible_github_ci",
            "validate_certs": false
        }
    },
    "msg": "Unsupported parameters for (cisco.aci.aci_contract_subject) module: direction. Supported parameters include: apply_both_direction, use_proxy, private_key (cert_key), dscp (target), dscp_consumer_to_provider (target_consumer_to_provider), provider_match, output_level, output_path, timeout, priority_consumer_to_provider, description (descr), name_alias, priority_provider_to_consumer, annotation, certificate_name (cert_name), validate_certs, priority, contract (contract_name), dscp_provider_to_consumer (target_provider_to_consumer), reverse_filter, port, host (hostname), password, consumer_match, state, username (user), subject (contract_subject, name, subject_name), tenant (tenant_name), use_ssl."
}

@anvitha-jain anvitha-jain self-requested a review October 17, 2022 16:47
Copy link
Collaborator

@anvitha-jain anvitha-jain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@lhercot lhercot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lhercot lhercot merged commit 611eba4 into CiscoDevNet:master Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "Apply Both directions" to aci_contract_subject

3 participants