Multipart Upload on OCI Bucket / Object Storage using OCI-CLI in Windows or Linux Rumi, May 10, 2023May 10, 2023 Oracle OCI-CLI requires Python packages v 3.6 or higher. During installation it is auto installed on windows server/OS, however on Linux, there might be preinstalled Python package installed, that might need to be updated manually before running the installer. (In few cases, the installation failed and the package needed to be be updated seperately) Installation on Linux bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)" For CentOS-7 few additional steops might needed- sudo yum groupinstall 'Development Tools' sudo yum install centos-release-scl sudo yum install rh-python36 scl enable rh-python36 bash yum -y install python-pip afterwards, run the installer command mentioned above. Installation on Windows powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.ps1'))" The instllation is pretty straight forward. Once installed, check the software versioning- python --version oci --version Configuring OCI-CLI setup: Run the following command: oci setup config It will prompt for several inputs to deliver- User OCID. You can find the user OCID from your oracle cloud console- profile > user information > OCID (sample- ocid1.user.oc1..aaaaaaaagw4ezrtj7wxmosqf3phqhdnv4i4jvhq4r6klz4j4u6w6587hielxa) Tenancy OCID. You can find it from- Hamburger menu > Governence & Administration > Tenancies > Click and expand tenancy name > Tenancy OCID (sample- ocid1.tenancy.oc1..aaaaaaaak2d5y4fmatd37zmetmvczzenxrhx4m6fn5yruiweyihfi6d7ittppb2a) Your Region to select: In my case it was, ap-mumbai-1 Generate Key pair while the prompt asks, and use N/A while password promts appears. In my case my key pairs were generated in my windows path like- C:\Users\Rumi\.oci\oci_api_key_public.pem Open the oci_api_key_public.pem using notepad and copy the texts Now move to OCI cloud console and go Profile > OCIDProfile or alternatively from Hamburger menu > > Identity > Users > User Details > API Keys > Add API Keys Select Paste Puiblic Key, and paste the values copied in step 6 Configure your Object Storage Hamburger > Storage > Bucket > Click 3 dots at right side of your bucket > Select Pre Authenticated Request (PAR) > Select Bucket > Permit Object Reads Run command in your powershell- oci os ns get A following sample reposne (namedspace) will generate { "data": "bmaHK;ftwtcdx" } Read and Write on bucjet using oci-cli: Read Bucket Files with Name-size-date modified oci os object list -bn <your-bucket-name> --query 'data[*].["name", "size", \"time-modified\"]' --output table Read Bucket in json format: oci os object list -bn <your-bucket-name> Upload File to Bucket oci os object put -bn <your-bucket-name> --file D:\<your-file> -ns "bmaHK;ftwtcdx" Ref: https://docs.oracle.com/en-us/iaas/Content/Object/Tasks/usingmultipartuploads.htm https://github.com/oracle/oci-cli Related OCI
Administrations Migrating Windows 2022 from proxmox to Oracle Cloud Infrastructure (OCI) March 12, 2024 I was doing a requirement work where a customized windows 2022 needs to be ported to OCI. In order to achieve this, following steps were considered- Creating a KVM virtual guest on my Proxmox 7 Infra and install windows 2022 with virtio drivers. Stopping the VM and copying the qcow2… Read More
Deploy a Laravel app on Oracle Cloud with database November 17, 2023 Assumptions: Ubuntu 22 PHP 7.3 Laravel 5.5 Apache 2 PHP-Redis Download the public and private keys on your local machine. You have created your VM instance! Create an always free Autonomous Database [if your application uses a database] Select your desired database After creating your database, go to “DB Connection”… Read More
Enabling Ping requests to OCI Instance June 29, 2022 If you want to test with Ping requests you’ll need to modify the Ingress rules on the security list associated with the VCN, Subnet, network device, thing, what ever, to allow ICMP packets. Allowing ICMP traffic is not required, it’s an option. Please only take this option if you understand… Read More