Skip to main content

Get connection parameters

Forms a structure of parameters for creating a connection

Function GetConnectionParameters(Val Address, Val Proto = Undefined, Val Metadata = Undefined) Export

ParameterCLI optionTypeRequiredDescription
Address--addrStringConnection address (with protocol)
Proto--protoArbitrarySchema or schema structure: Key > file name (for import), Value > schema as a string or file path
Metadata--metaStructure Of KeyAndValueMetadata structure, if necessary
Returns

Structure Of KeyAndValue - Connection parameters

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);
# 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"
}
}