Skip to main content

Module providing IBM Fail over functions

Project description

# IBM Cloud Fail Over Functions


## Overview

IBM Cloud Fail Over is a Python module designed to automate failover processes for applications hosted on IBM Cloud. This module provides essential functions to manage failover scenarios effectively, ensuring high availability and reliability.

## Features

- **Automated Failover**: Seamlessly switch to backup resources when primary resources are unavailable.
- **Resource Management**: Manage critical resources like Virtual IPs and Floating IPs with ease.

## Installation

You can install the IBM Cloud Fail Over module using pip. Run the following command:

```bash
pip install ibm_cloud_fail_over

Usage

Main Functions

fail_over_cr_vip

This function manages the failover of a Cloud Resource Virtual IP (CR VIP).

Usage:

from ibm_cloud_fail_over import fail_over_cr_vip

# Example usage
active_ip = fail_over_cr_vip(vpc_url='IBM Cloud VPC regional URL",
                           primary_vip='your_primary_vip',
                           secondary_vip='your_secondary_vip',
                           api_key="Optional: API key" )
print(active_ip)

Parameters:

Parameter Type Description
vpc_url str IBM Cloud VPC regional URL.
primary_vip str The primary Virtual IP to monitor.
secondary_vip str The secondary Virtual IP to switch to.
api_key str Optional needed only if you are not using trusted profile, IBM cloud api acsess key

Returns:

  • The Active ip post failover operation.

fail_over_floating_ip_start

This function manages the failover of a Floating IP Attach to the caller Endpoint (VSI/BM)

Usage:

from ibm_cloud_fail_over import fail_over_floating_ip_start

# Example usage
result = fail_over_floating_ip_start(vpc_url='IBM Cloud VPC regional URL",
                                master_vni_id="Virtual network inetface uuid for new active",
                                passive_vni_id="Virtual network inetface uuid for new passive" ,
                                fip_id="the floating ip uuid",
                                api_key="Optional: API key" ))
print(result)

Parameters:

Parameter Type Description
vpc_url str(url) IBM Cloud VPC regional URL.
master_vni_id str(uuid) Virtual network inetface uuid for new active.
passive_vni_id str(uuid) Virtual network inetface uuid for new active.
fip_id str(uuid) Floating IP uuid to move.
api_key str Optional needed only if you are not using trusted profile, IBM cloud api acsess key
Returns:
  • A confirmation message indicating the success or failure of the failover operation.

fail_over_floating_ip_stop

This function manages the failover of a Floating IP Detach to the caller Endpoint (VSI/BM)

Usage:

from ibm_cloud_fail_over import fail_over_floating_ip_stop

# Example usage
result = fail_over_floating_ip_stop(vpc_url='IBM Cloud VPC regional URL",
                                master_vni_id="Virtual network inetface uuid for new active",
                                passive_vni_id="Virtual network inetface uuid for new passive" ,
                                fip_id="the floating ip uuid",
                                api_key="Optional: API key" ))
print(result)

Parameters:

Parameter Type Description
vpc_url str(url) IBM Cloud VPC regional URL.
master_vni_id str(uuid) Virtual network inetface uuid for new active.
passive_vni_id str(uuid) Virtual network inetface uuid for new active.
fip_id str(uuid) Floating IP uuid to move.
api_key str Optional needed only if you are not using trusted profile, IBM cloud api acsess key
Returns:
  • A confirmation message indicating the success or failure of the failover operation.

fail_over_get_attached_fip

This function manages the failover of a Floating IP Detach to the caller Endpoint (VSI/BM)

Usage:

from ibm_cloud_fail_over import fail_over_get_attached_fip

# Example usage
attached_fip_id, attached_fip_ip = fail_over_get_attached_fip()

print(attached_fip_ip)
print(attached_fip_id)

Parameters: None

Returns: attached_fip_id, attached_fip_ip

Troubleshooting

If you encounter issues while using the module, consider the following:

  • Invalid IP Addresses: Ensure that the IP addresses provided for primary and secondary resources are valid and reachable.
  • Network Issues: Check your network connectivity to the IBM Cloud resources.
  • Permissions: Ensure that your IBM Cloud account has the necessary permissions to manage the specified resources.
  • Required dependencies: Enable Instance Metada Service on Both Enpoints
  • Optional dependencies: Enable Trusted profile to avoid using and api access key

For further assistance, please check the GitHub Issues page or contact the project maintainer.

Contributing

We welcome contributions! To contribute to the project, please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/YourFeature).
  3. Make your changes and commit them (git commit -m 'Add some feature').
  4. Push to the branch (git push origin feature/YourFeature).
  5. Create a new Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

For questions or support, please open an issue on GitHub or contact the project maintainer at dev@gampel.net.


### TOOD:
 

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ibm_cloud_fail_over-1.0.11.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ibm_cloud_fail_over-1.0.11-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file ibm_cloud_fail_over-1.0.11.tar.gz.

File metadata

  • Download URL: ibm_cloud_fail_over-1.0.11.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for ibm_cloud_fail_over-1.0.11.tar.gz
Algorithm Hash digest
SHA256 25a5edbfab7e6d793cf70449a726fa2e14737abfe04f9548fea15052c68bd6ec
MD5 f6067d48a5c01c98584a59f29be37be1
BLAKE2b-256 f68a79c853b7455822bd606a48ea2f0e4c52138802e2c4e814c7fc7cab61a4e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for ibm_cloud_fail_over-1.0.11.tar.gz:

Publisher: publish.yml on gampel/ibm_cloud_fail_over

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ibm_cloud_fail_over-1.0.11-py3-none-any.whl.

File metadata

File hashes

Hashes for ibm_cloud_fail_over-1.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 e3f8f99c1515a643a775521e5ecde5ab4c8667fc8cad7e9e6af9a574f3734d82
MD5 0ce0a16c4ff697d2f731558d59fa4f79
BLAKE2b-256 9ae05ee66e30f9a6162662b37fbe0c78b114d42c913597d338158b37f8b48897

See more details on using hashes here.

Provenance

The following attestation bundles were made for ibm_cloud_fail_over-1.0.11-py3-none-any.whl:

Publisher: publish.yml on gampel/ibm_cloud_fail_over

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page