com.vmware package¶
Subpackages¶
- com.vmware.nsx_policy package
- Subpackages
- com.vmware.nsx_policy.aaa package
- com.vmware.nsx_policy.cluster package
- com.vmware.nsx_policy.infra package
- Subpackages
- com.vmware.nsx_policy.infra.domains package
- com.vmware.nsx_policy.infra.realized_state package
- Subpackages
- com.vmware.nsx_policy.infra.realized_state.enforcement_points package
- Subpackages
- Submodules
- com.vmware.nsx_policy.infra.realized_state.enforcement_points.firewalls_client module
- com.vmware.nsx_policy.infra.realized_state.enforcement_points.groups_client module
- com.vmware.nsx_policy.infra.realized_state.enforcement_points.ip_sets_client module
- com.vmware.nsx_policy.infra.realized_state.enforcement_points.mac_sets_client module
- com.vmware.nsx_policy.infra.realized_state.enforcement_points.services_client module
- com.vmware.nsx_policy.infra.realized_state.enforcement_points package
- Submodules
- com.vmware.nsx_policy.infra.realized_state.enforcement_points_client module
- Subpackages
- com.vmware.nsx_policy.infra.tier_0s package
- Subpackages
- 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.l2vpn_context_client module
- com.vmware.nsx_policy.infra.tier_0s.locale_services.l3vpns_client module
- com.vmware.nsx_policy.infra.tier_0s.locale_services package
- Submodules
- com.vmware.nsx_policy.infra.tier_0s.locale_services_client module
- Subpackages
- com.vmware.nsx_policy.infra.tier_1s package
- Submodules
- com.vmware.nsx_policy.infra.deployment_zones_client module
- com.vmware.nsx_policy.infra.domains_client module
- com.vmware.nsx_policy.infra.partner_services_client module
- com.vmware.nsx_policy.infra.realized_state_client module
- com.vmware.nsx_policy.infra.services_client module
- com.vmware.nsx_policy.infra.tier_0s_client module
- com.vmware.nsx_policy.infra.tier_1s_client module
- Subpackages
- Submodules
- com.vmware.nsx_policy.aaa_client module
- com.vmware.nsx_policy.cluster_client module
- com.vmware.nsx_policy.configs_client module
- com.vmware.nsx_policy.enforcement_points_client module
- com.vmware.nsx_policy.eula_client module
- com.vmware.nsx_policy.infra_client module
- com.vmware.nsx_policy.licenses_client module
- com.vmware.nsx_policy.model_client module
- com.vmware.nsx_policy.tasks_client module
- com.vmware.nsx_policy.telemetry_client module
- com.vmware.nsx_policy.trust_management_client module
- com.vmware.nsx_policy.upgrade_client module
- Subpackages
Submodules¶
com.vmware.nsx_policy_client module¶
-
class
com.vmware.nsx_policy_client.
Batch
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
create
(batch_request, atomic=None)¶ Enables you to make multiple API requests using a single request. The batch API takes in an array of logical HTTP requests represented as JSON arrays. Each request has a method (GET, PUT, POST, or DELETE), a relative_url (the portion of the URL after https://<nsx-mgr>/api/), optional headers array (corresponding to HTTP headers) and an optional body (for POST and PUT requests). The batch API returns an array of logical HTTP responses represented as JSON arrays. Each response has a status code, an optional headers array and an optional body (which is a JSON-encoded string).
Parameters: - batch_request (
com.vmware.nsx_policy.model_client.BatchRequest
) – (required) - atomic (
bool
orNone
) – transactional atomicity for the batch of requests embedded in the batch list (optional, default to false)
Return type: Returns: com.vmware.nsx_policy.model.BatchResponse
Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
Service UnavailableRaise: com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition FailedRaise: com.vmware.vapi.std.errors_client.InternalServerError
Internal Server ErrorRaise: com.vmware.vapi.std.errors_client.Unauthorized
ForbiddenRaise: com.vmware.vapi.std.errors_client.NotFound
Not Found- batch_request (
-
-
class
com.vmware.nsx_policy_client.
Cluster
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
backuptoremote
()¶ Request one-time backup. The backup will be uploaded using the same server configuration as for automatic backup.
Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
Service UnavailableRaise: com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition FailedRaise: com.vmware.vapi.std.errors_client.InternalServerError
Internal Server ErrorRaise: com.vmware.vapi.std.errors_client.Unauthorized
ForbiddenRaise: com.vmware.vapi.std.errors_client.NotFound
Not Found
-
get
()¶ Returns information about the NSX cluster configuration. An NSX cluster has two functions or purposes, commonly referred to as "roles." These two roles are control and management. Each NSX installation has a single cluster. Separate NSX clusters do not share data. In other words, a given data-plane node is attached to only one cluster, not to multiple clusters.
Return type: com.vmware.nsx_policy.model_client.ClusterConfig
Returns: com.vmware.nsx_policy.model.ClusterConfig Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
Service UnavailableRaise: com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition FailedRaise: com.vmware.vapi.std.errors_client.InternalServerError
Internal Server ErrorRaise: com.vmware.vapi.std.errors_client.Unauthorized
ForbiddenRaise: com.vmware.vapi.std.errors_client.NotFound
Not Found
-
summarizeinventorytoremote
()¶ Request one-time inventory summary. The backup will be uploaded using the same server configuration as for an automatic backup.
Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
Service UnavailableRaise: com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition FailedRaise: com.vmware.vapi.std.errors_client.InternalServerError
Internal Server ErrorRaise: com.vmware.vapi.std.errors_client.Unauthorized
ForbiddenRaise: com.vmware.vapi.std.errors_client.NotFound
Not Found
-
-
class
com.vmware.nsx_policy_client.
ErrorResolver
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
get
(error_id)¶ Returns some metadata about the given error_id. This includes information of whether there is a resolver present for the given error_id and its associated user input data
Parameters: error_id ( str
) – (required)Return type: com.vmware.nsx_policy.model_client.ErrorResolverInfo
Returns: com.vmware.nsx_policy.model.ErrorResolverInfo Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
Service UnavailableRaise: com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition FailedRaise: com.vmware.vapi.std.errors_client.InternalServerError
Internal Server ErrorRaise: com.vmware.vapi.std.errors_client.Unauthorized
ForbiddenRaise: com.vmware.vapi.std.errors_client.NotFound
Not Found
-
list
()¶ Returns a list of metadata for all the error resolvers registered.
Return type: com.vmware.nsx_policy.model_client.ErrorResolverInfoList
Returns: com.vmware.nsx_policy.model.ErrorResolverInfoList Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
Service UnavailableRaise: com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition FailedRaise: com.vmware.vapi.std.errors_client.InternalServerError
Internal Server ErrorRaise: com.vmware.vapi.std.errors_client.Unauthorized
ForbiddenRaise: com.vmware.vapi.std.errors_client.NotFound
Not Found
-
resolveerror
(error_resolver_metadata_list)¶ Invokes the corresponding error resolver for the given error(s) present in the payload
Parameters: error_resolver_metadata_list ( com.vmware.nsx_policy.model_client.ErrorResolverMetadataList
) – (required)Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
Service UnavailableRaise: com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition FailedRaise: com.vmware.vapi.std.errors_client.InternalServerError
Internal Server ErrorRaise: com.vmware.vapi.std.errors_client.Unauthorized
ForbiddenRaise: com.vmware.vapi.std.errors_client.NotFound
Not Found
-
-
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: com.vmware.nsx_policy.model_client.Infra
Returns: com.vmware.nsx_policy.model.Infra Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
Service UnavailableRaise: com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition FailedRaise: com.vmware.vapi.std.errors_client.InternalServerError
Internal Server ErrorRaise: com.vmware.vapi.std.errors_client.Unauthorized
ForbiddenRaise: com.vmware.vapi.std.errors_client.NotFound
Not Found
-
patch
(infra)¶ Update the infra including all the nested entities
Parameters: infra ( com.vmware.nsx_policy.model_client.Infra
) – (required)Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
Service UnavailableRaise: com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition FailedRaise: com.vmware.vapi.std.errors_client.InternalServerError
Internal Server ErrorRaise: com.vmware.vapi.std.errors_client.Unauthorized
ForbiddenRaise: 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: com.vmware.nsx_policy.model_client.Infra
Returns: com.vmware.nsx_policy.model.Infra Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
Service UnavailableRaise: com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition FailedRaise: com.vmware.vapi.std.errors_client.InternalServerError
Internal Server ErrorRaise: com.vmware.vapi.std.errors_client.Unauthorized
ForbiddenRaise: com.vmware.vapi.std.errors_client.NotFound
Not Found
-
-
class
com.vmware.nsx_policy_client.
Licenses
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
create
(license)¶ This will add a license key to the system. The API supports adding only one license key for each license edition type - Standard, Advanced or Enterprise. If a new license key is tried to add for an edition for which the license key already exists, then this API will return an error.
Parameters: license ( com.vmware.nsx_policy.model_client.License
) – (required)Return type: com.vmware.nsx_policy.model_client.License
Returns: com.vmware.nsx_policy.model.License Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
Service UnavailableRaise: com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition FailedRaise: com.vmware.vapi.std.errors_client.InternalServerError
Internal Server ErrorRaise: com.vmware.vapi.std.errors_client.Unauthorized
ForbiddenRaise: com.vmware.vapi.std.errors_client.NotFound
Not Found
-
delete
(license_key)¶ Deprecated. Use POST /licenses?action=delete API instead.
Parameters: license_key ( str
) – (required)Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
Service UnavailableRaise: com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition FailedRaise: com.vmware.vapi.std.errors_client.InternalServerError
Internal Server ErrorRaise: com.vmware.vapi.std.errors_client.Unauthorized
ForbiddenRaise: com.vmware.vapi.std.errors_client.NotFound
Not Found
-
delete_0
(license)¶ This will delete the license key identified in the request body by "license_key" and its properties from the system. Attempting to delete the last license key will result in an error.
Parameters: license ( com.vmware.nsx_policy.model_client.License
) – (required)Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
Service UnavailableRaise: com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition FailedRaise: com.vmware.vapi.std.errors_client.InternalServerError
Internal Server ErrorRaise: com.vmware.vapi.std.errors_client.Unauthorized
ForbiddenRaise: com.vmware.vapi.std.errors_client.NotFound
Not Found
-
get
()¶ Deprecated. Use the GET /licenses API instead.
Return type: com.vmware.nsx_policy.model_client.License
Returns: com.vmware.nsx_policy.model.License Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
Service UnavailableRaise: com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition FailedRaise: com.vmware.vapi.std.errors_client.InternalServerError
Internal Server ErrorRaise: com.vmware.vapi.std.errors_client.Unauthorized
ForbiddenRaise: com.vmware.vapi.std.errors_client.NotFound
Not Found
-
getlicensebykey
(license_key)¶ Deprecated. Use GET /licenses API instead.
Parameters: license_key ( str
) – (required)Return type: com.vmware.nsx_policy.model_client.License
Returns: com.vmware.nsx_policy.model.License Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
Service UnavailableRaise: com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition FailedRaise: com.vmware.vapi.std.errors_client.InternalServerError
Internal Server ErrorRaise: com.vmware.vapi.std.errors_client.Unauthorized
ForbiddenRaise: com.vmware.vapi.std.errors_client.NotFound
Not Found
-
list
()¶ Returns all licenses.
Return type: com.vmware.nsx_policy.model_client.LicensesListResult
Returns: com.vmware.nsx_policy.model.LicensesListResult Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
Service UnavailableRaise: com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition FailedRaise: com.vmware.vapi.std.errors_client.InternalServerError
Internal Server ErrorRaise: com.vmware.vapi.std.errors_client.Unauthorized
ForbiddenRaise: com.vmware.vapi.std.errors_client.NotFound
Not Found
-
update
(license)¶ Deprecated. Use the POST /licenses API instead
Parameters: license ( com.vmware.nsx_policy.model_client.License
) – (required)Return type: com.vmware.nsx_policy.model_client.License
Returns: com.vmware.nsx_policy.model.License Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
Service UnavailableRaise: com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition FailedRaise: com.vmware.vapi.std.errors_client.InternalServerError
Internal Server ErrorRaise: com.vmware.vapi.std.errors_client.Unauthorized
ForbiddenRaise: 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.
Tasks
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
get
(task_id)¶ Get information about the specified task
Parameters: task_id ( str
) – ID of task to read (required)Return type: com.vmware.nsx_policy.model_client.TaskProperties
Returns: com.vmware.nsx_policy.model.TaskProperties Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
Service UnavailableRaise: com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition FailedRaise: com.vmware.vapi.std.errors_client.InternalServerError
Internal Server ErrorRaise: com.vmware.vapi.std.errors_client.Unauthorized
ForbiddenRaise: com.vmware.vapi.std.errors_client.NotFound
Not Found
-
list
(cursor=None, included_fields=None, page_size=None, request_uri=None, sort_ascending=None, sort_by=None, status=None, user=None)¶ Get information about all tasks
Parameters: - cursor (
str
orNone
) – Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) - included_fields (
str
orNone
) – Comma separated list of fields that should be included in query result (optional) - page_size (
long
orNone
) – Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) - request_uri (
str
orNone
) – Request URI(s) to include in query result (optional) - sort_ascending (
bool
orNone
) – (optional) - sort_by (
str
orNone
) – Field by which records are sorted (optional) - status (
str
orNone
) – Status(es) to include in query result (optional) - user (
str
orNone
) – Names of users to include in query result (optional)
Return type: Returns: com.vmware.nsx_policy.model.TaskListResult
Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
Service UnavailableRaise: com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition FailedRaise: com.vmware.vapi.std.errors_client.InternalServerError
Internal Server ErrorRaise: com.vmware.vapi.std.errors_client.Unauthorized
ForbiddenRaise: com.vmware.vapi.std.errors_client.NotFound
Not Found- cursor (
-
-
class
com.vmware.nsx_policy_client.
Templates
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
delete
(template_id)¶ Delete a template.
Parameters: template_id ( str
) – Template identifier (required)Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
Service UnavailableRaise: com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition FailedRaise: com.vmware.vapi.std.errors_client.InternalServerError
Internal Server ErrorRaise: com.vmware.vapi.std.errors_client.Unauthorized
ForbiddenRaise: com.vmware.vapi.std.errors_client.NotFound
Not Found
-
deploy
(template_id, policy_template_parameters)¶ Read a template, populate the placeholders’ fields with the parameters’ values, and deploy the template body by creating or updating all the nested policy objects inside the AbstractSpace object.
Parameters: - template_id (
str
) – Template identifier (required) - policy_template_parameters (
com.vmware.nsx_policy.model_client.PolicyTemplateParameters
) – (required)
Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
Service UnavailableRaise: com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition FailedRaise: com.vmware.vapi.std.errors_client.InternalServerError
Internal Server ErrorRaise: com.vmware.vapi.std.errors_client.Unauthorized
ForbiddenRaise: com.vmware.vapi.std.errors_client.NotFound
Not Found- template_id (
-
get
(template_id)¶ Read a template and returns the template properties for a given template identifier.
Parameters: template_id ( str
) – Template identifier (required)Return type: com.vmware.nsx_policy.model_client.PolicyTemplate
Returns: com.vmware.nsx_policy.model.PolicyTemplate Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
Service UnavailableRaise: com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition FailedRaise: com.vmware.vapi.std.errors_client.InternalServerError
Internal Server ErrorRaise: com.vmware.vapi.std.errors_client.Unauthorized
ForbiddenRaise: com.vmware.vapi.std.errors_client.NotFound
Not Found
-
list
(cursor=None, included_fields=None, page_size=None, sort_ascending=None, sort_by=None)¶ List Policy Templates
Parameters: - cursor (
str
orNone
) – Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) - included_fields (
str
orNone
) – Comma separated list of fields that should be included in query result (optional) - page_size (
long
orNone
) – Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) - sort_ascending (
bool
orNone
) – (optional) - sort_by (
str
orNone
) – Field by which records are sorted (optional)
Return type: Returns: com.vmware.nsx_policy.model.PolicyTemplateListResult
Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
Service UnavailableRaise: com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition FailedRaise: com.vmware.vapi.std.errors_client.InternalServerError
Internal Server ErrorRaise: com.vmware.vapi.std.errors_client.Unauthorized
ForbiddenRaise: com.vmware.vapi.std.errors_client.NotFound
Not Found- cursor (
-
patch
(template_id, policy_template)¶ Create a new template if the specified template id does not correspond to an existing template. Update the template if otherwise.
Parameters: - template_id (
str
) – Template identifier (required) - policy_template (
com.vmware.nsx_policy.model_client.PolicyTemplate
) – (required)
Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
Service UnavailableRaise: com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition FailedRaise: com.vmware.vapi.std.errors_client.InternalServerError
Internal Server ErrorRaise: com.vmware.vapi.std.errors_client.Unauthorized
ForbiddenRaise: com.vmware.vapi.std.errors_client.NotFound
Not Found- template_id (
-
-
class
com.vmware.nsx_policy_client.
TrustManagement
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
get
()¶ Returns information about the supported algorithms and key sizes.
Return type: com.vmware.nsx_policy.model_client.TrustManagementData
Returns: com.vmware.nsx_policy.model.TrustManagementData Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
Service UnavailableRaise: com.vmware.vapi.std.errors_client.InvalidRequest
Bad Request, Precondition FailedRaise: com.vmware.vapi.std.errors_client.InternalServerError
Internal Server ErrorRaise: com.vmware.vapi.std.errors_client.Unauthorized
ForbiddenRaise: 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 calls - refresh_token (
str
) – Refresh token to use for obtaining an access token - refresh_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 errorReturn 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 errorReturn type: bool
Returns: Returns True if request should be retried in case the error is either Unauthenticated or Unauthorized else False
- session (
-
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 use - session (
requests.Session
) – Requests HTTP session instance - refresh_token (
str
) – Refresh token obtained from CSP - vmc_url (
str
) – URL of the VMC service - csp_url (
str
) – URL of the CSP service - org_id (
str
) – ID of the VMC organization - sddc_id (
str
) – ID of the VMC Software-Defined Data Center (SDDC)
- stub_factory_class (
-
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 CSP - org_id (
str
) – ID of the VMC organization - sddc_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
- refresh_token (