put
Add or update a region entry.
Availability: Online. You must be connected in gfsh
to a JMX Manager member to use this command.
Syntax:
put --key=value --value=value --region=value [--key-class=value]
[--value-class=value] [--if-not-exists(=value)]
Name | Description | Default Value |
---|---|---|
--key | Required. String or JSON text from which to create the key. For example: “James ”, “100L ” and “('id': 'l34s') ”. |
|
--value | Required. String or JSON text from which to create the value. For example: “James ”, “100L ” and “('id': 'l34s') ”. |
|
‑‑region | Required. Region into which the entry will be put. | |
‑‑key-class | Fully qualified class name of the key’s type. | java.lang.String |
--value-class | Fully qualified class name of the value’s type. The type may not be an internal PDX class. | java.lang.String |
‑‑value-class | Fully qualified class name of the value’s type. The type may not be an internal PDX class. | java.lang.String |
--if-not-exists | Skip the put operation when an entry with the same key already exists. | false |
Example Commands:
put --key=('id':'133abg125') --value=('firstname':'James','lastname':'Gosling')
--region=/region1 --key-class=data.ProfileKey --value-class=data.ProfileDetails
put --key=('133abg124') --value=('Hello World!!') --region=/region2
put --key=('100F') --value=('2146547689879658564') --region=/region1/region12
--key-class=java.lang.Float --value-class=java.lang.Long
Sample Output:
gfsh>put --key=('123abc') --value=('Hello World!!') --region=region2
Result : true
Key Class : java.lang.String
Key : ('123abc')
Value Class : java.lang.String
Old Value : <NULL>
Error Messages:
"Region name is either empty or Null";
"Key is either empty or Null";
"Value is either empty or Null";
"Region <{0}> not found in any of the members";
"Region <{0}> Not Found";
"Key is not present in the region";