defectdojo_api_generated.AssetsApi
All URIs are relative to http://localhost
| Method | HTTP request | Description |
|---|---|---|
| create | POST /api/v2/assets/ | |
| delete_preview_list | GET /api/v2/assets/{id}/delete_preview/ | |
| destroy | DELETE /api/v2/assets/{id}/ | |
| generate_report_create | POST /api/v2/assets/{id}/generate_report/ | |
| list | GET /api/v2/assets/ | |
| partial_update | PATCH /api/v2/assets/{id}/ | |
| retrieve | GET /api/v2/assets/{id}/ | |
| update | PUT /api/v2/assets/{id}/ |
create
Asset create(asset_request)
Example
- Basic Authentication (basicAuth):
- Api Key Authentication (cookieAuth):
- Api Key Authentication (tokenAuth):
import defectdojo_api_generated
from defectdojo_api_generated.models.asset import Asset
from defectdojo_api_generated.models.asset_request import AssetRequest
from defectdojo_api_generated.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = defectdojo_api_generated.Configuration(
host = "http://localhost"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: basicAuth
configuration = defectdojo_api_generated.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Configure API key authorization: cookieAuth
configuration.api_key['cookieAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookieAuth'] = 'Bearer'
# Configure API key authorization: tokenAuth
configuration.api_key['tokenAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['tokenAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with defectdojo_api_generated.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = defectdojo_api_generated.AssetsApi(api_client)
asset_request = defectdojo_api_generated.AssetRequest() # AssetRequest |
try:
api_response = api_instance.create(asset_request)
print("The response of AssetsApi->create:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AssetsApi->create: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| asset_request | AssetRequest |
Return type
Authorization
basicAuth, cookieAuth, tokenAuth
HTTP request headers
- Content-Type: application/json, application/x-www-form-urlencoded, multipart/form-data
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 201 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_preview_list
PaginatedDeletePreviewList delete_preview_list(id, limit=limit, offset=offset)
Example
- Basic Authentication (basicAuth):
- Api Key Authentication (cookieAuth):
- Api Key Authentication (tokenAuth):
import defectdojo_api_generated
from defectdojo_api_generated.models.paginated_delete_preview_list import PaginatedDeletePreviewList
from defectdojo_api_generated.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = defectdojo_api_generated.Configuration(
host = "http://localhost"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: basicAuth
configuration = defectdojo_api_generated.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Configure API key authorization: cookieAuth
configuration.api_key['cookieAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookieAuth'] = 'Bearer'
# Configure API key authorization: tokenAuth
configuration.api_key['tokenAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['tokenAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with defectdojo_api_generated.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = defectdojo_api_generated.AssetsApi(api_client)
id = 56 # int | A unique integer value identifying this product.
limit = 56 # int | Number of results to return per page. (optional)
offset = 56 # int | The initial index from which to return the results. (optional)
try:
api_response = api_instance.delete_preview_list(id, limit=limit, offset=offset)
print("The response of AssetsApi->delete_preview_list:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AssetsApi->delete_preview_list: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | A unique integer value identifying this product. | |
| limit | int | Number of results to return per page. | [optional] |
| offset | int | The initial index from which to return the results. | [optional] |
Return type
Authorization
basicAuth, cookieAuth, tokenAuth
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
destroy
destroy(id)
Example
- Basic Authentication (basicAuth):
- Api Key Authentication (cookieAuth):
- Api Key Authentication (tokenAuth):
import defectdojo_api_generated
from defectdojo_api_generated.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = defectdojo_api_generated.Configuration(
host = "http://localhost"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: basicAuth
configuration = defectdojo_api_generated.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Configure API key authorization: cookieAuth
configuration.api_key['cookieAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookieAuth'] = 'Bearer'
# Configure API key authorization: tokenAuth
configuration.api_key['tokenAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['tokenAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with defectdojo_api_generated.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = defectdojo_api_generated.AssetsApi(api_client)
id = 56 # int | A unique integer value identifying this product.
try:
api_instance.destroy(id)
except Exception as e:
print("Exception when calling AssetsApi->destroy: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | A unique integer value identifying this product. |
Return type
void (empty response body)
Authorization
basicAuth, cookieAuth, tokenAuth
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 204 | No response body | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
generate_report_create
ReportGenerate generate_report_create(id, report_generate_option_request=report_generate_option_request)
Example
- Basic Authentication (basicAuth):
- Api Key Authentication (cookieAuth):
- Api Key Authentication (tokenAuth):
import defectdojo_api_generated
from defectdojo_api_generated.models.report_generate import ReportGenerate
from defectdojo_api_generated.models.report_generate_option_request import ReportGenerateOptionRequest
from defectdojo_api_generated.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = defectdojo_api_generated.Configuration(
host = "http://localhost"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: basicAuth
configuration = defectdojo_api_generated.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Configure API key authorization: cookieAuth
configuration.api_key['cookieAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookieAuth'] = 'Bearer'
# Configure API key authorization: tokenAuth
configuration.api_key['tokenAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['tokenAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with defectdojo_api_generated.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = defectdojo_api_generated.AssetsApi(api_client)
id = 56 # int | A unique integer value identifying this product.
report_generate_option_request = defectdojo_api_generated.ReportGenerateOptionRequest() # ReportGenerateOptionRequest | (optional)
try:
api_response = api_instance.generate_report_create(id, report_generate_option_request=report_generate_option_request)
print("The response of AssetsApi->generate_report_create:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AssetsApi->generate_report_create: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | A unique integer value identifying this product. | |
| report_generate_option_request | ReportGenerateOptionRequest | [optional] |
Return type
Authorization
basicAuth, cookieAuth, tokenAuth
HTTP request headers
- Content-Type: application/json, application/x-www-form-urlencoded, multipart/form-data
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list
PaginatedAssetList list(asset_manager=asset_manager, asset_numeric_grade=asset_numeric_grade, business_criticality=business_criticality, created=created, description=description, external_audience=external_audience, has_tags=has_tags, id=id, internet_accessible=internet_accessible, lifecycle=lifecycle, limit=limit, name=name, name_exact=name_exact, not_tag=not_tag, not_tags=not_tags, o=o, offset=offset, organization=organization, origin=origin, outside_of_sla=outside_of_sla, platform=platform, prefetch=prefetch, regulations=regulations, revenue=revenue, tag=tag, tags=tags, tags__and=tags__and, team_manager=team_manager, technical_contact=technical_contact, tid=tid, updated=updated, user_records=user_records)
Example
- Basic Authentication (basicAuth):
- Api Key Authentication (cookieAuth):
- Api Key Authentication (tokenAuth):
import defectdojo_api_generated
from defectdojo_api_generated.models.paginated_asset_list import PaginatedAssetList
from defectdojo_api_generated.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = defectdojo_api_generated.Configuration(
host = "http://localhost"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: basicAuth
configuration = defectdojo_api_generated.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Configure API key authorization: cookieAuth
configuration.api_key['cookieAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookieAuth'] = 'Bearer'
# Configure API key authorization: tokenAuth
configuration.api_key['tokenAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['tokenAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with defectdojo_api_generated.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = defectdojo_api_generated.AssetsApi(api_client)
asset_manager = [56] # List[int] | Multiple values may be separated by commas. (optional)
asset_numeric_grade = [56] # List[int] | Multiple values may be separated by commas. (optional)
business_criticality = ['business_criticality_example'] # List[Optional[str]] | * `very high` - Very High * `high` - High * `medium` - Medium * `low` - Low * `very low` - Very Low * `none` - None (optional)
created = '2013-10-20T19:20:30+01:00' # datetime | Time that the object was initially created, and saved to the database * `None` - Any date * `1` - Today * `2` - Past 7 days * `3` - Past 30 days * `4` - Past 90 days * `5` - Current month * `6` - Current year * `7` - Past year (optional)
description = 'description_example' # str | (optional)
external_audience = True # bool | (optional)
has_tags = True # bool | Has tags (optional)
id = [56] # List[int] | Multiple values may be separated by commas. (optional)
internet_accessible = True # bool | (optional)
lifecycle = ['lifecycle_example'] # List[Optional[str]] | * `construction` - Construction * `production` - Production * `retirement` - Retirement (optional)
limit = 56 # int | Number of results to return per page. (optional)
name = 'name_example' # str | (optional)
name_exact = 'name_exact_example' # str | (optional)
not_tag = 'not_tag_example' # str | Not Tag name contains (optional)
not_tags = ['not_tags_example'] # List[str] | Comma separated list of exact tags not present on Product (optional)
o = ['o_example'] # List[str] | Ordering * `id` - Id * `-id` - Id (descending) * `tid` - Tid * `-tid` - Tid (descending) * `name` - Name * `-name` - Name (descending) * `created` - Created * `-created` - Created (descending) * `asset_numeric_grade` - Asset numeric grade * `-asset_numeric_grade` - Asset numeric grade (descending) * `business_criticality` - Business criticality * `-business_criticality` - Business criticality (descending) * `platform` - Platform * `-platform` - Platform (descending) * `lifecycle` - Lifecycle * `-lifecycle` - Lifecycle (descending) * `origin` - Origin * `-origin` - Origin (descending) * `revenue` - Revenue * `-revenue` - Revenue (descending) * `external_audience` - External audience * `-external_audience` - External audience (descending) * `internet_accessible` - Internet accessible * `-internet_accessible` - Internet accessible (descending) * `asset_manager` - Asset manager * `-asset_manager` - Asset manager (descending) * `asset_manager__first_name` - Asset manager first name * `-asset_manager__first_name` - Asset manager first name (descending) * `asset_manager__last_name` - Asset manager last name * `-asset_manager__last_name` - Asset manager last name (descending) * `technical_contact` - Technical contact * `-technical_contact` - Technical contact (descending) * `technical_contact__first_name` - Technical contact first name * `-technical_contact__first_name` - Technical contact first name (descending) * `technical_contact__last_name` - Technical contact last name * `-technical_contact__last_name` - Technical contact last name (descending) * `team_manager` - Team manager * `-team_manager` - Team manager (descending) * `team_manager__first_name` - Team manager first name * `-team_manager__first_name` - Team manager first name (descending) * `team_manager__last_name` - Team manager last name * `-team_manager__last_name` - Team manager last name (descending) * `organization` - Organization * `-organization` - Organization (descending) * `organization__name` - Organization name * `-organization__name` - Organization name (descending) * `updated` - Updated * `-updated` - Updated (descending) * `user_records` - User records * `-user_records` - User records (descending) (optional)
offset = 56 # int | The initial index from which to return the results. (optional)
organization = [56] # List[int] | Multiple values may be separated by commas. (optional)
origin = ['origin_example'] # List[Optional[str]] | * `third party library` - Third Party Library * `purchased` - Purchased * `contractor` - Contractor Developed * `internal` - Internally Developed * `open source` - Open Source * `outsourced` - Outsourced (optional)
outside_of_sla = 3.4 # float | (optional)
platform = ['platform_example'] # List[Optional[str]] | * `web service` - API * `desktop` - Desktop * `iot` - Internet of Things * `mobile` - Mobile * `web` - Web (optional)
prefetch = ['prefetch_example'] # List[str] | List of fields for which to prefetch model instances and add those to the response (optional)
regulations = [56] # List[int] | Multiple values may be separated by commas. (optional)
revenue = 3.4 # float | (optional)
tag = 'tag_example' # str | Tag name contains (optional)
tags = ['tags_example'] # List[str] | Comma separated list of exact tags (uses OR for multiple values) (optional)
tags__and = ['tags__and_example'] # List[str] | Comma separated list of exact tags to match with an AND expression (optional)
team_manager = [56] # List[int] | Multiple values may be separated by commas. (optional)
technical_contact = [56] # List[int] | Multiple values may be separated by commas. (optional)
tid = [56] # List[int] | Multiple values may be separated by commas. (optional)
updated = '2013-10-20T19:20:30+01:00' # datetime | Time that the object was most recently saved to the database * `None` - Any date * `1` - Today * `2` - Past 7 days * `3` - Past 30 days * `4` - Past 90 days * `5` - Current month * `6` - Current year * `7` - Past year (optional)
user_records = [56] # List[int] | Multiple values may be separated by commas. (optional)
try:
api_response = api_instance.list(asset_manager=asset_manager, asset_numeric_grade=asset_numeric_grade, business_criticality=business_criticality, created=created, description=description, external_audience=external_audience, has_tags=has_tags, id=id, internet_accessible=internet_accessible, lifecycle=lifecycle, limit=limit, name=name, name_exact=name_exact, not_tag=not_tag, not_tags=not_tags, o=o, offset=offset, organization=organization, origin=origin, outside_of_sla=outside_of_sla, platform=platform, prefetch=prefetch, regulations=regulations, revenue=revenue, tag=tag, tags=tags, tags__and=tags__and, team_manager=team_manager, technical_contact=technical_contact, tid=tid, updated=updated, user_records=user_records)
print("The response of AssetsApi->list:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AssetsApi->list: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| asset_manager | List[int] | Multiple values may be separated by commas. | [optional] |
| asset_numeric_grade | List[int] | Multiple values may be separated by commas. | [optional] |
| business_criticality | List[Optional[str]] | * `very high` - Very High * `high` - High * `medium` - Medium * `low` - Low * `very low` - Very Low * `none` - None | [optional] |
| created | datetime | Time that the object was initially created, and saved to the database * `None` - Any date * `1` - Today * `2` - Past 7 days * `3` - Past 30 days * `4` - Past 90 days * `5` - Current month * `6` - Current year * `7` - Past year | [optional] |
| description | str | [optional] | |
| external_audience | bool | [optional] | |
| has_tags | bool | Has tags | [optional] |
| id | List[int] | Multiple values may be separated by commas. | [optional] |
| internet_accessible | bool | [optional] | |
| lifecycle | List[Optional[str]] | * `construction` - Construction * `production` - Production * `retirement` - Retirement | [optional] |
| limit | int | Number of results to return per page. | [optional] |
| name | str | [optional] | |
| name_exact | str | [optional] | |
| not_tag | str | Not Tag name contains | [optional] |
| not_tags | List[str] | Comma separated list of exact tags not present on Product | [optional] |
| o | List[str] | Ordering * `id` - Id * `-id` - Id (descending) * `tid` - Tid * `-tid` - Tid (descending) * `name` - Name * `-name` - Name (descending) * `created` - Created * `-created` - Created (descending) * `asset_numeric_grade` - Asset numeric grade * `-asset_numeric_grade` - Asset numeric grade (descending) * `business_criticality` - Business criticality * `-business_criticality` - Business criticality (descending) * `platform` - Platform * `-platform` - Platform (descending) * `lifecycle` - Lifecycle * `-lifecycle` - Lifecycle (descending) * `origin` - Origin * `-origin` - Origin (descending) * `revenue` - Revenue * `-revenue` - Revenue (descending) * `external_audience` - External audience * `-external_audience` - External audience (descending) * `internet_accessible` - Internet accessible * `-internet_accessible` - Internet accessible (descending) * `asset_manager` - Asset manager * `-asset_manager` - Asset manager (descending) * `asset_manager__first_name` - Asset manager first name * `-asset_manager__first_name` - Asset manager first name (descending) * `asset_manager__last_name` - Asset manager last name * `-asset_manager__last_name` - Asset manager last name (descending) * `technical_contact` - Technical contact * `-technical_contact` - Technical contact (descending) * `technical_contact__first_name` - Technical contact first name * `-technical_contact__first_name` - Technical contact first name (descending) * `technical_contact__last_name` - Technical contact last name * `-technical_contact__last_name` - Technical contact last name (descending) * `team_manager` - Team manager * `-team_manager` - Team manager (descending) * `team_manager__first_name` - Team manager first name * `-team_manager__first_name` - Team manager first name (descending) * `team_manager__last_name` - Team manager last name * `-team_manager__last_name` - Team manager last name (descending) * `organization` - Organization * `-organization` - Organization (descending) * `organization__name` - Organization name * `-organization__name` - Organization name (descending) * `updated` - Updated * `-updated` - Updated (descending) * `user_records` - User records * `-user_records` - User records (descending) | [optional] |
| offset | int | The initial index from which to return the results. | [optional] |
| organization | List[int] | Multiple values may be separated by commas. | [optional] |
| origin | List[Optional[str]] | * `third party library` - Third Party Library * `purchased` - Purchased * `contractor` - Contractor Developed * `internal` - Internally Developed * `open source` - Open Source * `outsourced` - Outsourced | [optional] |
| outside_of_sla | float | [optional] | |
| platform | List[Optional[str]] | * `web service` - API * `desktop` - Desktop * `iot` - Internet of Things * `mobile` - Mobile * `web` - Web | [optional] |
| prefetch | List[str] | List of fields for which to prefetch model instances and add those to the response | [optional] |
| regulations | List[int] | Multiple values may be separated by commas. | [optional] |
| revenue | float | [optional] | |
| tag | str | Tag name contains | [optional] |
| tags | List[str] | Comma separated list of exact tags (uses OR for multiple values) | [optional] |
| tags__and | List[str] | Comma separated list of exact tags to match with an AND expression | [optional] |
| team_manager | List[int] | Multiple values may be separated by commas. | [optional] |
| technical_contact | List[int] | Multiple values may be separated by commas. | [optional] |
| tid | List[int] | Multiple values may be separated by commas. | [optional] |
| updated | datetime | Time that the object was most recently saved to the database * `None` - Any date * `1` - Today * `2` - Past 7 days * `3` - Past 30 days * `4` - Past 90 days * `5` - Current month * `6` - Current year * `7` - Past year | [optional] |
| user_records | List[int] | Multiple values may be separated by commas. | [optional] |
Return type
Authorization
basicAuth, cookieAuth, tokenAuth
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
partial_update
Asset partial_update(id, patched_asset_request=patched_asset_request)
Example
- Basic Authentication (basicAuth):
- Api Key Authentication (cookieAuth):
- Api Key Authentication (tokenAuth):
import defectdojo_api_generated
from defectdojo_api_generated.models.asset import Asset
from defectdojo_api_generated.models.patched_asset_request import PatchedAssetRequest
from defectdojo_api_generated.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = defectdojo_api_generated.Configuration(
host = "http://localhost"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: basicAuth
configuration = defectdojo_api_generated.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Configure API key authorization: cookieAuth
configuration.api_key['cookieAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookieAuth'] = 'Bearer'
# Configure API key authorization: tokenAuth
configuration.api_key['tokenAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['tokenAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with defectdojo_api_generated.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = defectdojo_api_generated.AssetsApi(api_client)
id = 56 # int | A unique integer value identifying this product.
patched_asset_request = defectdojo_api_generated.PatchedAssetRequest() # PatchedAssetRequest | (optional)
try:
api_response = api_instance.partial_update(id, patched_asset_request=patched_asset_request)
print("The response of AssetsApi->partial_update:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AssetsApi->partial_update: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | A unique integer value identifying this product. | |
| patched_asset_request | PatchedAssetRequest | [optional] |
Return type
Authorization
basicAuth, cookieAuth, tokenAuth
HTTP request headers
- Content-Type: application/json, application/x-www-form-urlencoded, multipart/form-data
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
retrieve
Asset retrieve(id, prefetch=prefetch)
Example
- Basic Authentication (basicAuth):
- Api Key Authentication (cookieAuth):
- Api Key Authentication (tokenAuth):
import defectdojo_api_generated
from defectdojo_api_generated.models.asset import Asset
from defectdojo_api_generated.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = defectdojo_api_generated.Configuration(
host = "http://localhost"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: basicAuth
configuration = defectdojo_api_generated.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Configure API key authorization: cookieAuth
configuration.api_key['cookieAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookieAuth'] = 'Bearer'
# Configure API key authorization: tokenAuth
configuration.api_key['tokenAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['tokenAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with defectdojo_api_generated.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = defectdojo_api_generated.AssetsApi(api_client)
id = 56 # int | A unique integer value identifying this product.
prefetch = ['prefetch_example'] # List[str] | List of fields for which to prefetch model instances and add those to the response (optional)
try:
api_response = api_instance.retrieve(id, prefetch=prefetch)
print("The response of AssetsApi->retrieve:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AssetsApi->retrieve: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | A unique integer value identifying this product. | |
| prefetch | List[str] | List of fields for which to prefetch model instances and add those to the response | [optional] |
Return type
Authorization
basicAuth, cookieAuth, tokenAuth
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
update
Asset update(id, asset_request)
Example
- Basic Authentication (basicAuth):
- Api Key Authentication (cookieAuth):
- Api Key Authentication (tokenAuth):
import defectdojo_api_generated
from defectdojo_api_generated.models.asset import Asset
from defectdojo_api_generated.models.asset_request import AssetRequest
from defectdojo_api_generated.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = defectdojo_api_generated.Configuration(
host = "http://localhost"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: basicAuth
configuration = defectdojo_api_generated.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Configure API key authorization: cookieAuth
configuration.api_key['cookieAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookieAuth'] = 'Bearer'
# Configure API key authorization: tokenAuth
configuration.api_key['tokenAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['tokenAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with defectdojo_api_generated.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = defectdojo_api_generated.AssetsApi(api_client)
id = 56 # int | A unique integer value identifying this product.
asset_request = defectdojo_api_generated.AssetRequest() # AssetRequest |
try:
api_response = api_instance.update(id, asset_request)
print("The response of AssetsApi->update:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AssetsApi->update: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | A unique integer value identifying this product. | |
| asset_request | AssetRequest |
Return type
Authorization
basicAuth, cookieAuth, tokenAuth
HTTP request headers
- Content-Type: application/json, application/x-www-form-urlencoded, multipart/form-data
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]