Commit Graph

13 Commits (66298bf16999b389b8628735070a2c174425219c)

Author SHA1 Message Date
Abhishek Raut f20ebba9ef [NSX Search]: Append resource_type while limiting scope for a resource
Currently the search API accepts resource_type as an optional param
which is used to limit the scope of the search to a given type of
resource. This in turn searches the backend for all fields of all
objects.
For example, a search for LogicalSwitch resource_type may return
NSGroups which contain a membership criteria for LogicalSwitch.
In this case NSGroups are returned since the target_type field for
the NSGroup is set to LogicalSwitch.
In order to correctly return only objects of type LogicalSwitch, the
query must have resource_type:LogicalSwitch instead of LogicalSwitch.

Change-Id: I0418c0a758b28ec46b77a7adaf2dbc3addac6da3
6 years ago
Abhishek Raut 9fd59f7880 Add support to search resources based on tags or resource type
This patch adds a new util method to the NsxLib class.
NsxLib will expose a search method to retrieve objects from
backend based on their tags and resource type. Tags argument
must be present in order to search.
Tags are supplied in the following form:
    [{'scope': <scope_val>, 'tag': <tag_value>}, ...]

Change-Id: I304e9c44e55657e652b2a8236e85602c295cf22b
6 years ago
dantingl f601978eda Update interface about NSX IPAM and CIF API change
Change-Id: I224b8778cbb519ec9bc4ebebf9f1b3fbf4326b4d
6 years ago
Abhishek Raut 291cbee227 Add IP POOL ID during port create/update
This patch adds IP POOL ID to the port
create/update for container ports using the
key_values parameter of context in the request body.

Change-Id: Id08c265df0c00744ecb75d07c255c1bc549c2bac
6 years ago
Adit Sarfaty 76b47c2bb7 Use project-id instead of tenant -id in nsxlib
Change-Id: If4782a11b74d72bcfda520fc1bd8eaddf464f5ec
6 years ago
Adit Sarfaty c8edaa87ef Support ip-pool update
Support replacing / deleting values from an existing ip-pool

Change-Id: I918474a9db144bbf22a0df39edb076dedcd327cb
7 years ago
Adit Sarfaty 8e84dcb77e Support router description
Change-Id: Iea946df079e750eadfa0dbcdbe05dcd4282a9cce
7 years ago
Adit Sarfaty d7473ecf2f Expand PEP8 tests on nsxlib
There were some directories excluded from the pep8 run, and many checks
were ignored.
This cleans the exclude list, and fixes the PEP8 issues.

Change-Id: Ib56d45443009349a42fecfc14a792fdaa6d88d67
7 years ago
Anna Khmelnitsky 635439325f Unit tests: Allow multiple responses in mocked client
Sometimes function under test makes multiple calls to the backend,
and being able to provide list of different responses would improve
test coverage.

Change-Id: I27a8cefe28287d25ed5411d44c6e2cc6f0a0701e
7 years ago
Adit Sarfaty ea8eb2a59a IpPools support
Adding support for IP pool create/delete/get actions,
and also allocate & release IPs from the pool

Change-Id: Ieac0aad2268cffa9d4fb5b521ebec268f2b408f3
7 years ago
Adit Sarfaty 047b098840 NSXv3: Fix allowed address pairs switching profile
For allowed address pairs to be functional on NSXv3 plugin, we
need to enforce both Spoof Guard and MAC Learning switching
profile. MAC Learning is used to learning the mac address and
spoof guard is used for switch security to ensure only added
allowed address pairs to be allowed on this port.

Moreover, during fix bug #1631540, we removed the parameter
"mac_change_allowed". After further discussion with NSX team,
it doesn't have negative effect to add it back. The value it can
bring is to support guest VM on ESX host to change MAC address (
the mac_address still needs to be in allowed address pairs) on the
interface.

(Cherry picked from: I2c725df74835165587170f6136c06494d1bfcf7b)
Closes-Bug: #1631539

Change-Id: I1bd8b8e78d955d0f5d2e5a846dfa25c0a7312e47
7 years ago
Adit Sarfaty fb7f9d8674 NSX|V3 fix nsxlib raised error with managers
The NSX3Client did not get the nsx managers IPs, and they where missing
from error messages.

To fix this, and also better fix a similar problem with max_attempts,
the client init method may get another instance of the client, and copy
relevant information from it.
This option is used by the copy-constructor "new_client_for" without the
RestClient class being aware of arguments relevant only to the NSXClient.

Also adding a new test for a resource error message, to make sure it contains
the nsx_manager ip.

(Cherry picked from : I9e7e28eb5fd69ace44547d40cf8cd09e2457c5ed)

Change-Id: I5066ae12aadd286ff880c8545df99a567aeddbeb
7 years ago
Adit Sarfaty e9ddc3dd33 Move all nsxlib code and tests to vmware_nsxlib
Change-Id: I75533e713a680674368d16f0a7aeb4fdbffe3608
7 years ago