Get connection parameters
Forms a structure of parameters for creating a connection
- Parameters
- Advanced call ?
Function GetConnectionParameters(Val Address, Val Proto = Undefined, Val Metadata = Undefined) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Address | --addr | String | ✔ | Connection address (with protocol) |
| Proto | --proto | Arbitrary | ✖ | Schema or schema structure: Key > file name (for import), Value > schema as a string or file path |
| Metadata | --meta | Structure Of KeyAndValue | ✖ | Metadata structure, if necessary |
Returns
Structure Of KeyAndValue - Connection parameters
| Parameter | Description |
|---|---|
| dontwait | Creates a background job and returns its data (for 1C and OneScript only) |
tip
Proto file name is used to allow further specification of this Proto in the import of another Proto It does not have to be a real file path. Proto files that are not involved in the import of other Protos can have arbitrary file names
If the Proto value is not an object (a key value collection), it will be interpreted as {"main.proto": passed value}
1C:Enterprise/OneScript code example
Address = "https://grpcb.in:9001";
Proto1 = "https://hut.openintegrations.dev/test_data/grpcbin_with_import.proto"; // String, path to file or URL
Proto2 = "https://hut.openintegrations.dev/test_data/mt.proto"; // String, path to file or URL
Scheme = New Map;
Scheme.Insert("main.proto" , Proto1); // Primary
Scheme.Insert("my_types.proto", Proto2); // For import in primary
Meta = New Structure("somekey", "somevalue");
Result = OPI_GRPC.GetConnectionParameters(Address, Scheme, Meta);
- Bash
- CMD/Bat
# JSON data can also be passed as a path to a .json file
oint grpc GetConnectionParameters \
--addr "https://grpcb.in:9001" \
--proto "{'main.proto':'https://hut.openintegrations.dev/test_data/grpcbin_with_import.proto','my_types.proto':'https://hut.openintegrations.dev/test_data/mt.proto'}"
:: JSON data can also be passed as a path to a .json file
oint grpc GetConnectionParameters ^
--addr "https://grpcb.in:9001" ^
--proto "{'main.proto':'https://hut.openintegrations.dev/test_data/grpcbin_with_import.proto','my_types.proto':'https://hut.openintegrations.dev/test_data/mt.proto'}"
Result
{
"address": "https://grpcb.in:9001",
"metadata": {
"somekey": "***"
},
"proto": {
"main.proto": "https://hut.openintegrations.dev/test_data/grpcbin_with_import.proto",
"my_types.proto": "https://hut.openintegrations.dev/test_data/mt.proto"
}
}