APIPortal / Client / update_product
update_product¶
- APIPortal.Client.update_product(**kwargs)¶
Updates a product. Only the fields supplied in the request are changed.
See also: AWS API Documentation
Request Syntax
response = client.update_product( productId='string', displayName='string', description='string', displayOrder={ 'overviewPageArn': 'string', 'productPageArns': [ 'string', ], 'contents': [ { 'sectionName': 'string', 'productApiPageArns': [ 'string', ] }, ] }, apiSelectionConfiguration={ 'apiSelectionMode': 'CUSTOM'|'RULE_BASED', 'ruleFilters': [ { 'key': 'RESOURCE_ARN'|'HOST'|'METHOD'|'PATH'|'PORT'|'ACCOUNT', 'values': [ 'string', ] }, ] } )
- Parameters:
productId (string) –
[REQUIRED]
The identifier of the product.
displayName (string) – The new name of the product. Omit it to keep the current name.
description (string) – The new description of the product. Omit it to keep the current description.
displayOrder (dict) –
The new page order. Omit it to keep the current order.
overviewPageArn (string) –
The ARN of the product page shown as the product overview.
productPageArns (list) –
A product has at most DocHubLimits.DEFAULT_PAGES_PER_PRODUCT_LIMIT (40) pages, enforced by LimitsHelper.
(string) –
contents (list) –
Sections in a product’s navigation. No service-side limit exists today; this bound caps request size.
(dict) –
A named group of API pages in the portal navigation.
sectionName (string) –
Shown in the portal navigation. Same bound as page titles and operation names, and no control characters (the service rejects a blank name).
productApiPageArns (list) –
API pages in one section. No service-side limit exists today; this bound caps request size.
(string) –
apiSelectionConfiguration (dict) –
The new API selection settings. The selection mode must match the mode the product was created with. Omit it to keep the current settings.
apiSelectionMode (string) – [REQUIRED]
How a product’s member Managed APIs are chosen. CUSTOM - the customer associates and disassociates Managed APIs explicitly. RULE_BASED - membership is derived from ruleFilters: every Managed API in the account that matches is associated, and nothing else is. BatchAssociateManagedApi and BatchDisassociateManagedApi are rejected for these products.
Fixed at create time. UpdateProduct cannot change the mode of an existing product.
ruleFilters (list) –
Required for RULE_BASED, rejected for CUSTOM. Filters are combined with AND, the values within one filter with OR, and evaluated only over the account’s Managed APIs. Replaced as a whole on update, not merged.
(dict) –
Values are compared to the attribute as literals: exact and case-sensitive, no wildcards.
key (string) – [REQUIRED]
The Managed API attribute a RuleFilter compares against. RESOURCE_ARN - apiSignature.resourceArn HOST - apiSignature.hostname METHOD - apiSignature.method, so values must be HttpMethod names PATH - apiSignature.path PORT - apiSignature.port, compared as its decimal string, so values must be 0-65535 with no leading zeros ACCOUNT - the account hosting the API, which for an ORGANIZATION-scoped Managed API is the member account rather than the account that created it
values (list) – [REQUIRED]
The values to match. The filter matches when the attribute equals any of them.
(string) –
Bounded by the longest matchable attribute, apiSignature.path.
No whitespace: none of the matchable attributes (ARN, hostname, method, path, port, account) contain any. Per-key formats (METHOD, PORT, ACCOUNT) are enforced in ProductValidator.validateRuleFilterValue, since one pattern cannot express them for a value shared by every key.
- Return type:
dict
- Returns:
Response Syntax
{ 'productId': 'string', 'productArn': 'string', 'displayName': 'string', 'displayOrder': { 'overviewPageArn': 'string', 'productPageArns': [ 'string', ], 'contents': [ { 'sectionName': 'string', 'productApiPageArns': [ 'string', ] }, ] }, 'description': 'string', 'updatedAt': datetime(2015, 1, 1), 'apiSelectionConfiguration': { 'apiSelectionMode': 'CUSTOM'|'RULE_BASED', 'ruleFilters': [ { 'key': 'RESOURCE_ARN'|'HOST'|'METHOD'|'PATH'|'PORT'|'ACCOUNT', 'values': [ 'string', ] }, ] }, 'status': 'ACTIVE'|'IN_PROGRESS'|'FAILED', 'failureReason': 'API_PAGE_ATTACHED'|'EVALUATION_ERROR' }
Response Structure
(dict) –
productId (string) –
The identifier of the product.
productArn (string) –
The ARN of the product.
displayName (string) –
The name of the product, from 1 to 255 characters.
displayOrder (dict) –
The order of the product’s pages and API page sections in the portal navigation.
overviewPageArn (string) –
The ARN of the product page shown as the product overview.
productPageArns (list) –
A product has at most DocHubLimits.DEFAULT_PAGES_PER_PRODUCT_LIMIT (40) pages, enforced by LimitsHelper.
(string) –
contents (list) –
Sections in a product’s navigation. No service-side limit exists today; this bound caps request size.
(dict) –
A named group of API pages in the portal navigation.
sectionName (string) –
Shown in the portal navigation. Same bound as page titles and operation names, and no control characters (the service rejects a blank name).
productApiPageArns (list) –
API pages in one section. No service-side limit exists today; this bound caps request size.
(string) –
description (string) –
A description of the product, up to 1024 characters.
updatedAt (datetime) –
When the resource was last updated.
apiSelectionConfiguration (dict) –
How Managed APIs are selected for the product.
apiSelectionMode (string) –
How a product’s member Managed APIs are chosen. CUSTOM - the customer associates and disassociates Managed APIs explicitly. RULE_BASED - membership is derived from ruleFilters: every Managed API in the account that matches is associated, and nothing else is. BatchAssociateManagedApi and BatchDisassociateManagedApi are rejected for these products.
Fixed at create time. UpdateProduct cannot change the mode of an existing product.
ruleFilters (list) –
Required for RULE_BASED, rejected for CUSTOM. Filters are combined with AND, the values within one filter with OR, and evaluated only over the account’s Managed APIs. Replaced as a whole on update, not merged.
(dict) –
Values are compared to the attribute as literals: exact and case-sensitive, no wildcards.
key (string) –
The Managed API attribute a RuleFilter compares against. RESOURCE_ARN - apiSignature.resourceArn HOST - apiSignature.hostname METHOD - apiSignature.method, so values must be HttpMethod names PATH - apiSignature.path PORT - apiSignature.port, compared as its decimal string, so values must be 0-65535 with no leading zeros ACCOUNT - the account hosting the API, which for an ORGANIZATION-scoped Managed API is the member account rather than the account that created it
values (list) –
The values to match. The filter matches when the attribute equals any of them.
(string) –
Bounded by the longest matchable attribute, apiSignature.path.
No whitespace: none of the matchable attributes (ARN, hostname, method, path, port, account) contain any. Per-key formats (METHOD, PORT, ACCOUNT) are enforced in ProductValidator.validateRuleFilterValue, since one pattern cannot express them for a value shared by every key.
status (string) –
Whether the product’s member APIs match its apiSelectionConfiguration. ACTIVE - membership matches. The only status a CUSTOM product reports. IN_PROGRESS - ruleFilters changed and membership is still being evaluated. FAILED - evaluation could not finish and membership is incomplete; failureReason says why.
failureReason (string) –
Reason a product’s rules could not be fully applied, present only when
statusisFAILED. New reasons may be added over time, so clients MUST treat any unrecognized value asUNKNOWNand fall back to generic handling.
Exceptions