Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Adding Examples for Python SDK to create FCR and FCR based Connections #7

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
19c93c1
Adding Examples for Python SDK to create FCR and FCR based Connections
jkallem-equinix Aug 6, 2024
aac1ad2
docs: provide steps for updating and releasing this SDK (#8)
ctreatma Aug 8, 2024
108f67a
docs: provide steps for updating and releasing this SDK (#8)
ctreatma Aug 8, 2024
980731a
modifying version in Fabricv4 Makefile for sync job
jkallem-equinix Aug 13, 2024
f3d4391
Updating Patch names according to the scripts
jkallem-equinix Aug 14, 2024
a85d5f4
Updated SDK patch Paths for Make File
jkallem-equinix Aug 15, 2024
bce14a5
Updated patch Paths for Make.fabricv4 File
jkallem-equinix Aug 15, 2024
9739900
Updated patch Paths for Make.fabricv4 File
jkallem-equinix Aug 15, 2024
ccd9c07
Updated patch Paths for Make.fabricv4 File
jkallem-equinix Aug 15, 2024
aabd04c
Updated patch Paths for sync-fabricv4 yaml and sync yaml File
jkallem-equinix Aug 16, 2024
83146b1
chore(deps): update dependency urllib3 to >=2.2.2, <3.0.0
renovate[bot] Aug 16, 2024
3753b4d
sync: fetch 2024-08-16 spec and apply patches
github-actions[bot] Aug 16, 2024
a5a07a1
sync: patch spec with 2024-08-16 spec
github-actions[bot] Aug 16, 2024
62cd77f
sync: generate client with 2024-08-16 spec
github-actions[bot] Aug 16, 2024
3dc0e87
sync: uncommitted changes detected when opening PR
github-actions[bot] Aug 16, 2024
3aa543d
ci: regenerate code for version 0.3.0 triggered by @ctreatma
Aug 20, 2024
785c6ed
chore: remove .openapi-generator directory (#20)
ctreatma Aug 20, 2024
9789a31
Resolving the Comments for Example
jkallem-equinix Aug 21, 2024
476aabd
Adding Examples for Python SDK to create FCR and FCR based Connections
jkallem-equinix Aug 6, 2024
164d8db
modifying version in Fabricv4 Makefile for sync job
jkallem-equinix Aug 13, 2024
3ed8ff6
Updating Patch names according to the scripts
jkallem-equinix Aug 14, 2024
f047b8e
Updated SDK patch Paths for Make File
jkallem-equinix Aug 15, 2024
0708794
Updated patch Paths for Make.fabricv4 File
jkallem-equinix Aug 15, 2024
26cad01
Updated patch Paths for Make.fabricv4 File
jkallem-equinix Aug 15, 2024
5f0af84
Updated patch Paths for Make.fabricv4 File
jkallem-equinix Aug 15, 2024
bca5d2d
Updated patch Paths for sync-fabricv4 yaml and sync yaml File
jkallem-equinix Aug 16, 2024
0933662
chore(deps): update dependency urllib3 to >=2.2.2, <3.0.0
renovate[bot] Aug 16, 2024
c73c3fb
sync: fetch 2024-08-16 spec and apply patches
github-actions[bot] Aug 16, 2024
bca1560
sync: patch spec with 2024-08-16 spec
github-actions[bot] Aug 16, 2024
8bff317
sync: generate client with 2024-08-16 spec
github-actions[bot] Aug 16, 2024
88a8c5a
sync: uncommitted changes detected when opening PR
github-actions[bot] Aug 16, 2024
7774182
ci: regenerate code for version 0.3.0 triggered by @ctreatma
Aug 20, 2024
e8c60a3
chore: remove .openapi-generator directory (#20)
ctreatma Aug 20, 2024
153a133
Resolving the Comments for Example
jkallem-equinix Aug 21, 2024
7360ce9
Merge remote-tracking branch 'origin/CXF-96059' into CXF-96059
jkallem-equinix Aug 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/sync-fabricv4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
if: ${{ always() && steps.patch.conclusion == 'success' }}
run: |
make -f Makefile.fabricv4 generate
git add services/fabricv4
git add equinix/services/fabricv4
echo `git commit -m 'sync: generate client with ${{ steps.date.outputs.date }} spec'`
- name: Create Pull Request
id: cpr
Expand Down
1,293 changes: 0 additions & 1,293 deletions .openapi-generator/FILES

This file was deleted.

1 change: 0 additions & 1 deletion .openapi-generator/VERSION

This file was deleted.

7 changes: 3 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
## Hello Contributors!
Thx for your interest! We're so glad you're here.

### Important Resources
- bugs: [https://github.com/equinix/equinix-sdk-python/issues](https://github.com/equinix/metal/issues)

### Code of Conduct
Available via [https://github.com/equinix/equinix-sdk-python/blob/master/.github/CODE_OF_CONDUCT.md](https://github.com/equinix/metal/blob/master/.github/CODE_OF_CONDUCT.md)

### Environment Details
[https://github.com/equinix/equinix-sdk-python/blob/master/Makefile](https://github.com/equinix/equinix-sdk-python/blob/master/Makefile)

### How to Submit Change Requests

Please submit change requests and / or features via [Issues](https://github.com/equinix/equinix-sdk-python/issues). There's no guarantee it'll be changed, but you never know until you try. We'll try to add comments as soon as possible, though.

#### Pull Requests
All command changes must be reflected in the documentation, this includes new commands and changes to options. The documentation is generated via `make generate-docs`.

The code in this repo is largely generated from OpenAPI specifications for Equinix APIs. In general, we anticipate that updates to these specifications will come from automation or from Equinix employees. Pull Requests that modify tooling such as `make` tasks, generator versions, or generator configuration, must also include any updates to the generated code.

### How to Report a Bug
Bugs are problems in code, in the functionality of an application or in its UI design; you can submit them through [Issues](https://github.com/equinix/equinix-sdk-python/issues) as well.
23 changes: 22 additions & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Development

## Contents
## Repository Contents

- `Makefile` includes tasks to generate and validate the full SDK and to onboard a new service to the SDK
- `Makefile.<service>` includes tasks for generating and validating a single service from its OpenAPI spec
Expand Down Expand Up @@ -83,3 +83,24 @@ While we aim to publish OpenAPI specs that can be used as-is for code generation
3. ``patchfilename`` should be in format: ``<patch_index>-<short_patch_decription_or_identifier>.patch``
4. Run ``make -f Makefile.<service> patch`` to reapply the changes to the fetched OpenAPI spec and confirm that the patched spec includes the expected changes
5. Run `make -f Makefile.<service> generate` to regenerate the code using the patched spec and confirm that the code generates successfully and works as expected

## Update the OpenAPI spec for a service

The steps below may vary by service, depending on decisions made by the CODEOWNERS for that service, but by default the process for pulling in the latest OpenAPI specification for a service and regenerating the code is:

1. Publish the updated OpenAPI specification (that happens outside of this repository)
2. If necessary, update the `SPEC_BASE_URL` and `SPEC_ROOT_FILE` to match the URL where the updated OpenAPI specification is published
3. Python to the [Actions page](https://github.com/equinix/equinix-sdk-python/actions) and find the sync workflow for your service, and click the workflow name. The name will be in the format `Sync <service> API spec`.
4. Click the gray `Run workflow` button, check that `main` is selected in the popup, and then click the green `Run workflow` button in the popup to run the sync workflow
5. The sync workflow will open a Pull Request (PR) that includes the OpenAPI specification updates as well as any code changes caused by the update.

After merging your service changes you can release a new version of this SDK that includes your updates.

## Release the SDK

This SDK uses a Semantic Release action to automatically determine the next release version based on Conventional Commit tags in commit messages. There is a push-button workflow for releasing the SDK after changes are made:

1. Navigate to the [Release workflow](https://github.com/equinix/equinix-sdk-python/actions/workflows/release.yaml).
2. Click the gray `Run workflow` button, check that `main` is selected in the popup, and then click the green `Run workflow` button in the popup to run the sync workflow

The release workflow will determine the next version, regenerate the code with the updated version number, and create a [GitHub Release](https://github.com/equinix/equinix-sdk-python/releases).
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,12 @@ generate-all:
make -f $$makefile generate;\
done

# This task removes unused files that are generated
# in the shared parts of the SDK. If you need to remove
# unused files within a service directory, you must
# redefine this task in the service-specific Makefile(s)
remove-unused:
rm -rf .openapi-generator

stage:
test -d .git && git add --intent-to-add .
6 changes: 3 additions & 3 deletions Makefile.fabricv4
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
include Makefile

PACKAGE_NAME=fabricv4
SPEC_BASE_URL:=https://api.swaggerhub.com/apis/equinix-api/fabric/4.14
SPEC_BASE_URL:=https://api.swaggerhub.com/apis/equinix-api/fabric/4.15
SPEC_ROOT_FILE:=swagger.yaml

QUALIFIED_PACKAGE_NAME=equinix.services.${PACKAGE_NAME}
Expand All @@ -16,7 +16,7 @@ SPEC_FETCHER=curl

all: pull fetch patch generate stage

generate: clean codegen patch-post fmt test
generate: clean codegen remove-unused patch-post fmt test

pull:
${CRI} pull ${OPENAPI_IMAGE}
Expand All @@ -34,7 +34,7 @@ patch:

patch-post:
# patch is idempotent, always starting with the generated files
for diff in $(shell find patches/post -name \*.patch | sort -n); do \
for diff in $(shell find patches/services/${PACKAGE_NAME} -name \*.patch | sort -n); do \
patch --no-backup-if-mismatch -N -t -p1 -i $$diff; \
done

Expand Down
28 changes: 26 additions & 2 deletions equinix/services/fabricv4/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@

Equinix Fabric is an advanced software-defined interconnection solution that enables you to directly, securely and dynamically connect to distributed infrastructure and digital ecosystems on platform Equinix via a single port, Customers can use Fabric to connect to: </br> 1. Cloud Service Providers - Clouds, network and other service providers. </br> 2. Enterprises - Other Equinix customers, vendors and partners. </br> 3. Myself - Another customer instance deployed at Equinix. </br> </br> <b>Integrations (SDKs, Tools) links:</b> </br> <a href=\"https://deploy.equinix.com/labs/fabric-java\\\">Fabric Java SDK</a> </br> <a href=\"https://deploy.equinix.com/labs/equinix-sdk-go\\\">Fabric Go SDK</a> </br> <a href=\"https://deploy.equinix.com/labs/terraform-provider-equinix\\\">Equinix Terraform Provider</a> </br> <a href=\"https://deploy.equinix.com/labs/terraform-equinix-fabric\\\">Fabric Terraform Modules</a> </br> <a href=\"https://deploy.equinix.com/labs/pulumi-provider-equinix/\">Equinix Pulumi Provider</a> </br>

The version of the OpenAPI document: 4.14
The version of the OpenAPI document: 4.15
Contact: [email protected]
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501


__version__ = "0.2.1"
__version__ = "0.3.0"

# import apis into sdk package
from equinix.services.fabricv4.api.cloud_routers_api import CloudRoutersApi
from equinix.services.fabricv4.api.connections_api import ConnectionsApi
from equinix.services.fabricv4.api.health_api import HealthApi
from equinix.services.fabricv4.api.marketplace_subscriptions_api import MarketplaceSubscriptionsApi
from equinix.services.fabricv4.api.metros_api import MetrosApi
from equinix.services.fabricv4.api.networks_api import NetworksApi
from equinix.services.fabricv4.api.ports_api import PortsApi
Expand Down Expand Up @@ -181,6 +182,8 @@
from equinix.services.fabricv4.models.link_protocol_untagged import LinkProtocolUntagged
from equinix.services.fabricv4.models.link_protocol_vxlan import LinkProtocolVxlan
from equinix.services.fabricv4.models.marketing_info import MarketingInfo
from equinix.services.fabricv4.models.marketplace_subscription import MarketplaceSubscription
from equinix.services.fabricv4.models.marketplace_subscription_type import MarketplaceSubscriptionType
from equinix.services.fabricv4.models.md5 import Md5
from equinix.services.fabricv4.models.md5_type import Md5Type
from equinix.services.fabricv4.models.metal_interconnection import MetalInterconnection
Expand Down Expand Up @@ -278,6 +281,7 @@
from equinix.services.fabricv4.models.precision_time_service_packages_response import PrecisionTimeServicePackagesResponse
from equinix.services.fabricv4.models.precision_time_service_request import PrecisionTimeServiceRequest
from equinix.services.fabricv4.models.precision_time_service_request_type import PrecisionTimeServiceRequestType
from equinix.services.fabricv4.models.precision_time_service_response import PrecisionTimeServiceResponse
from equinix.services.fabricv4.models.presence import Presence
from equinix.services.fabricv4.models.price import Price
from equinix.services.fabricv4.models.price_category import PriceCategory
Expand Down Expand Up @@ -392,10 +396,12 @@
from equinix.services.fabricv4.models.service_profile_type_enum import ServiceProfileTypeEnum
from equinix.services.fabricv4.models.service_profile_visibility_enum import ServiceProfileVisibilityEnum
from equinix.services.fabricv4.models.service_profiles import ServiceProfiles
from equinix.services.fabricv4.models.service_search_response import ServiceSearchResponse
from equinix.services.fabricv4.models.service_token import ServiceToken
from equinix.services.fabricv4.models.service_token_action_request import ServiceTokenActionRequest
from equinix.services.fabricv4.models.service_token_actions import ServiceTokenActions
from equinix.services.fabricv4.models.service_token_change_operation import ServiceTokenChangeOperation
from equinix.services.fabricv4.models.service_token_change_operation_op import ServiceTokenChangeOperationOp
from equinix.services.fabricv4.models.service_token_connection import ServiceTokenConnection
from equinix.services.fabricv4.models.service_token_connection_type import ServiceTokenConnectionType
from equinix.services.fabricv4.models.service_token_search_expression import ServiceTokenSearchExpression
Expand Down Expand Up @@ -429,6 +435,24 @@
from equinix.services.fabricv4.models.statistics import Statistics
from equinix.services.fabricv4.models.statistics_view_point import StatisticsViewPoint
from equinix.services.fabricv4.models.sub_interface import SubInterface
from equinix.services.fabricv4.models.subscription_asset import SubscriptionAsset
from equinix.services.fabricv4.models.subscription_asset_type import SubscriptionAssetType
from equinix.services.fabricv4.models.subscription_entitlement_response import SubscriptionEntitlementResponse
from equinix.services.fabricv4.models.subscription_response import SubscriptionResponse
from equinix.services.fabricv4.models.subscription_response_marketplace import SubscriptionResponseMarketplace
from equinix.services.fabricv4.models.subscription_response_offer_type import SubscriptionResponseOfferType
from equinix.services.fabricv4.models.subscription_router_package_type import SubscriptionRouterPackageType
from equinix.services.fabricv4.models.subscription_router_package_type_code import SubscriptionRouterPackageTypeCode
from equinix.services.fabricv4.models.subscription_status import SubscriptionStatus
from equinix.services.fabricv4.models.subscription_trial import SubscriptionTrial
from equinix.services.fabricv4.models.time_service_filter import TimeServiceFilter
from equinix.services.fabricv4.models.time_service_filters import TimeServiceFilters
from equinix.services.fabricv4.models.time_service_or_filter import TimeServiceOrFilter
from equinix.services.fabricv4.models.time_service_simple_expression import TimeServiceSimpleExpression
from equinix.services.fabricv4.models.time_service_sort_by import TimeServiceSortBy
from equinix.services.fabricv4.models.time_service_sort_criteria import TimeServiceSortCriteria
from equinix.services.fabricv4.models.time_service_sort_direction import TimeServiceSortDirection
from equinix.services.fabricv4.models.time_services_search_request import TimeServicesSearchRequest
from equinix.services.fabricv4.models.top_utilized_statistics import TopUtilizedStatistics
from equinix.services.fabricv4.models.validate_request import ValidateRequest
from equinix.services.fabricv4.models.validate_request_filter import ValidateRequestFilter
Expand Down
1 change: 1 addition & 0 deletions equinix/services/fabricv4/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from equinix.services.fabricv4.api.cloud_routers_api import CloudRoutersApi
from equinix.services.fabricv4.api.connections_api import ConnectionsApi
from equinix.services.fabricv4.api.health_api import HealthApi
from equinix.services.fabricv4.api.marketplace_subscriptions_api import MarketplaceSubscriptionsApi
from equinix.services.fabricv4.api.metros_api import MetrosApi
from equinix.services.fabricv4.api.networks_api import NetworksApi
from equinix.services.fabricv4.api.ports_api import PortsApi
Expand Down
2 changes: 1 addition & 1 deletion equinix/services/fabricv4/api/cloud_routers_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Equinix Fabric is an advanced software-defined interconnection solution that enables you to directly, securely and dynamically connect to distributed infrastructure and digital ecosystems on platform Equinix via a single port, Customers can use Fabric to connect to: </br> 1. Cloud Service Providers - Clouds, network and other service providers. </br> 2. Enterprises - Other Equinix customers, vendors and partners. </br> 3. Myself - Another customer instance deployed at Equinix. </br> </br> <b>Integrations (SDKs, Tools) links:</b> </br> <a href=\"https://deploy.equinix.com/labs/fabric-java\\\">Fabric Java SDK</a> </br> <a href=\"https://deploy.equinix.com/labs/equinix-sdk-go\\\">Fabric Go SDK</a> </br> <a href=\"https://deploy.equinix.com/labs/terraform-provider-equinix\\\">Equinix Terraform Provider</a> </br> <a href=\"https://deploy.equinix.com/labs/terraform-equinix-fabric\\\">Fabric Terraform Modules</a> </br> <a href=\"https://deploy.equinix.com/labs/pulumi-provider-equinix/\">Equinix Pulumi Provider</a> </br>

The version of the OpenAPI document: 4.14
The version of the OpenAPI document: 4.15
Contact: [email protected]
Generated by OpenAPI Generator (https://openapi-generator.tech)

Expand Down
2 changes: 1 addition & 1 deletion equinix/services/fabricv4/api/connections_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Equinix Fabric is an advanced software-defined interconnection solution that enables you to directly, securely and dynamically connect to distributed infrastructure and digital ecosystems on platform Equinix via a single port, Customers can use Fabric to connect to: </br> 1. Cloud Service Providers - Clouds, network and other service providers. </br> 2. Enterprises - Other Equinix customers, vendors and partners. </br> 3. Myself - Another customer instance deployed at Equinix. </br> </br> <b>Integrations (SDKs, Tools) links:</b> </br> <a href=\"https://deploy.equinix.com/labs/fabric-java\\\">Fabric Java SDK</a> </br> <a href=\"https://deploy.equinix.com/labs/equinix-sdk-go\\\">Fabric Go SDK</a> </br> <a href=\"https://deploy.equinix.com/labs/terraform-provider-equinix\\\">Equinix Terraform Provider</a> </br> <a href=\"https://deploy.equinix.com/labs/terraform-equinix-fabric\\\">Fabric Terraform Modules</a> </br> <a href=\"https://deploy.equinix.com/labs/pulumi-provider-equinix/\">Equinix Pulumi Provider</a> </br>

The version of the OpenAPI document: 4.14
The version of the OpenAPI document: 4.15
Contact: [email protected]
Generated by OpenAPI Generator (https://openapi-generator.tech)

Expand Down
2 changes: 1 addition & 1 deletion equinix/services/fabricv4/api/health_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Equinix Fabric is an advanced software-defined interconnection solution that enables you to directly, securely and dynamically connect to distributed infrastructure and digital ecosystems on platform Equinix via a single port, Customers can use Fabric to connect to: </br> 1. Cloud Service Providers - Clouds, network and other service providers. </br> 2. Enterprises - Other Equinix customers, vendors and partners. </br> 3. Myself - Another customer instance deployed at Equinix. </br> </br> <b>Integrations (SDKs, Tools) links:</b> </br> <a href=\"https://deploy.equinix.com/labs/fabric-java\\\">Fabric Java SDK</a> </br> <a href=\"https://deploy.equinix.com/labs/equinix-sdk-go\\\">Fabric Go SDK</a> </br> <a href=\"https://deploy.equinix.com/labs/terraform-provider-equinix\\\">Equinix Terraform Provider</a> </br> <a href=\"https://deploy.equinix.com/labs/terraform-equinix-fabric\\\">Fabric Terraform Modules</a> </br> <a href=\"https://deploy.equinix.com/labs/pulumi-provider-equinix/\">Equinix Pulumi Provider</a> </br>

The version of the OpenAPI document: 4.14
The version of the OpenAPI document: 4.15
Contact: [email protected]
Generated by OpenAPI Generator (https://openapi-generator.tech)

Expand Down
Loading