|
| 1 | +.. _mcli-atlas-cluster-onlinearchive-update-command: |
| 2 | + |
| 3 | +=========================================== |
| 4 | +mongocli atlas cluster onlinearchive update |
| 5 | +=========================================== |
| 6 | + |
| 7 | +.. default-domain:: mongodb |
| 8 | + |
| 9 | +.. contents:: On this page |
| 10 | + :local: |
| 11 | + :backlinks: none |
| 12 | + :depth: 1 |
| 13 | + :class: singlecol |
| 14 | + |
| 15 | +.. include:: /includes/fact-online-archive-beta.rst |
| 16 | + |
| 17 | +The ``onlinearchive update`` command modifies the archiving rule in the |
| 18 | +specified :atlas:`online archive </online-archive/manage-online-archive/>` for |
| 19 | +the specified cluster. You can also modify the archiving rule through the |
| 20 | +|service| :atlas:`UI </online-archive/edit-online-archive/>` or :atlas:`API |
| 21 | +</reference/api/online-archive-update-one/>`. |
| 22 | + |
| 23 | +.. _mcli-atlas-cluster-onlinearchive-update-syntax: |
| 24 | + |
| 25 | +Syntax |
| 26 | +------ |
| 27 | + |
| 28 | +.. code-block:: text |
| 29 | + |
| 30 | + mongocli atlas cluster onlinearchive update <online-archive-id> |
| 31 | + --archiveAfter <number-of-days> |
| 32 | + --clusterName <cluster-name> |
| 33 | + [ --profile|-P <profile-name> ] |
| 34 | + [ --projectId <project-ID> ] |
| 35 | + |
| 36 | +.. _mcli-atlas-cluster-onlinearchive-update-options: |
| 37 | + |
| 38 | +Options |
| 39 | +------- |
| 40 | + |
| 41 | +.. list-table:: |
| 42 | + :header-rows: 1 |
| 43 | + :widths: 20 10 60 10 |
| 44 | + |
| 45 | + * - Option |
| 46 | + - Type |
| 47 | + - Description |
| 48 | + - Required? |
| 49 | + |
| 50 | + * - ``<online-archive-id>`` |
| 51 | + - string |
| 52 | + - Unique identifier of the online archive to update. |
| 53 | + - yes |
| 54 | + |
| 55 | + * - ``--archiveAfter`` |
| 56 | + - int |
| 57 | + - Number of days after which to archive cluster data. |
| 58 | + - yes |
| 59 | + |
| 60 | + * - ``--clusterName`` |
| 61 | + - string |
| 62 | + - Name of the cluster. |
| 63 | + - yes |
| 64 | + |
| 65 | + * - ``--profile``, ``-P`` |
| 66 | + - string |
| 67 | + - Name of the profile where the public and private |
| 68 | + keys for the project are saved. If omitted, uses the |
| 69 | + {+default-profile+}. To learn more about creating a |
| 70 | + profile, see :ref:`mcli-configure`. |
| 71 | + - no |
| 72 | + |
| 73 | + * - ``--projectId`` |
| 74 | + - string |
| 75 | + - Unique identifier of the project that contains the |
| 76 | + cluster. If omitted, uses the project ID in the profile or |
| 77 | + :ref:`environment variable <mcli-env-var>`. |
| 78 | + - no |
| 79 | + |
| 80 | +.. _mcli-atlas-cluster-onlinearchive-update-output: |
| 81 | + |
| 82 | +Output |
| 83 | +------ |
| 84 | + |
| 85 | +.. include:: /includes/command-output-intro.rst |
| 86 | + |
| 87 | +.. include:: /includes/atlas-online-archive-output.rst |
| 88 | + |
| 89 | +.. _mcli-atlas-cluster-onlinearchive-update-egs: |
| 90 | + |
| 91 | +Examples |
| 92 | +-------- |
| 93 | + |
| 94 | +The following example uses the ``mongocli atlas cluster onlinearchive update`` |
| 95 | +command to modify the archiving rule in the specified online archive for the |
| 96 | +cluster named ``myTestCluster``. It uses the {+default-profile+} to access the |
| 97 | +project. |
| 98 | + |
| 99 | +.. code-block:: text |
| 100 | + |
| 101 | + mongocli atlas cluster onlinearchive update 5f189832e26ec075e10c32d3 --clusterName myTestCluster --archiveAfter 5 |
| 102 | + |
| 103 | +The previous command prints the following fields in |json| format to the |
| 104 | +terminal. To learn more about these fields, see |
| 105 | +:ref:`mcli-atlas-cluster-onlinearchive-update-output`. |
| 106 | + |
| 107 | +.. code-block:: json |
| 108 | + :copyable: false |
| 109 | + |
| 110 | + { |
| 111 | + "_id": "5f189832e26ec075e10c32d3", |
| 112 | + "clusterName": "myTestCluster", |
| 113 | + "collName": "movies", |
| 114 | + "criteria": { |
| 115 | + "dateField": "released", |
| 116 | + "expireAfterDays": 5 |
| 117 | + }, |
| 118 | + "dbName": "sample_mflix", |
| 119 | + "groupId": "5e2211c17a3e5a48f5497de3", |
| 120 | + "partitionFields": [ |
| 121 | + { |
| 122 | + "fieldName": "title", |
| 123 | + "fieldType": "string", |
| 124 | + "order": 0 |
| 125 | + }, |
| 126 | + { |
| 127 | + "fieldName": "year", |
| 128 | + "fieldType": "int", |
| 129 | + "order": 1 |
| 130 | + }, |
| 131 | + { |
| 132 | + "fieldName": "released", |
| 133 | + "fieldType": "date", |
| 134 | + "order": 2 |
| 135 | + } |
| 136 | + ], |
| 137 | + "paused": true, |
| 138 | + "state": "PAUSED" |
| 139 | + } |
0 commit comments