com.vmware package¶
Subpackages¶
- com.vmware.nsx_policy package
- Subpackages
- com.vmware.nsx_policy.infra package
- Subpackages
- com.vmware.nsx_policy.infra.domains package
- Subpackages
- Submodules
- com.vmware.nsx_policy.infra.domains.communication_maps_client module
- com.vmware.nsx_policy.infra.domains.endpoint_policies_client module
- com.vmware.nsx_policy.infra.domains.forwarding_policies_client module
- com.vmware.nsx_policy.infra.domains.gateway_policies_client module
- com.vmware.nsx_policy.infra.domains.groups_client module
- com.vmware.nsx_policy.infra.domains.redirection_policies_client module
- com.vmware.nsx_policy.infra.domains.security_policies_client module
- com.vmware.nsx_policy.infra.realized_state package
- com.vmware.nsx_policy.infra.segments package
- com.vmware.nsx_policy.infra.service_references package
- com.vmware.nsx_policy.infra.settings package
- com.vmware.nsx_policy.infra.sites package
- com.vmware.nsx_policy.infra.tier_0s package
- Subpackages
- com.vmware.nsx_policy.infra.tier_0s.groups package
- com.vmware.nsx_policy.infra.tier_0s.locale_services package
- Subpackages
- Submodules
- com.vmware.nsx_policy.infra.tier_0s.locale_services.bgp_client module
- com.vmware.nsx_policy.infra.tier_0s.locale_services.byod_service_instances_client module
- com.vmware.nsx_policy.infra.tier_0s.locale_services.endpoints_client module
- com.vmware.nsx_policy.infra.tier_0s.locale_services.interfaces_client module
- com.vmware.nsx_policy.infra.tier_0s.locale_services.ipsec_vpn_services_client module
- com.vmware.nsx_policy.infra.tier_0s.locale_services.l2vpn_context_client module
- com.vmware.nsx_policy.infra.tier_0s.locale_services.l2vpn_services_client module
- com.vmware.nsx_policy.infra.tier_0s.locale_services.l3vpns_client module
- com.vmware.nsx_policy.infra.tier_0s.locale_services.service_instances_client module
- com.vmware.nsx_policy.infra.tier_0s.nat package
- Submodules
- com.vmware.nsx_policy.infra.tier_0s.dns_forwarder_client module
- com.vmware.nsx_policy.infra.tier_0s.locale_services_client module
- com.vmware.nsx_policy.infra.tier_0s.nat_client module
- Subpackages
- com.vmware.nsx_policy.infra.tier_1s package
- Subpackages
- com.vmware.nsx_policy.infra.tier_1s.locale_services package
- com.vmware.nsx_policy.infra.tier_1s.nat package
- com.vmware.nsx_policy.infra.tier_1s.segments package
- Submodules
- com.vmware.nsx_policy.infra.tier_1s.dns_forwarder_client module
- com.vmware.nsx_policy.infra.tier_1s.locale_services_client module
- com.vmware.nsx_policy.infra.tier_1s.nat_client module
- com.vmware.nsx_policy.infra.tier_1s.segments_client module
- Subpackages
- com.vmware.nsx_policy.infra.domains package
- Submodules
- com.vmware.nsx_policy.infra.context_profiles_client module
- com.vmware.nsx_policy.infra.domains_client module
- com.vmware.nsx_policy.infra.drafts_client module
- com.vmware.nsx_policy.infra.flood_protection_profiles_client module
- com.vmware.nsx_policy.infra.ip_pools_client module
- com.vmware.nsx_policy.infra.realized_state_client module
- com.vmware.nsx_policy.infra.segments_client module
- com.vmware.nsx_policy.infra.services_client module
- com.vmware.nsx_policy.infra.session_timer_profiles_client module
- com.vmware.nsx_policy.infra.sites_client module
- com.vmware.nsx_policy.infra.tier_0s_client module
- com.vmware.nsx_policy.infra.tier_1s_client module
- Subpackages
- com.vmware.nsx_policy.infra package
- Submodules
- com.vmware.nsx_policy.aaa_client module
- com.vmware.nsx_policy.compliance_client module
- com.vmware.nsx_policy.enforcement_points_client module
- com.vmware.nsx_policy.fine_tuning_client module
- com.vmware.nsx_policy.infra_client module
- com.vmware.nsx_policy.model_client module
- com.vmware.nsx_policy.ui_views_client module
- Subpackages
Submodules¶
com.vmware.nsx_policy_client module¶
-
class
com.vmware.nsx_policy_client.
Infra
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
- Parameters
config (
vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.
-
get
(filter=None)¶ Read infra. Returns only the infra related properties. Inner object are not populated.
- Parameters
filter (
str
orNone
) – Filter string as java regex (optional)- Return type
- Returns
com.vmware.nsx_policy.model.Infra
- Raise
com.vmware.vapi.std.errors_client.ServiceUnavailable
Service Unavailable- Raise
com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition Failed- Raise
com.vmware.vapi.std.errors_client.InternalServerError
Internal Server Error- Raise
com.vmware.vapi.std.errors_client.Unauthorized
Forbidden- Raise
com.vmware.vapi.std.errors_client.NotFound
Not Found
-
patch
(infra, enforce_revision_check=None)¶ Patch API at infra level can be used in two flavours 1. Like a regular API to update Infra object 2. Hierarchical API: To create/update/delete entire or part of intent hierarchy Hierarchical API: Provides users a way to create entire or part of intent in single API invocation. Input is expressed in a tree format. Each node in tree can have multiple children of different types. System will resolve the dependecies of nodes within the intent tree and will create the model. Children for any node can be specified using ChildResourceReference or ChildPolicyConfigResource. If a resource is specified using ChildResourceReference then it will not be updated only its children will be updated. If Object is specified using ChildPolicyConfigResource, object along with its children will be updated. Hierarchical API can also be used to delete any sub-branch of entire tree.
- Parameters
infra (
com.vmware.nsx_policy.model_client.Infra
) – (required)enforce_revision_check (
bool
orNone
) – Force revision check (optional, default to false)
- Raise
com.vmware.vapi.std.errors_client.ServiceUnavailable
Service Unavailable- Raise
com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition Failed- Raise
com.vmware.vapi.std.errors_client.InternalServerError
Internal Server Error- Raise
com.vmware.vapi.std.errors_client.Unauthorized
Forbidden- Raise
com.vmware.vapi.std.errors_client.NotFound
Not Found
-
update
(infra)¶ Update the infra including all the nested entities
- Parameters
infra (
com.vmware.nsx_policy.model_client.Infra
) – (required)- Return type
- Returns
com.vmware.nsx_policy.model.Infra
- Raise
com.vmware.vapi.std.errors_client.ServiceUnavailable
Service Unavailable- Raise
com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition Failed- Raise
com.vmware.vapi.std.errors_client.InternalServerError
Internal Server Error- Raise
com.vmware.vapi.std.errors_client.Unauthorized
Forbidden- Raise
com.vmware.vapi.std.errors_client.NotFound
Not Found
-
class
com.vmware.nsx_policy_client.
StubFactory
(stub_config)¶ Bases:
vmware.vapi.bindings.stub.StubFactoryBase
Initialize StubFactoryBase
- Parameters
stub_config (
vmware.vapi.bindings.stub.StubConfiguration
) – Stub config instance
-
class
com.vmware.nsx_policy_client.
UiViews
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
- Parameters
config (
vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.
-
create
(view)¶ Creates a new View.
- Parameters
view (
com.vmware.nsx_policy.model_client.View
) – (required)- Return type
- Returns
com.vmware.nsx_policy.model.View
- Raise
com.vmware.vapi.std.errors_client.ServiceUnavailable
Service Unavailable- Raise
com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition Failed- Raise
com.vmware.vapi.std.errors_client.InternalServerError
Internal Server Error- Raise
com.vmware.vapi.std.errors_client.Unauthorized
Forbidden- Raise
com.vmware.vapi.std.errors_client.NotFound
Not Found
-
delete
(view_id)¶ Delete View
- Parameters
view_id (
str
) – (required)- Raise
com.vmware.vapi.std.errors_client.ServiceUnavailable
Service Unavailable- Raise
com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition Failed- Raise
com.vmware.vapi.std.errors_client.InternalServerError
Internal Server Error- Raise
com.vmware.vapi.std.errors_client.Unauthorized
Forbidden- Raise
com.vmware.vapi.std.errors_client.NotFound
Not Found
-
get
(tag=None, view_ids=None, widget_id=None)¶ If no query params are specified then all the views entitled for the user are returned. The views to which a user is entitled to include the views created by the user and the shared views.
- Parameters
tag (
str
orNone
) – The tag for which associated views to be queried. (optional)view_ids (
str
orNone
) – Ids of the Views (optional)widget_id (
str
orNone
) – Id of widget configuration (optional)
- Return type
- Returns
com.vmware.nsx_policy.model.ViewList
- Raise
com.vmware.vapi.std.errors_client.ServiceUnavailable
Service Unavailable- Raise
com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition Failed- Raise
com.vmware.vapi.std.errors_client.InternalServerError
Internal Server Error- Raise
com.vmware.vapi.std.errors_client.Unauthorized
Forbidden- Raise
com.vmware.vapi.std.errors_client.NotFound
Not Found
-
get_0
(view_id)¶ Returns Information about a specific View.
- Parameters
view_id (
str
) – (required)- Return type
- Returns
com.vmware.nsx_policy.model.View
- Raise
com.vmware.vapi.std.errors_client.ServiceUnavailable
Service Unavailable- Raise
com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition Failed- Raise
com.vmware.vapi.std.errors_client.InternalServerError
Internal Server Error- Raise
com.vmware.vapi.std.errors_client.Unauthorized
Forbidden- Raise
com.vmware.vapi.std.errors_client.NotFound
Not Found
-
update
(view_id, view)¶ Update View
- Parameters
view_id (
str
) – (required)view (
com.vmware.nsx_policy.model_client.View
) – (required)
- Return type
- Returns
com.vmware.nsx_policy.model.View
- Raise
com.vmware.vapi.std.errors_client.ServiceUnavailable
Service Unavailable- Raise
com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition Failed- Raise
com.vmware.vapi.std.errors_client.InternalServerError
Internal Server Error- Raise
com.vmware.vapi.std.errors_client.Unauthorized
Forbidden- Raise
com.vmware.vapi.std.errors_client.NotFound
Not Found
com.vmware.nsx_policy_client_for_vmc module¶
Convenience methods to get API clients for NSX APIs in VMC
-
class
com.vmware.nsx_policy_client_for_vmc.
CSPSecurityContextFilter
(session, refresh_token, refresh_url)¶ Bases:
vmware.vapi.security.client.security_context_filter.SecurityContextFilter
CSP Security Context filter in API Provider chain adds the security context based on a refresh token to the execution context passed in.
Initialize SecurityContextFilter
- Parameters
session (
requests.Session
) – Requests Session object to use for making HTTP callsrefresh_token (
str
) – Refresh token to use for obtaining an access tokenrefresh_url (
str
) – URL that allows exchanging a refresh token for an access token
-
get_max_retries
()¶ Get the max number of retries
- Return type
int
- Returns
Number of retries
-
get_security_context
(on_error)¶ Retrieve security context. If this method is called after an error occured, then a new access token is obtained using the refresh token and a new security context is created.
- Parameters
on_error (
bool
) – Whether this method is called after getting an error- Return type
vmware.vapi.core.SecurityContext
- Returns
Security context
-
should_retry
(error_value)¶ Returns whether the request should be retried or not based on the error specified.
- Parameters
error_value (
vmware.vapi.data.value.ErrorValue
) – Method error- Return type
bool
- Returns
Returns True if request should be retried in case the error is either Unauthenticated or Unauthorized else False
-
class
com.vmware.nsx_policy_client_for_vmc.
VmcNsxClient
(stub_factory_class, session, refresh_token, vmc_url, csp_url, org_id, sddc_id)¶ Bases:
vmware.vapi.bindings.stub.ApiClient
Client class that providess access to stubs for all the services in the VMC NSX API
Initialize VmcClient by creating a stub factory instance using a CSP Security context filter added to the filter chain of the connector
- Parameters
stub_factory_class (
type
) – Which stub factory class to usesession (
requests.Session
) – Requests HTTP session instancerefresh_token (
str
) – Refresh token obtained from CSPvmc_url (
str
) – URL of the VMC servicecsp_url (
str
) – URL of the CSP serviceorg_id (
str
) – ID of the VMC organizationsddc_id (
str
) – ID of the VMC Software-Defined Data Center (SDDC)
-
com.vmware.nsx_policy_client_for_vmc.
create_nsx_policy_client_for_vmc
(refresh_token, org_id, sddc_id, session=None)¶ Helper method to create an instance of the VMC NSX Policy API client
- Parameters
refresh_token (
str
) – Refresh token obtained from CSPorg_id (
str
) – ID of the VMC organizationsddc_id (
str
) – ID of the VMC Software-Defined Data Center (SDDC)session (
requests.Session
orNone
) – Requests HTTP session instance. If not specified, then one is automatically created and used
- Return type
vmware.vapi.vmc.client.VmcNsxClient
- Returns
VMC NSX Client instance