Início Rápido do SDK para Python Cloud Shell
Esta seção descreve como começar rapidamente a usar o Oracle Cloud Infrastructure SDK para Python usando o Cloud Shell.
Esta seção descreve como começar rapidamente a usar o Oracle Cloud Infrastructure SDK para Python usando o Cloud Shell.
- Faça log-in na Console.
- Clique no ícone do Cloud Shell no cabeçalho da Console. Observe que o Cloud Shell executará comandos na região selecionada no menu de seleção Região da Console quando o Cloud Shell for iniciado.
- Executar Python:
user@cloudshell:oci (us-phoenix-1)$ python3 Python 3.6.8 (default, Oct 1 2020, 20:32:44) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44.0.3)] on linux Type "help", "copyright", "credits" or "license" for more information. >>>
-
Execute a seguinte amostra de código para ver o namespace atual do Object Storage:
import oci object_storage_client = oci.object_storage.ObjectStorageClient(oci.config.from_file()) result = object_storage_client.get_namespace() print("Current object storage namespace: {}".format(result.data))
Isso retornará uma saída semelhante à seguinte:Current object storage namespace: mynamespace