function-storage コマンド ####################### Cleanroomに保存される関数ディレクトリを管理するためのコマンド群です。 関数ディレクトリの仕様については :doc:`../../user-files/index` を参照してください。 .. _command-function-storage-upload: function-storage upload *********************** 関数ディレクトリをCleanroomにアップロードします。 使用方法 ======================= .. code-block:: console apc function-storage upload \ --source <ソースディレクトリ> \ --profile <プロファイル名> .. admonition:: 例 .. code-block:: console apc function-storage upload \ --source ./my-function \ --profile acompany アップロードした関数のIDである **function-id** が ``FunctionStoragePath`` として出力されます。 このfunction-idは :ref:`cleanroom deploy ` コマンドの ``--source`` オプションなどで使用します。 引数 ------ なし オプション ------ .. option:: --profile <プロファイル名> 認証情報のプロファイル名を指定します。 .. option:: --source <ソースディレクトリ> 関数ディレクトリのパスを指定します。 .. dropdown:: 正常終了時の出力例 .. code-block:: console $ apc function-storage upload --source ./my-function --profile acompany Uploading function with the following parameters: Source: ./my-function Function uploaded successfully. FunctionStoragePath: fs://0qSLHMR-O5zFEi0upILG9wKZLZlaztAnwlEFAGN9FKw # 既存の関数の場合 $ apc function-storage upload --source ./my-function --profile acompany Uploading function with the following parameters: Source: ./my-function Function already exists. FunctionStoragePath: fs://0qSLHMR-O5zFEi0upILG9wKZLZlaztAnwlEFAGN9FKw .. dropdown:: 異常終了時の出力例 .. code-block:: console # 存在しないディレクトリを指定した場合 $ apc function-storage upload --source ./nonexistent-function --profile acompany Uploading function with the following parameters: Source: ./nonexistent-function Error during function preparation: [Errno 2] No such file or directory: './nonexistent-function' # 認証エラーの場合 $ apc function-storage upload --source ./my-function --profile invalid_profile Exception: Authentication failed. Please check your credentials. # サーバー接続エラーの場合 $ apc function-storage upload --source ./my-function --profile acompany Exception: Connection failed. Please check your server configuration. function-storage delete *********************** Cleanroomから関数ディレクトリを削除します。 使用方法 ======== .. code-block:: console apc function-storage delete \ --profile <プロファイル名> .. admonition:: 例 .. code-block:: console apc function-storage delete 0qSLHMR-O5zFEi0upILG9wKZLZlaztAnwlEFAGN9FKw \ --profile acompany 引数 ------ .. option:: 削除する関数のIDを指定します。 オプション ------ .. option:: --profile <プロファイル名> 認証情報のプロファイル名を指定します。 .. dropdown:: 正常終了時の出力例 .. code-block:: console $ apc function-storage delete 0qSLHMR-O5zFEi0upILG9wKZLZlaztAnwlEFAGN9FKw --profile acompany Deleting FunctionStorage: FunctionStoragePath: 0qSLHMR-O5zFEi0upILG9wKZLZlaztAnwlEFAGN9FKw Function deleted successfully. .. dropdown:: 異常終了時の出力例 .. code-block:: console # 存在しないfunction-idを指定した場合 $ apc function-storage delete nonexistent_function_id --profile acompany Deleting FunctionStorage: FunctionStoragePath: nonexistent_function_id Error during function deletion: Function not found # 認証エラーの場合 $ apc function-storage delete 0qSLHMR-O5zFEi0upILG9wKZLZlaztAnwlEFAGN9FKw --profile invalid_profile Exception: Authentication failed. Please check your credentials. # サーバー接続エラーの場合 $ apc function-storage delete 0qSLHMR-O5zFEi0upILG9wKZLZlaztAnwlEFAGN9FKw --profile acompany Exception: Connection failed. Please check your server configuration. function-storage list *********************** Cleanroom内の関数ディレクトリ一覧を表示します。 使用方法 ======== .. code-block:: console apc function-storage list \ --profile <プロファイル名> .. admonition:: 例 .. code-block:: console apc function-storage list --profile acompany 引数 ------ なし オプション ------ .. option:: --profile <プロファイル名> 認証情報のプロファイル名を指定します。 .. dropdown:: 正常終了時の出力例 .. code-block:: console $ apc function-storage list --profile acompany [ { "function_storage_path": "fs://0qSLHMR-O5zFEi0upILG9wKZLZlaztAnwlEFAGN9FKw" }, { "function_storage_path": "fs://1rTMINS-P6aGFj1vqJMH0xLaMabcuBowmfFBAHO0GLx" }, { "function_storage_path": "fs://2sSNJOT-Q7bHGk2wrKNI1yMbNbcdvCpxngGCBIP1HMy" } ] .. dropdown:: 異常終了時の出力例 .. code-block:: console # 認証エラーの場合 $ apc function-storage list --profile invalid_profile Exception: Authentication failed. Please check your credentials. # サーバー接続エラーの場合 $ apc function-storage list --profile acompany Exception: Connection failed. Please check your server configuration. # 権限不足の場合 $ apc function-storage list --profile acompany Exception: Access denied. Insufficient permissions to list functions.