Using the product commands
You can use the product commands to get and list the products on your Developer Portal service.
- Log in as Provider org as seen in the following
example.
apic login --server management_server --realm provider/identity_provider --username provider_username --password provider_passwordYou can determine which identity provider to use in the--realmparameter by entering the following command to see a list of all available identity providers (you do not need to be logged in to use this command):
For example,apic identity-providers:list --scope provider --server platform_api_endpoint_url --fields title,realm
Theapic identity-providers:list --scope provider --server platform_api_endpoint_url --fields title,realm total_results: 2 results: - title: API Manager User Registry realm: provider/default-idp-2 - title: Corporate LDAP user registry realm: provider/corporate-ldaptitlevalue should enable you to determine which identity provider to use; you can then copy the corresponding--realmparameter directly from the displayedrealmvalue. For any identity providers that your administrator created after API Connect was installed, the names are determined at creation time. The default API Manager Local User Registry for login as a member of a provider organization isdefault-idp-2.For full details of the
apic logincommand, see Logging in to a management server.For a summary of the general-purpose commands and their use, see Developer Portal CLI commands.
- Get a list of products from a site.
For example,
apic --mode portaladmin product:list --org orgid/name --server management_server --catalog catalogid/namemanagement_serveris the endpoint URL of the management server (required).catalogid/nameis the ID or name of the catalog that the site belongs to (required).orgid/nameis the ID or name of the provider organization that the catalog belongs to (required).format_typeis the output format. Can bejson,yaml,go-template=...,go-template-file=.... Defaults toyaml.
- Get a product from a site by using the
idorname:version.For example,apic --mode portaladmin product:get --org orgid/name --server management_server --catalog catalogid/name id/name:versionid/name:version- The ID or name:version of a specific product (required). For example,id-of-product-called-example-3orexample:3.0.0.
- Get a specific entire product document from the portal of the provided organization and catalog
by using the
idorname:version.
For example,apic --mode portaladmin product:get-document --org orgid/name --server management_server --catalog catalogid/name --format format_type id/name:versionapic --mode portaladmin product:get-document --org ibm --server my.management.server.com --catalog portal-test --format yaml intuiz-product:1.0.0 -
Add an attachment for your product within your Developer Portal.
For example,
apic --mode portaladmin product:add-attachment -s management_server --org orgid/name --catalog catalogid/name --attachment_name attachment.txt --attachment_description "Product documentation" awesome-sleek-soft-chips-product:1.0.0 ./attachment.txt Loading File (Large files may take a while)... Attachment successfully added to product awesome-sleek-soft-chips-product:1.0.0. This product now has 2 attachments.attachment_nameis the name given to the attachment when it is uploaded (required).attachment_descriptionis the description of the attachment that is displayed to the users.
- Set an icon for your product within your Developer Portal.
For example,
apic --mode portaladmin product:set-icon -s management_server --org orgid/name --catalog catalogid/name --icon_description "product icon" awesome-sleek-soft-chips-product:1.0.0 ./icon.png Loading File (Large files may take a while)... Icon successfully set for product awesome-sleek-soft-chips-product:1.0.0icon_descriptionis the icon description to be displayed to users and it is used as an alt text for the image (required).
- Add a tag (Category) for your product within your Developer Portal.
For example,
apic --mode portaladmin product:add-tag -s management_server--org orgid/name --catalog catalogid/name --tag_name top_level_element/next_level_element/lower_level_element awesome-sleek-soft-chips-product:1.0.0 Successfully set taxonomy tag top_level_element/next_level_element/lower_level_element for product api-connect-cassin-llc-awesome-sleek-soft-chips-product:1.0.0tag_nameis the tag name. For example,top_level_element/next_level_element(required).