Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 22 additions & 26 deletions doc/commands/businessservice.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,36 @@
# rap
# rap (deprecated)

1. [definition activate](#activate)
2. [biding publish](#publish)
The `rap` command group is **deprecated**. Both subcommands listed here
emit a stderr deprecation warning when invoked and delegate to the new
top-level `srvd` / `srvb` groups. They will be removed in the next
minor release.

## definition
| Old (deprecated) | New equivalent |
| ------------------------------- | --------------------------- |
| `sapcli rap definition activate` | `sapcli srvd activate` |
| `sapcli rap binding publish` | `sapcli srvb publish` |

### activate
For full CRUD on Service Definitions and Service Bindings, see:

Activates the give Business Service Definition
- [`doc/commands/srvd.md`](srvd.md)
- [`doc/commands/srvb.md`](srvb.md)

## definition activate (deprecated)

Activates the given Business Service Definition. Same semantics as
`sapcli srvd activate`; this alias only writes a deprecation warning
to stderr and forwards.

```bash
sapcli rap definition activate NAME [NAME [NAME ...]]
```

**Parameters**:
- `NAME`: A business service definition name to activate

## binding

### publish
## binding publish (deprecated)

Publishes a desired oData service name or oData service version in the corresponding service binding
Publishes a desired oData service name or oData service version in the
corresponding service binding. Same semantics as `sapcli srvb publish`;
this alias only writes a deprecation warning to stderr and forwards.

```bash
sapcli rap binding publish BINDING_NAME [--service SERVICE_NAME] [--version SERVICE_VERSION]
```

**Parameters**:
- `BINDING_NAME`: A business service binding whose service definition will be published
- `--service SERVICE_NAME`: Name of the service to publish
- `--version SERVICE_VERSION`: Version of the service to publish

If no SERVICE\_NAME nor SERVICE\_VERSION is supplied and the binding contains only
one service, that service will be published by default. Otherwise, the command
will exit with non-0 code and action will be performed.

If SERVICE\_NAME or SERVICE\_VERSION or both values are supplied, a first service
matching the give parameters will be published. If there is no such a service,
the operation will be aborted and sapcli will exit with non-0 code.
125 changes: 125 additions & 0 deletions doc/commands/srvb.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Service Binding (SRVB)

CRUD commands for the ABAP RAP **Service Binding** object (`SRVB/SVB`),
plus `publish` and a `preview` sub-group for inspecting the bound OData
service at runtime.

The Service Binding has no `text/plain` source body, so a top-level
`write` command is not provided - the binding's configuration lives in
XML attributes/nodes which require a JSON round-trip (planned for a
future version).

1. [create](#create)
2. [read](#read)
3. [activate](#activate)
4. [publish](#publish)
5. [delete](#delete)
6. [whereused](#whereused)
7. [preview](#preview)
- [preview metadata](#preview-metadata)
- [preview fetch](#preview-fetch)

## create

Creates a new (inactive) Service Binding wired to an existing Service
Definition. The server rejects an empty binding, so `--service-definition`
is required.

```bash
sapcli srvb create NAME DESCRIPTION PACKAGE \
--binding-type {ODATAV2_UI,ODATAV2_API,ODATAV4_UI,ODATAV4_API} \
--service-definition SERVICE_DEFINITION_NAME \
[--service-version SERVICE_VERSION] \
[--corrnr TRANSPORT]
```

- **--binding-type** - Service Binding type. Selects both contract
(OData V2 / V4) and category (`UI` or `API`).
- **--service-definition** - name of the Service Definition (SRVD) that
this binding exposes.
- **--service-version** - version of the wired Service Definition
(default: `0001`).
- **--corrnr** - transport request number.

## read

Print a structural summary of the binding (name, description, package,
type, version, published flag, list of bound services).

```bash
sapcli srvb read NAME
```

## activate

Activates the given Service Bindings.

```bash
sapcli srvb activate NAME [NAME ...] [--ignore-errors] [--warning-errors]
```

- **--ignore-errors** - do not stop activation in case of errors.
- **--warning-errors** - treat activation warnings as errors.

## publish

Publish the OData / INA / SQL service exposed by the binding to its
local service endpoint.

```bash
sapcli srvb publish BINDING_NAME [--service SERVICE_NAME] [--version SERVICE_VERSION]
```

If the binding contains exactly one service, omitting `--service` and
`--version` publishes that one. Otherwise, the two filters narrow which
`<srvb:content>` entry is selected.

## delete

Deletes the given Service Bindings.

```bash
sapcli srvb delete NAME [NAME ...] [--corrnr TRANSPORT]
```

- **--corrnr** - transport request number.

## whereused

Find objects that reference the given Service Binding.

```bash
sapcli srvb whereused NAME
```

## preview

Sub-group of utilities for previewing the OData service exposed by a
Service Binding without leaving the command line. Each command takes
the binding name and, when the binding contains more than one Service
Definition, requires `--service` to disambiguate.

### preview metadata

Download and print the OData `$metadata` document of the bound service.

```bash
sapcli srvb preview metadata BINDING_NAME [--service SERVICE_NAME]
```

- **--service** - name of the binding's service to preview. Required
only when the binding contains more than one Service Definition.

### preview fetch

Fetch entries of an entity set from the bound OData service and print
the JSON response.

```bash
sapcli srvb preview fetch BINDING_NAME ENTITY_SET [--service SERVICE_NAME]
```

- **ENTITY_SET** - name of the OData entity set to read (e.g.
`BookSet`).
- **--service** - name of the binding's service to preview. Required
only when the binding contains more than one Service Definition.
77 changes: 77 additions & 0 deletions doc/commands/srvd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Service Definition (SRVD)

CRUD commands for the ABAP RAP **Service Definition** object (`SRVD/SRV`).
The source body is plain CDS service definition syntax
(`define service ... { expose ... }`).

1. [create](#create)
2. [read](#read)
3. [write](#write)
4. [activate](#activate)
5. [delete](#delete)
6. [whereused](#whereused)

## create

Creates a new (inactive) Service Definition in the given package.

```bash
sapcli srvd create NAME DESCRIPTION PACKAGE [--corrnr TRANSPORT]
```

The empty body is created on the server with `srvd:srvdSourceType="S"`.
Use `sapcli srvd write` to upload the actual `define service { ... }` source.

## read

Download the source of the given Service Definition.

```bash
sapcli srvd read NAME
```

## write

Upload source code into an existing Service Definition. The name argument
can be either an explicit object name, or `-` to deduce the name from the
file name (in which case multiple file paths are allowed).

```bash
sapcli srvd write NAME FILEPATH [-a] [--ignore-errors] [--warning-errors] [--check|--no-check] [--corrnr TRANSPORT]
sapcli srvd write - FILEPATH [FILEPATH ...] [-a] [--ignore-errors] [--warning-errors] [--check|--no-check] [--corrnr TRANSPORT]
```

Pass `-` as the file name to read source from standard input.

- **-a, --activate** - activate after write.
- **--ignore-errors** - do not stop activation on errors.
- **--warning-errors** - treat activation warnings as errors.
- **--check / --no-check** - run abapCheckRun before write
(overrides `SAPCLI_CHECK_BEFORE_SAVE`).

## activate

Activates the given Service Definitions in the listed order.

```bash
sapcli srvd activate NAME [NAME ...] [--ignore-errors] [--warning-errors]
```

- **--ignore-errors** - do not stop activation on errors.
- **--warning-errors** - treat activation warnings as errors.

## delete

Deletes the given Service Definitions.

```bash
sapcli srvd delete NAME [NAME ...] [--corrnr TRANSPORT]
```

## whereused

Find objects that reference the given Service Definition.

```bash
sapcli srvd whereused NAME
```
Loading
Loading