-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Initial commit for farmbeats service. #17337
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
Closed
Closed
Changes from 9 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
5fe6592
Initial commit for farmbeats client
agniveshadhikari 3ee382b
Added placeholder readme for azure-farmbeats-ds
agniveshadhikari 486f9a6
Updated swagger, autogen code.
agniveshadhikari b3dfdd6
restructuring
agniveshadhikari 7145caf
Add ci.yml
agniveshadhikari 7c9d862
Adding readmes, should fix readme validation issue
agniveshadhikari feaba8b
Bumping a header to h2 to hopefully resolve readme check
agniveshadhikari 732780c
Deleting top level readme
agniveshadhikari 777a82a
Specifying dep versions in setup.py
agniveshadhikari e76be9a
Removing wrapper
agniveshadhikari 8ac675f
LROs should be sorted now
agniveshadhikari 8d74a58
autorest level rename of client
agniveshadhikari f5a094e
March Swagger updates (not final)
agniveshadhikari b0994d5
Intermediate checking, LROs probably work
agniveshadhikari 65d7b0f
Manually updated swagger
agniveshadhikari b3f9b3e
Adding msrest to deps for package
agniveshadhikari ef1f724
Updates, added an example script for now.
agniveshadhikari 1491922
Adding a helper script to wrap the generation command
agniveshadhikari 4ad9af5
deleting the ds dir
agniveshadhikari e41f714
Added final version info to setup
agniveshadhikari 0c205ae
Generated client form latest swagger. This breaks base url. Yet to ma…
agniveshadhikari 95cf84d
Added default scope
agniveshadhikari b344a8a
Adding back baseurl manually
agniveshadhikari File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| # Azure Farnbeats API DS client library for Python | ||
|
|
||
| TODO | ||
|
|
||
| ## Getting started | ||
|
|
||
| ## Key concepts | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| * Azure subscription | ||
| * Azure Farmbeats instance | ||
| * Python 2.7 or 3.5.3+ TODO figure out supported versions | ||
|
|
||
| If you need a Cosmos DB SQL API account, you can follow this link TODO | ||
|
|
||
| ### Install the package | ||
|
|
||
| + Install GDAL: TODO | ||
|
|
||
| ```bash | ||
| pip install azure-farmbeats | ||
| ``` | ||
|
|
||
| #### Configure a virtual environment (optional) | ||
|
|
||
| Although not required, you can keep your base system and Azure SDK environments isolated from one another if you use a virtual environment. Execute the following commands to configure and then enter a virtual environment with venv: | ||
|
|
||
| ```Bash | ||
| python3 -m venv farmbeats-test-env | ||
| source farmbeats-test-env/bin/activate | ||
| ``` | ||
| ### Authenticate the client | ||
|
|
||
| TODO | ||
|
|
||
| ### Create the client | ||
|
|
||
| TODO | ||
|
|
||
| ## Examples | ||
|
|
||
| Here are some common use case scenarios: | ||
|
|
||
| TODO | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| TODO | ||
|
|
||
|
|
||
| ## Next steps | ||
|
|
||
| TODO | ||
|
|
||
| <!-- LINKS --> | ||
| [azure_cli]: https://docs.microsoft.com/cli/azure | ||
|
|
||
| ## Contributing | ||
|
|
||
| This project welcomes contributions and suggestions. | ||
| Most contributions require you to agree to a | ||
| Contributor License Agreement (CLA) declaring that | ||
| you have the right to, and actually do, grant us | ||
| the rights to use your contribution. | ||
|
|
||
| For details, visit https://cla.microsoft.com. | ||
|
|
||
| When you submit a pull request, a CLA-bot will | ||
| automatically determine whether you need to provide | ||
| a CLA and decorate the PR appropriately (e.g., label, comment). | ||
| Simply follow the instructions provided by the bot. | ||
| You will only need to do this once across all repos using our CLA. | ||
|
|
||
| This project has adopted the | ||
| [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). | ||
| For more information see the | ||
| [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or | ||
| contact [[email protected]](mailto:[email protected]) | ||
| with any additional questions or comments. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| # Azure Farnbeats API client library for Python | ||
|
|
||
| TODO | ||
|
|
||
| ## Getting started | ||
|
|
||
| ### Key concepts | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| * Azure subscription | ||
| * Azure Farmbeats instance | ||
| * Python 2.7 or 3.5.3+ TODO figure out supported versions | ||
|
|
||
| If you need a Cosmos DB SQL API account, you can follow this link TODO | ||
|
|
||
| ### Install the package | ||
|
|
||
| ```bash | ||
| pip install azure-farmbeats | ||
| ``` | ||
|
|
||
| #### Configure a virtual environment (optional) | ||
|
|
||
| Although not required, you can keep your base system and Azure SDK environments isolated from one another if you use a virtual environment. Execute the following commands to configure and then enter a virtual environment with venv: | ||
|
|
||
| ```Bash | ||
| python3 -m venv farmbeats-test-env | ||
| source farmbeats-test-env/bin/activate | ||
| ``` | ||
| ### Authenticate the client | ||
|
|
||
| TODO | ||
|
|
||
| ### Create the client | ||
|
|
||
| TODO | ||
|
|
||
| ## Examples | ||
|
|
||
| Here are some common use case scenarios: | ||
|
|
||
| TODO | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| TODO | ||
|
|
||
|
|
||
| ## Next steps | ||
|
|
||
| TODO | ||
|
|
||
| <!-- LINKS --> | ||
| [azure_cli]: https://docs.microsoft.com/cli/azure | ||
|
|
||
| ## Contributing | ||
|
|
||
| This project welcomes contributions and suggestions. | ||
| Most contributions require you to agree to a | ||
| Contributor License Agreement (CLA) declaring that | ||
| you have the right to, and actually do, grant us | ||
| the rights to use your contribution. | ||
|
|
||
| For details, visit https://cla.microsoft.com. | ||
|
|
||
| When you submit a pull request, a CLA-bot will | ||
| automatically determine whether you need to provide | ||
| a CLA and decorate the PR appropriately (e.g., label, comment). | ||
| Simply follow the instructions provided by the bot. | ||
| You will only need to do this once across all repos using our CLA. | ||
|
|
||
| This project has adopted the | ||
| [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). | ||
| For more information see the | ||
| [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or | ||
| contact [[email protected]](mailto:[email protected]) | ||
| with any additional questions or comments. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| __path__ = __import__('pkgutil').extend_path(__path__, __name__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| from .farmbeatsclient import FarmbeatsClient |
Empty file.
14 changes: 14 additions & 0 deletions
14
sdk/farmbeats/azure-farmbeats/azure/farmbeats/_generated/dpsclient/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # coding=utf-8 | ||
| # -------------------------------------------------------------------------- | ||
| # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.1.3, generator: {generator}) | ||
| # Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
| # -------------------------------------------------------------------------- | ||
|
|
||
| from ._azure_ag_food_platform_data_plane_service import AzureAgFoodPlatformDataPlaneService | ||
| __all__ = ['AzureAgFoodPlatformDataPlaneService'] | ||
|
|
||
| try: | ||
| from ._patch import patch_sdk # type: ignore | ||
| patch_sdk() | ||
| except ImportError: | ||
| pass |
74 changes: 74 additions & 0 deletions
74
...mbeats/azure/farmbeats/_generated/dpsclient/_azure_ag_food_platform_data_plane_service.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| # coding=utf-8 | ||
| # -------------------------------------------------------------------------- | ||
| # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.1.3, generator: {generator}) | ||
| # Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
| # -------------------------------------------------------------------------- | ||
|
|
||
| from typing import TYPE_CHECKING | ||
|
|
||
| from azure.core import PipelineClient | ||
| from msrest import Deserializer, Serializer | ||
|
|
||
| if TYPE_CHECKING: | ||
| # pylint: disable=unused-import,ungrouped-imports | ||
| from typing import Any | ||
|
|
||
| from azure.core.credentials import TokenCredential | ||
| from azure.core.pipeline.transport import HttpRequest, HttpResponse | ||
|
|
||
| from ._configuration import AzureAgFoodPlatformDataPlaneServiceConfiguration | ||
| from .operations import AzureAgFoodPlatformDataPlaneServiceOperationsMixin | ||
| from . import models | ||
|
|
||
|
|
||
| class AzureAgFoodPlatformDataPlaneService(AzureAgFoodPlatformDataPlaneServiceOperationsMixin): | ||
| """APIs documentation for Azure AgPlatform DataPlane Service. | ||
|
|
||
| :param credential: Credential needed for the client to connect to Azure. | ||
| :type credential: ~azure.core.credentials.TokenCredential | ||
| :param str base_url: Service URL | ||
| """ | ||
|
|
||
| def __init__( | ||
| self, | ||
| credential, # type: "TokenCredential" | ||
| base_url=None, | ||
| **kwargs # type: Any | ||
| ): | ||
| # type: (...) -> None | ||
| self._config = AzureAgFoodPlatformDataPlaneServiceConfiguration(credential, **kwargs) | ||
| self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) | ||
|
|
||
| client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} | ||
| self._serialize = Serializer(client_models) | ||
| self._serialize.client_side_validation = False | ||
| self._deserialize = Deserializer(client_models) | ||
|
|
||
|
|
||
| def _send_request(self, http_request, **kwargs): | ||
| # type: (HttpRequest, Any) -> HttpResponse | ||
| """Runs the network request through the client's chained policies. | ||
|
|
||
| :param http_request: The network request you want to make. Required. | ||
| :type http_request: ~azure.core.pipeline.transport.HttpRequest | ||
| :keyword bool stream: Whether the response payload will be streamed. Defaults to True. | ||
| :return: The response of your network call. Does not do error handling on your response. | ||
| :rtype: ~azure.core.pipeline.transport.HttpResponse | ||
| """ | ||
| http_request.url = self._client.format_url(http_request.url) | ||
| stream = kwargs.pop("stream", True) | ||
| pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) | ||
| return pipeline_response.http_response | ||
|
|
||
| def close(self): | ||
| # type: () -> None | ||
| self._client.close() | ||
|
|
||
| def __enter__(self): | ||
| # type: () -> AzureAgFoodPlatformDataPlaneService | ||
| self._client.__enter__() | ||
| return self | ||
|
|
||
| def __exit__(self, *exc_details): | ||
| # type: (Any) -> None | ||
| self._client.__exit__(*exc_details) |
63 changes: 63 additions & 0 deletions
63
sdk/farmbeats/azure-farmbeats/azure/farmbeats/_generated/dpsclient/_configuration.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # coding=utf-8 | ||
| # -------------------------------------------------------------------------- | ||
| # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.1.3, generator: {generator}) | ||
| # Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
| # -------------------------------------------------------------------------- | ||
|
|
||
| from typing import TYPE_CHECKING | ||
|
|
||
| from azure.core.configuration import Configuration | ||
| from azure.core.pipeline import policies | ||
|
|
||
| if TYPE_CHECKING: | ||
| # pylint: disable=unused-import,ungrouped-imports | ||
| from typing import Any | ||
|
|
||
| from azure.core.credentials import TokenCredential | ||
|
|
||
| VERSION = "unknown" | ||
|
|
||
| class AzureAgFoodPlatformDataPlaneServiceConfiguration(Configuration): | ||
| """Configuration for AzureAgFoodPlatformDataPlaneService. | ||
|
|
||
| Note that all parameters used to create this instance are saved as instance | ||
| attributes. | ||
|
|
||
| :param credential: Credential needed for the client to connect to Azure. | ||
| :type credential: ~azure.core.credentials.TokenCredential | ||
| """ | ||
|
|
||
| def __init__( | ||
| self, | ||
| credential, # type: "TokenCredential" | ||
| **kwargs # type: Any | ||
| ): | ||
| # type: (...) -> None | ||
| if credential is None: | ||
| raise ValueError("Parameter 'credential' must not be None.") | ||
| super(AzureAgFoodPlatformDataPlaneServiceConfiguration, self).__init__(**kwargs) | ||
|
|
||
| self.credential = credential | ||
| self.api_version = "2020-12-31-preview" | ||
| self.credential_scopes = kwargs.pop('credential_scopes', []) | ||
| kwargs.setdefault('sdk_moniker', 'azureagfoodplatformdataplaneservice/{}'.format(VERSION)) | ||
| self._configure(**kwargs) | ||
|
|
||
| def _configure( | ||
| self, | ||
| **kwargs # type: Any | ||
| ): | ||
| # type: (...) -> None | ||
| self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) | ||
| self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) | ||
| self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) | ||
| self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) | ||
| self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs) | ||
| self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) | ||
| self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) | ||
| self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) | ||
| self.authentication_policy = kwargs.get('authentication_policy') | ||
| if not self.credential_scopes and not self.authentication_policy: | ||
| raise ValueError("You must provide either credential_scopes or authentication_policy as kwargs") | ||
| if self.credential and not self.authentication_policy: | ||
| self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) |
8 changes: 8 additions & 0 deletions
8
sdk/farmbeats/azure-farmbeats/azure/farmbeats/_generated/dpsclient/aio/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # coding=utf-8 | ||
| # -------------------------------------------------------------------------- | ||
| # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.1.3, generator: {generator}) | ||
| # Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
| # -------------------------------------------------------------------------- | ||
|
|
||
| from ._azure_ag_food_platform_data_plane_service import AzureAgFoodPlatformDataPlaneService | ||
| __all__ = ['AzureAgFoodPlatformDataPlaneService'] |
67 changes: 67 additions & 0 deletions
67
...ts/azure/farmbeats/_generated/dpsclient/aio/_azure_ag_food_platform_data_plane_service.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| # coding=utf-8 | ||
| # -------------------------------------------------------------------------- | ||
| # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.1.3, generator: {generator}) | ||
| # Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
| # -------------------------------------------------------------------------- | ||
|
|
||
| from typing import Any, TYPE_CHECKING | ||
|
|
||
| from azure.core import AsyncPipelineClient | ||
| from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest | ||
| from msrest import Deserializer, Serializer | ||
|
|
||
| if TYPE_CHECKING: | ||
| # pylint: disable=unused-import,ungrouped-imports | ||
| from azure.core.credentials_async import AsyncTokenCredential | ||
|
|
||
| from ._configuration import AzureAgFoodPlatformDataPlaneServiceConfiguration | ||
| from .operations import AzureAgFoodPlatformDataPlaneServiceOperationsMixin | ||
| from .. import models | ||
|
|
||
|
|
||
| class AzureAgFoodPlatformDataPlaneService(AzureAgFoodPlatformDataPlaneServiceOperationsMixin): | ||
| """APIs documentation for Azure AgPlatform DataPlane Service. | ||
|
|
||
| :param credential: Credential needed for the client to connect to Azure. | ||
| :type credential: ~azure.core.credentials_async.AsyncTokenCredential | ||
| :param str base_url: Service URL | ||
| """ | ||
|
|
||
| def __init__( | ||
| self, | ||
| credential: "AsyncTokenCredential", | ||
| **kwargs: Any | ||
| ) -> None: | ||
| base_url = 'None' | ||
| self._config = AzureAgFoodPlatformDataPlaneServiceConfiguration(credential, **kwargs) | ||
| self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) | ||
|
|
||
| client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} | ||
| self._serialize = Serializer(client_models) | ||
| self._serialize.client_side_validation = False | ||
| self._deserialize = Deserializer(client_models) | ||
|
|
||
|
|
||
| async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: | ||
| """Runs the network request through the client's chained policies. | ||
|
|
||
| :param http_request: The network request you want to make. Required. | ||
| :type http_request: ~azure.core.pipeline.transport.HttpRequest | ||
| :keyword bool stream: Whether the response payload will be streamed. Defaults to True. | ||
| :return: The response of your network call. Does not do error handling on your response. | ||
| :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse | ||
| """ | ||
| http_request.url = self._client.format_url(http_request.url) | ||
| stream = kwargs.pop("stream", True) | ||
| pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) | ||
| return pipeline_response.http_response | ||
|
|
||
| async def close(self) -> None: | ||
| await self._client.close() | ||
|
|
||
| async def __aenter__(self) -> "AzureAgFoodPlatformDataPlaneService": | ||
| await self._client.__aenter__() | ||
| return self | ||
|
|
||
| async def __aexit__(self, *exc_details) -> None: | ||
| await self._client.__aexit__(*exc_details) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should not be here