cli-generator

command
v2.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

README

Atlas CLI Generator

⚠ PREVIEW ⚠ this tools is still in preview and it might be not suitable for all use cases.

Usage

Open spec.yaml and add to your needs later run make gen-code.

Adding Stores

Add a new entry like this:

  - base_file_name: data_lake_pipeline # this will be internal/store/data_lake_pipeline.go
    template: store # only template available for stores
    creator: # possible versions include `creator`, `updater`, `describer`, `lister` and `deleter`
      name: PipelineCreator # interface name
      method: CreatePipeline # interface func
      sdk_method: DataLakePipelinesApi.CreatePipeline # API from SDKv2 to call
      arg_type: 'atlasv2.IngestionPipeline' # Argument type
      arg_name: IngestionPipeline # Argument method to call on SDK
      return_type: '*atlasv2.IngestionPipeline' # Type the SDK returns
Adding Commands

Add a new entry like this:

  - command_path: atlas dataLake pipeline # parent command path
    package_name: pipeline # package name for the folder
    description: Data Lake Pipelines. # description of the command
    template: parent # template can be 'parent', 'list', 'describe', 'create', 'update' or 'delete'
    sub_commands: # parent commands normally have subcommands
      - command_path: atlas dataLake pipeline create # child command path
        package_name: pipeline # package name for the folder (should match parent command)
        store_name: PipelineCreator # name of the store (interface name)
        store_method: CreatePipeline # store method (interface func)
        description: Creates a new Data Lake Pipeline. To use this resource, the requesting API Key must have the Project Owner role. # description of the command
        template: create # template to be used by the command
        output_template: Pipeline {{ .Name }} created. # template to be used by the command (used by templates 'list', 'describe', 'create' and 'update')
        id_name: pipelineName # id passed to the command (used by templates 'describe', 'delete', 'create' and 'update')
        id_description: Name of the pipeline # description of id passed to the command (used by templates 'describe', 'delete', 'create' and 'update')
        request_type: 'atlasv2.IngestionPipeline' # type used to compose the entity passed to the SDK (used by templates 'create' and 'update')

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL