logo
logo

Class AddEndpointCommand

Adds a new Sitecore.CH.Cli.Core.Models.Endpoint and selects it as active.

Inheritance
System.Object
Sitecore.CH.Cli.Core.Abstractions.Commands.BaseCommand<Sitecore.CH.Cli.Core.CommandHandlers.Endpoints.AddEndpointCommandHandler>
AddEndpointCommand
Namespace: Sitecore.CH.Cli.Core.Commands.Endpoints
Assembly: Sitecore.CH.Cli.Core.dll
Syntax
public class AddEndpointCommand : BaseCommand<AddEndpointCommandHandler>
Remarks

Required parameters

  • --name -n Name for the endpoint.
  • --url -r Url for the endpoint.
  • --client-id -i Client ID for the endpoint.
  • --client-secret -s Client Secret for the endpoint.

Optional parameters

  • --password -p User password.
  • --username -u User name.
  • --redirect-uri -d Specifies a local URI to complete the OAuth flow. Needs to match the value configured for the given OAuth client. Default value: http://localhost:9000/

Global parameters

  • -? --help -h Show this help message and exit.
  • -v --verbosity Enables verbose logging.
Examples

Authenticate with and endpoint using user name and password from standard input:

cat ./password.txt | ch-cli endpoint add -n "<endpoint name>" -r "<endpoint url>" -i "<client id>" -s "<client secret>" -u "<user name>"

Authenticate with and endpoint using user name and password:

ch-cli endpoint add -n "<endpoint name>" -r "<endpoint url>" -i "<client id>" -s "<client secret>" -u "<user name>" -p "<password>"

Authenticate with and endpoint interactively:

ch-cli endpoint add -n "<endpoint name>" -r "<endpoint url>" -i "<client id>" -s "<client secret>"

Authenticate with and endpoint using a non-default redirect URI:

ch-cli endpoint add -n "<endpoint name>" -r "<endpoint url>" -i "<client id>" -s "<client secret>" --redirect-uri "http://localhost:9005/"

Can we improve this article ? Provide feedback