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
26 changes: 21 additions & 5 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "^.secrets.baseline$",
"lines": "(?i)^\\s*\"(?:transaction|x-couch-request|x-request)-id\": \"[^\"]+\",?$|^\\s*\"(?:last_|update_|purge_|checkpointed_source_|source_|through_)?seq\": \"[^\"]+\",?$|^\\s*\"(?:doc_)?id\": \"[^\"]+\",?$|^\\s*\"(?:signature|name|uuid)\": \"[^\"]+\",?$"
},
"generated_at": "2025-08-15T10:14:15Z",
"generated_at": "2025-10-03T09:46:18Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down Expand Up @@ -82,7 +82,7 @@
"hashed_secret": "bb589d0621e5472f470fa3425a234c74b1e202e8",
"is_secret": false,
"is_verified": false,
"line_number": 325,
"line_number": 341,
"type": "Secret Keyword",
"verified_result": null
}
Expand All @@ -109,7 +109,15 @@
],
"examples/README.md": [
{
"hashed_secret": "701e4e52db78a3657f5bc71fd174cf29e7868fbd",
"hashed_secret": "7740cecbbf3c508248997e0b3b1c24cc00a2759a",
"is_secret": false,
"is_verified": false,
"line_number": 375,
"type": "Base64 High Entropy String",
"verified_result": null
},
{
"hashed_secret": "7740cecbbf3c508248997e0b3b1c24cc00a2759a",
"is_secret": false,
"is_verified": false,
"line_number": 375,
Expand All @@ -135,7 +143,15 @@
],
"examples/snippets/putReplicationDocument/example_request.py": [
{
"hashed_secret": "701e4e52db78a3657f5bc71fd174cf29e7868fbd",
"hashed_secret": "7740cecbbf3c508248997e0b3b1c24cc00a2759a",
"is_secret": false,
"is_verified": false,
"line_number": 11,
"type": "Base64 High Entropy String",
"verified_result": null
},
{
"hashed_secret": "7740cecbbf3c508248997e0b3b1c24cc00a2759a",
"is_secret": false,
"is_verified": false,
"line_number": 11,
Expand Down Expand Up @@ -216,7 +232,7 @@
}
]
},
"version": "0.13.1+ibm.62.dss",
"version": "0.13.1+ibm.64.dss",
"word_list": {
"file": null,
"hash": null
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,14 @@ or programmatically.

Quick start for Cloudant with an IAM API key:
```sh
CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL # use your own Cloudant public or private URL
CLOUDANT_URL=https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_APIKEY=a1b2c3d4e5f6f1g4h7j3k6l9m2p5q8s1t4v7x0z3 # use your own IAM API key
```

Quick start for Apache CouchDB with a username/password session:
```sh
CLOUDANT_AUTH_TYPE=COUCHDB_SESSION
CLOUDANT_URL=http://~replaceWithYourUniqueHost~.example:5984 # use your CouchDB URL
CLOUDANT_URL=https://~replace-with-your-unique-host~.example:6984 # use your CouchDB URL
CLOUDANT_USERNAME=username # replace with your username
CLOUDANT_PASSWORD=password # replace with your password
```
Expand Down
20 changes: 10 additions & 10 deletions docs/Authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ amending the values with your own
`CLOUDANT_AUTH_TYPE` to `IAM` because it is the default when supplying an `APIKEY`.

```sh
CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_URL=https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_APIKEY=a1b2c3d4e5f6f1g4h7j3k6l9m2p5q8s1t4v7x0z3 # use your own IAM API key
```

Expand All @@ -69,8 +69,8 @@ amending with your own correct values. There is no need to set
`CLOUDANT_AUTH_TYPE` to `CONTAINER` because it is the default.

```sh
CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_IAM_PROFILE_ID=iam-Profile-00000000-aaaa-4444-bbbb-0123456789ab # use your own IAM profile ID
CLOUDANT_URL=https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_IAM_PROFILE_ID=iam-Profile-00000000-0000-0000-0000-000000000000 # use your own IAM profile ID
```

Alternatives to `CLOUDANT_IAM_PROFILE_ID`:
Expand All @@ -83,8 +83,8 @@ amending with your own correct values.

```sh
CLOUDANT_AUTH_TYPE=VPC
CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_IAM_PROFILE_ID=iam-Profile-00000000-aaaa-4444-bbbb-0123456789ab # use your own IAM profile ID
CLOUDANT_URL=https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_IAM_PROFILE_ID=iam-Profile-00000000-0000-0000-0000-000000000000 # use your own IAM profile ID
```

Alternatives to `CLOUDANT_IAM_PROFILE_ID`:
Expand All @@ -98,8 +98,8 @@ amending with your own correct values.

```sh
CLOUDANT_AUTH_TYPE=IAMASSUME
CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_IAM_PROFILE_ID=iam-Profile-00000000-aaaa-4444-bbbb-0123456789ab # use your own IAM profile ID
CLOUDANT_URL=https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_IAM_PROFILE_ID=iam-Profile-00000000-0000-0000-0000-000000000000 # use your own IAM profile ID
```

Alternatives to `CLOUDANT_IAM_PROFILE_ID`:
Expand All @@ -113,7 +113,7 @@ amending with your own [service credentials](https://cloud.ibm.com/docs/Cloudant

```sh
CLOUDANT_AUTH_TYPE=COUCHDB_SESSION
CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_URL=https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_USERNAME=username # replace with your Cloudant legacy username
CLOUDANT_PASSWORD=password # replace with your Cloudant legacy password or API key (not IAM)
```
Expand All @@ -127,7 +127,7 @@ amending with your own correct values.

```sh
CLOUDANT_AUTH_TYPE=BEARERTOKEN
CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_URL=https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_BEARER_TOKEN=A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c # replace with your bearer token
```

Expand All @@ -140,7 +140,7 @@ amending with your own correct values.

```sh
CLOUDANT_AUTH_TYPE=BASIC
CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_URL=https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_USERNAME=username # replace with your Cloudant legacy username
CLOUDANT_PASSWORD=password # replace with your Cloudant legacy password or API key (not IAM)
```
Expand Down
32 changes: 16 additions & 16 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ service = CloudantV1.new_instance()

response = service.delete_replication_document(
doc_id='repldoc-example',
rev='3-a0ccbdc6fe95b4184f9031d086034d85'
rev='1-00000000000000000000000000000000'
).get_result()

print(response)
Expand Down Expand Up @@ -368,18 +368,18 @@ from ibmcloudant.cloudant_v1 import CloudantV1, ReplicationDocument, Replication
service = CloudantV1.new_instance()

source_db = ReplicationDatabase(
url='<your-source-service-url>/animaldb'
url='https://~replace-with-source-host~.cloudantnosqldb.appdomain.cloud/animaldb'
)

target_auth_iam = ReplicationDatabaseAuthIam(
api_key='<your-iam-api-key>'
api_key='a1b2c3d4e5f6f1g4h7j3k6l9m2p5q8s1t4v7x0z3' #use your own IAM API key
)
target_auth = ReplicationDatabaseAuth(
iam=target_auth_iam
)
target_db = ReplicationDatabase(
auth=target_auth,
url='<your-target-service-url>/animaldb-target'
url='https://~replace-with-target-host~.cloudantnosqldb.appdomain.cloud/animaldb-target'
)

replication_document = ReplicationDocument(
Expand Down Expand Up @@ -586,7 +586,7 @@ from ibmcloudant.cloudant_v1 import CloudantV1

service = CloudantV1.new_instance()

response = service.delete_database(db='<db-name>').get_result()
response = service.delete_database(db='products').get_result()

print(response)
```
Expand Down Expand Up @@ -797,12 +797,12 @@ service = CloudantV1.new_instance()

event_doc_1 = Document(
_id="ns1HJS13AMkK:0007241142412418284",
_rev="1-5005d65514fe9e90f8eccf174af5dd64",
_rev="1-00000000000000000000000000000000",
_deleted=True,
)
event_doc_2 = Document(
_id="H8tDIwfadxp9:0007241142412418285",
_rev="1-2d7810b054babeda4812b3924428d6d6",
_rev="1-00000000000000000000000000000000",
_deleted=True,
)

Expand Down Expand Up @@ -873,10 +873,10 @@ service = CloudantV1.new_instance()
doc_id = 'order00067'
bulk_get_doc_1 = BulkGetQueryDocument(
id=doc_id,
rev='3-917fa2381192822767f010b95b45325b')
rev='3-22222222222222222222222222222222')
bulk_get_doc_2 = BulkGetQueryDocument(
id=doc_id,
rev='4-a5be949eeb7296747cc271766e9a498b')
rev='4-33333333333333333333333333333333')

response = service.post_bulk_get(
db='orders',
Expand Down Expand Up @@ -915,7 +915,7 @@ service = CloudantV1.new_instance()

bulk_get_doc = BulkGetQueryDocument(
id='order00058',
atts_since=['1-99b02e08da151943c2dcb40090160bb8'])
atts_since=['1-00000000000000000000000000000000'])
response = service.post_bulk_get(
db='orders',
docs=[bulk_get_doc]
Expand Down Expand Up @@ -977,7 +977,7 @@ service = CloudantV1.new_instance()
response = service.delete_design_document(
db='products',
ddoc='appliances',
rev='1-98e6a25b3b45df62e7d47095ac15b16a'
rev='1-00000000000000000000000000000000'
).get_result()

print(response)
Expand Down Expand Up @@ -1681,9 +1681,9 @@ service = CloudantV1.new_instance()

revs_diff = DocumentRevisions(
order00077=[
"<1-missing-revision>",
"<2-missing-revision>",
"<3-possible-ancestor-revision>"
"1-00000000000000000000000000000000", # missing revision
"2-11111111111111111111111111111111", # missing revision
"3-22222222222222222222222222222222" # possible ancestor revision
]
)

Expand Down Expand Up @@ -1804,7 +1804,7 @@ service = CloudantV1.new_instance()
response = service.delete_document(
db='orders',
doc_id='order00058',
rev='1-99b02e08da151943c2dcb40090160bb8'
rev='1-00000000000000000000000000000000'
).get_result()

print(response)
Expand Down Expand Up @@ -1898,7 +1898,7 @@ response = service.delete_attachment(
db='products',
doc_id='1000042',
attachment_name='product_details.txt',
rev='4-1a0d1cd6f40472509e9aac646183736a'
rev='4-33333333333333333333333333333333'
).get_result()

print(response)
Expand Down
2 changes: 1 addition & 1 deletion examples/snippets/deleteAttachment/example_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
db='products',
doc_id='1000042',
attachment_name='product_details.txt',
rev='4-1a0d1cd6f40472509e9aac646183736a'
rev='4-33333333333333333333333333333333'
).get_result()

print(response)
Expand Down
2 changes: 1 addition & 1 deletion examples/snippets/deleteDatabase/example_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

service = CloudantV1.new_instance()

response = service.delete_database(db='<db-name>').get_result()
response = service.delete_database(db='products').get_result()

print(response)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
response = service.delete_design_document(
db='products',
ddoc='appliances',
rev='1-98e6a25b3b45df62e7d47095ac15b16a'
rev='1-00000000000000000000000000000000'
).get_result()

print(response)
2 changes: 1 addition & 1 deletion examples/snippets/deleteDocument/example_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
response = service.delete_document(
db='orders',
doc_id='order00058',
rev='1-99b02e08da151943c2dcb40090160bb8'
rev='1-00000000000000000000000000000000'
).get_result()

print(response)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

response = service.delete_replication_document(
doc_id='repldoc-example',
rev='3-a0ccbdc6fe95b4184f9031d086034d85'
rev='1-00000000000000000000000000000000'
).get_result()

print(response)
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

event_doc_1 = Document(
_id="ns1HJS13AMkK:0007241142412418284",
_rev="1-5005d65514fe9e90f8eccf174af5dd64",
_rev="1-00000000000000000000000000000000",
_deleted=True,
)
event_doc_2 = Document(
_id="H8tDIwfadxp9:0007241142412418285",
_rev="1-2d7810b054babeda4812b3924428d6d6",
_rev="1-00000000000000000000000000000000",
_deleted=True,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

bulk_get_doc = BulkGetQueryDocument(
id='order00058',
atts_since=['1-99b02e08da151943c2dcb40090160bb8'])
atts_since=['1-00000000000000000000000000000000'])
response = service.post_bulk_get(
db='orders',
docs=[bulk_get_doc]
Expand Down
4 changes: 2 additions & 2 deletions examples/snippets/postBulkGet/example_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
doc_id = 'order00067'
bulk_get_doc_1 = BulkGetQueryDocument(
id=doc_id,
rev='3-917fa2381192822767f010b95b45325b')
rev='3-22222222222222222222222222222222')
bulk_get_doc_2 = BulkGetQueryDocument(
id=doc_id,
rev='4-a5be949eeb7296747cc271766e9a498b')
rev='4-33333333333333333333333333333333')

response = service.post_bulk_get(
db='orders',
Expand Down
6 changes: 3 additions & 3 deletions examples/snippets/postRevsDiff/example_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

revs_diff = DocumentRevisions(
order00077=[
"<1-missing-revision>",
"<2-missing-revision>",
"<3-possible-ancestor-revision>"
"1-00000000000000000000000000000000", # missing revision
"2-11111111111111111111111111111111", # missing revision
"3-22222222222222222222222222222222" # possible ancestor revision
]
)

Expand Down
6 changes: 3 additions & 3 deletions examples/snippets/putReplicationDocument/example_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
service = CloudantV1.new_instance()

source_db = ReplicationDatabase(
url='<your-source-service-url>/animaldb'
url='https://~replace-with-source-host~.cloudantnosqldb.appdomain.cloud/animaldb'
)

target_auth_iam = ReplicationDatabaseAuthIam(
api_key='<your-iam-api-key>'
api_key='a1b2c3d4e5f6f1g4h7j3k6l9m2p5q8s1t4v7x0z3' #use your own IAM API key
)
target_auth = ReplicationDatabaseAuth(
iam=target_auth_iam
)
target_db = ReplicationDatabase(
auth=target_auth,
url='<your-target-service-url>/animaldb-target'
url='https://~replace-with-target-host~.cloudantnosqldb.appdomain.cloud/animaldb-target'
)

replication_document = ReplicationDocument(
Expand Down