diff options
author | BrendanHay <> | 2016-06-03 09:06:00 (GMT) |
---|---|---|
committer | hdiff <hdiff@hdiff.luite.com> | 2016-06-03 09:06:00 (GMT) |
commit | f1b877ace3d5d45f7dc2f9202f489d53344e4956 (patch) | |
tree | 07a21c81b6fabb1d6ffcbbbb9ba2f03f21dc32c2 |
version 1.4.21.4.2
43 files changed, 4003 insertions, 0 deletions
@@ -0,0 +1,367 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. diff --git a/README.md b/README.md new file mode 100644 index 0000000..8cc0586 --- /dev/null +++ b/README.md @@ -0,0 +1,253 @@ +# Amazon Application Discovery Service SDK + +* [Version](#version) +* [Description](#description) +* [Contribute](#contribute) +* [Licence](#licence) + + +## Version + +`1.4.2` + + +## Description + +The AWS Application Discovery Service helps Systems Integrators quickly +and reliably plan application migration projects by automatically +identifying applications running in on-premises data centers, their +associated dependencies, and their performance profile. + +Planning data center migrations can involve thousands of workloads that +are often deeply interdependent. Application discovery and dependency +mapping are important early first steps in the migration process, but +difficult to perform at scale due to the lack of automated tools. + +The AWS Application Discovery Service automatically collects +configuration and usage data from servers to develop a list of +applications, how they perform, and how they are interdependent. This +information is securely retained in an AWS Application Discovery Service +database which you can export as a CSV file into your preferred +visualization tool or cloud migration solution to help reduce the +complexity and time in planning your cloud migration. + +The Application Discovery Service is currently available for preview. +Only customers who are engaged with +<https://aws.amazon.com/professional-services/ AWS Professional Services> +or a certified AWS partner can use the service. To see the list of +certified partners and request access to the Application Discovery +Service, complete the following +<http://aws.amazon.com/application-discovery/preview/ preview form>. + +This API reference provides descriptions, syntax, and usage examples for +each of the actions and data types for the Discovery Service. The topic +for each action shows the API request parameters and the response. +Alternatively, you can use one of the AWS SDKs to access an API that is +tailored to the programming language or platform that you\'re using. For +more information, see <http://aws.amazon.com/tools/#SDKs AWS SDKs>. + +This guide is intended for use with the +<http://docs.aws.amazon.com/application-discovery/latest/userguide/what-is-appdiscovery.html AWS Discovery Service User Guide>. + +The following are short descriptions of each API action, organized by +function. + +__Managing AWS Agents Using the Application Discovery Service__ + +An AWS agent is software that you install on on-premises servers and +virtual machines that are targeted for discovery and migration. Agents +run on Linux and Windows Server and collect server configuration and +activity information about your applications and infrastructure. +Specifically, agents collect the following information and send it to +the Application Discovery Service using Secure Sockets Layer (SSL) +encryption: + +- User information (user name, home directory) + +- Group information (name) + +- List of installed packages + +- List of kernel modules + +- All create and stop process events + +- DNS queries + +- NIC information + +- TCP\/UDP process listening ports + +- TCPV4\/V6 connections + +- Operating system information + +- System performance + +- Process performance + +The Application Discovery Service API includes the following actions to +manage AWS agents: + +- /StartDataCollectionByAgentIds/: Instructs the specified agents to + start collecting data. The Application Discovery Service takes + several minutes to receive and process data after you initiate data + collection. + +- /StopDataCollectionByAgentIds/: Instructs the specified agents to + stop collecting data. + +- /DescribeAgents/: Lists AWS agents by ID or lists all agents + associated with your user account if you did not specify an agent + ID. The output includes agent IDs, IP addresses, media access + control (MAC) addresses, agent health, host name where the agent + resides, and the version number of each agent. + +__Querying Configuration Items__ + +A /configuration item/ is an IT asset that was discovered in your data +center by an AWS agent. When you use the Application Discovery Service, +you can specify filters and query specific configuration items. The +service supports Server, Process, and Connection configuration items. +This means you can specify a value for the following keys and query your +IT assets: + +__Server__ + +- server.HostName + +- server.osName + +- server.osVersion + +- server.configurationId + +- server.agentId + +__Process__ + +- process.name + +- process.CommandLine + +- process.configurationId + +- server.hostName + +- server.osName + +- server.osVersion + +- server.configurationId + +- server.agentId + +__Connection__ + +- connection.sourceIp + +- connection.sourcePort + +- connection.destinationIp + +- connection.destinationPort + +- sourceProcess.configurationId + +- sourceProcess.commandLine + +- sourceProcess.name + +- destinationProcessId.configurationId + +- destinationProcess.commandLine + +- destinationProcess.name + +- sourceServer.configurationId + +- sourceServer.hostName + +- sourceServer.osName + +- sourceServer.osVersion + +- destinationServer.configurationId + +- destinationServer.hostName + +- destinationServer.osName + +- destinationServer.osVersion + +The Application Discovery Service includes the following actions for +querying configuration items. + +- /DescribeConfigurations/: Retrieves a list of attributes for a + specific configuration ID. For example, the output for a /server/ + configuration item includes a list of attributes about the server, + including host name, operating system, number of network cards, etc. + +- /ListConfigurations/: Retrieves a list of configuration items + according to the criteria you specify in a filter. The filter + criteria identify relationship requirements. For example, you can + specify filter criteria of process.name with values of /nginx/ and + /apache/. + +__Tagging Discovered Configuration Items__ + +You can tag discovered configuration items. Tags are metadata that help +you categorize IT assets in your data center. Tags use a /key/-/value/ +format. For example, +@{\"key\": \"serverType\", \"value\": \"webServer\"}@. + +- /CreateTags/: Creates one or more tags for a configuration items. + +- /DescribeTags/: Retrieves a list of configuration items that are + tagged with a specific tag. /Or/, retrieves a list of all tags + assigned to a specific configuration item. + +- /DeleteTags/: Deletes the association between a configuration item + and one or more tags. + +__Exporting Data__ + +You can export data as a CSV file to an Amazon S3 bucket or into your +preferred visualization tool or cloud migration solution to help reduce +the complexity and time in planning your cloud migration. + +- /ExportConfigurations/: Exports all discovered configuration data to + an Amazon S3 bucket. Data includes tags and tag associations, + processes, connections, servers, and system performance. This API + returns an export ID which you can query using the GetExportStatus + API. + +- /DescribeExportConfigurations/: Gets the status of the data export. + When the export is complete, the service returns an Amazon S3 URL + where you can download CSV files that include the data. + +Documentation is available via [Hackage](http://hackage.haskell.org/package/amazonka-discovery) +and the [AWS API Reference](https://aws.amazon.com/documentation/). + +The types from this library are intended to be used with [amazonka](http://hackage.haskell.org/package/amazonka), +which provides mechanisms for specifying AuthN/AuthZ information and sending requests. + +Use of lenses is required for constructing and manipulating types. +This is due to the amount of nesting of AWS types and transparency regarding +de/serialisation into more palatable Haskell values. +The provided lenses should be compatible with any of the major lens libraries +[lens](http://hackage.haskell.org/package/lens) or [lens-family-core](http://hackage.haskell.org/package/lens-family-core). + +## Contribute + +For any problems, comments, or feedback please create an issue [here on GitHub](https://github.com/brendanhay/amazonka/issues). + +> _Note:_ this library is an auto-generated Haskell package. Please see `amazonka-gen` for more information. + + +## Licence + +`amazonka-discovery` is released under the [Mozilla Public License Version 2.0](http://www.mozilla.org/MPL/). + +Parts of the code are derived from AWS service descriptions, licensed under Apache 2.0. +Source files subject to this contain an additional licensing clause in their header. diff --git a/Setup.hs b/Setup.hs new file mode 100644 index 0000000..4467109 --- /dev/null +++ b/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/amazonka-discovery.cabal b/amazonka-discovery.cabal new file mode 100644 index 0000000..4777560 --- /dev/null +++ b/amazonka-discovery.cabal @@ -0,0 +1,301 @@ +name: amazonka-discovery +version: 1.4.2 +synopsis: Amazon Application Discovery Service SDK. +homepage: https://github.com/brendanhay/amazonka +bug-reports: https://github.com/brendanhay/amazonka/issues +license: OtherLicense +license-file: LICENSE +author: Brendan Hay +maintainer: Brendan Hay <brendan.g.hay@gmail.com> +copyright: Copyright (c) 2013-2016 Brendan Hay +category: Network, AWS, Cloud, Distributed Computing +build-type: Simple +cabal-version: >= 1.10 +extra-source-files: README.md fixture/*.yaml fixture/*.proto +description: + The AWS Application Discovery Service helps Systems Integrators quickly + and reliably plan application migration projects by automatically + identifying applications running in on-premises data centers, their + associated dependencies, and their performance profile. + + Planning data center migrations can involve thousands of workloads that + are often deeply interdependent. Application discovery and dependency + mapping are important early first steps in the migration process, but + difficult to perform at scale due to the lack of automated tools. + + The AWS Application Discovery Service automatically collects + configuration and usage data from servers to develop a list of + applications, how they perform, and how they are interdependent. This + information is securely retained in an AWS Application Discovery Service + database which you can export as a CSV file into your preferred + visualization tool or cloud migration solution to help reduce the + complexity and time in planning your cloud migration. + + The Application Discovery Service is currently available for preview. + Only customers who are engaged with + <https://aws.amazon.com/professional-services/ AWS Professional Services> + or a certified AWS partner can use the service. To see the list of + certified partners and request access to the Application Discovery + Service, complete the following + <http://aws.amazon.com/application-discovery/preview/ preview form>. + + This API reference provides descriptions, syntax, and usage examples for + each of the actions and data types for the Discovery Service. The topic + for each action shows the API request parameters and the response. + Alternatively, you can use one of the AWS SDKs to access an API that is + tailored to the programming language or platform that you\'re using. For + more information, see <http://aws.amazon.com/tools/#SDKs AWS SDKs>. + + This guide is intended for use with the + <http://docs.aws.amazon.com/application-discovery/latest/userguide/what-is-appdiscovery.html AWS Discovery Service User Guide>. + + The following are short descriptions of each API action, organized by + function. + + __Managing AWS Agents Using the Application Discovery Service__ + + An AWS agent is software that you install on on-premises servers and + virtual machines that are targeted for discovery and migration. Agents + run on Linux and Windows Server and collect server configuration and + activity information about your applications and infrastructure. + Specifically, agents collect the following information and send it to + the Application Discovery Service using Secure Sockets Layer (SSL) + encryption: + + - User information (user name, home directory) + + - Group information (name) + + - List of installed packages + + - List of kernel modules + + - All create and stop process events + + - DNS queries + + - NIC information + + - TCP\/UDP process listening ports + + - TCPV4\/V6 connections + + - Operating system information + + - System performance + + - Process performance + + The Application Discovery Service API includes the following actions to + manage AWS agents: + + - /StartDataCollectionByAgentIds/: Instructs the specified agents to + start collecting data. The Application Discovery Service takes + several minutes to receive and process data after you initiate data + collection. + + - /StopDataCollectionByAgentIds/: Instructs the specified agents to + stop collecting data. + + - /DescribeAgents/: Lists AWS agents by ID or lists all agents + associated with your user account if you did not specify an agent + ID. The output includes agent IDs, IP addresses, media access + control (MAC) addresses, agent health, host name where the agent + resides, and the version number of each agent. + + __Querying Configuration Items__ + + A /configuration item/ is an IT asset that was discovered in your data + center by an AWS agent. When you use the Application Discovery Service, + you can specify filters and query specific configuration items. The + service supports Server, Process, and Connection configuration items. + This means you can specify a value for the following keys and query your + IT assets: + + __Server__ + + - server.HostName + + - server.osName + + - server.osVersion + + - server.configurationId + + - server.agentId + + __Process__ + + - process.name + + - process.CommandLine + + - process.configurationId + + - server.hostName + + - server.osName + + - server.osVersion + + - server.configurationId + + - server.agentId + + __Connection__ + + - connection.sourceIp + + - connection.sourcePort + + - connection.destinationIp + + - connection.destinationPort + + - sourceProcess.configurationId + + - sourceProcess.commandLine + + - sourceProcess.name + + - destinationProcessId.configurationId + + - destinationProcess.commandLine + + - destinationProcess.name + + - sourceServer.configurationId + + - sourceServer.hostName + + - sourceServer.osName + + - sourceServer.osVersion + + - destinationServer.configurationId + + - destinationServer.hostName + + - destinationServer.osName + + - destinationServer.osVersion + + The Application Discovery Service includes the following actions for + querying configuration items. + + - /DescribeConfigurations/: Retrieves a list of attributes for a + specific configuration ID. For example, the output for a /server/ + configuration item includes a list of attributes about the server, + including host name, operating system, number of network cards, etc. + + - /ListConfigurations/: Retrieves a list of configuration items + according to the criteria you specify in a filter. The filter + criteria identify relationship requirements. For example, you can + specify filter criteria of process.name with values of /nginx/ and + /apache/. + + __Tagging Discovered Configuration Items__ + + You can tag discovered configuration items. Tags are metadata that help + you categorize IT assets in your data center. Tags use a /key/-/value/ + format. + + - /CreateTags/: Creates one or more tags for a configuration items. + + - /DescribeTags/: Retrieves a list of configuration items that are + tagged with a specific tag. /Or/, retrieves a list of all tags + assigned to a specific configuration item. + + - /DeleteTags/: Deletes the association between a configuration item + and one or more tags. + + __Exporting Data__ + + You can export data as a CSV file to an Amazon S3 bucket or into your + preferred visualization tool or cloud migration solution to help reduce + the complexity and time in planning your cloud migration. + + - /ExportConfigurations/: Exports all discovered configuration data to + an Amazon S3 bucket. Data includes tags and tag associations, + processes, connections, servers, and system performance. This API + returns an export ID which you can query using the GetExportStatus + API. + + - /DescribeExportConfigurations/: Gets the status of the data export. + When the export is complete, the service returns an Amazon S3 URL + where you can download CSV files that include the data. + . + The types from this library are intended to be used with + <http://hackage.haskell.org/package/amazonka amazonka>, which provides + mechanisms for specifying AuthN/AuthZ information and sending requests. + . + Use of lenses is required for constructing and manipulating types. + This is due to the amount of nesting of AWS types and transparency regarding + de/serialisation into more palatable Haskell values. + The provided lenses should be compatible with any of the major lens libraries + such as <http://hackage.haskell.org/package/lens lens> or + <http://hackage.haskell.org/package/lens-family-core lens-family-core>. + . + See "Network.AWS.Discovery" or <https://aws.amazon.com/documentation/ the AWS Documentation> + to get started. + +source-repository head + type: git + location: git://github.com/brendanhay/amazonka.git + +library + default-language: Haskell2010 + hs-source-dirs: src gen + + ghc-options: -Wall + + exposed-modules: + Network.AWS.Discovery + , Network.AWS.Discovery.CreateTags + , Network.AWS.Discovery.DeleteTags + , Network.AWS.Discovery.DescribeAgents + , Network.AWS.Discovery.DescribeConfigurations + , Network.AWS.Discovery.DescribeExportConfigurations + , Network.AWS.Discovery.DescribeTags + , Network.AWS.Discovery.ExportConfigurations + , Network.AWS.Discovery.ListConfigurations + , Network.AWS.Discovery.StartDataCollectionByAgentIds + , Network.AWS.Discovery.StopDataCollectionByAgentIds + , Network.AWS.Discovery.Types + , Network.AWS.Discovery.Waiters + + other-modules: + Network.AWS.Discovery.Types.Product + , Network.AWS.Discovery.Types.Sum + + build-depends: + amazonka-core == 1.4.2.* + , base >= 4.7 && < 5 + +test-suite amazonka-discovery-test + type: exitcode-stdio-1.0 + default-language: Haskell2010 + hs-source-dirs: test + main-is: Main.hs + + ghc-options: -Wall -threaded + + -- This section is encoded by the template and any modules added by + -- hand outside these namespaces will not correctly be added to the + -- distribution package. + other-modules: + Test.AWS.Discovery + , Test.AWS.Gen.Discovery + , Test.AWS.Discovery.Internal + + build-depends: + amazonka-core == 1.4.2.* + , amazonka-test == 1.4.2.* + , amazonka-discovery == 1.4.2.* + , base + , bytestring + , tasty + , tasty-hunit + , text + , time + , unordered-containers diff --git a/fixture/CreateTags.yaml b/fixture/CreateTags.yaml new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/fixture/CreateTags.yaml diff --git a/fixture/CreateTagsResponse.proto b/fixture/CreateTagsResponse.proto new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/fixture/CreateTagsResponse.proto diff --git a/fixture/DeleteTags.yaml b/fixture/DeleteTags.yaml new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/fixture/DeleteTags.yaml diff --git a/fixture/DeleteTagsResponse.proto b/fixture/DeleteTagsResponse.proto new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/fixture/DeleteTagsResponse.proto diff --git a/fixture/DescribeAgents.yaml b/fixture/DescribeAgents.yaml new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/fixture/DescribeAgents.yaml diff --git a/fixture/DescribeAgentsResponse.proto b/fixture/DescribeAgentsResponse.proto new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/fixture/DescribeAgentsResponse.proto diff --git a/fixture/DescribeConfigurations.yaml b/fixture/DescribeConfigurations.yaml new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/fixture/DescribeConfigurations.yaml diff --git a/fixture/DescribeConfigurationsResponse.proto b/fixture/DescribeConfigurationsResponse.proto new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/fixture/DescribeConfigurationsResponse.proto diff --git a/fixture/DescribeExportConfigurations.yaml b/fixture/DescribeExportConfigurations.yaml new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/fixture/DescribeExportConfigurations.yaml diff --git a/fixture/DescribeExportConfigurationsResponse.proto b/fixture/DescribeExportConfigurationsResponse.proto new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/fixture/DescribeExportConfigurationsResponse.proto diff --git a/fixture/DescribeTags.yaml b/fixture/DescribeTags.yaml new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/fixture/DescribeTags.yaml diff --git a/fixture/DescribeTagsResponse.proto b/fixture/DescribeTagsResponse.proto new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/fixture/DescribeTagsResponse.proto diff --git a/fixture/ExportConfigurations.yaml b/fixture/ExportConfigurations.yaml new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/fixture/ExportConfigurations.yaml diff --git a/fixture/ExportConfigurationsResponse.proto b/fixture/ExportConfigurationsResponse.proto new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/fixture/ExportConfigurationsResponse.proto diff --git a/fixture/ListConfigurations.yaml b/fixture/ListConfigurations.yaml new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/fixture/ListConfigurations.yaml diff --git a/fixture/ListConfigurationsResponse.proto b/fixture/ListConfigurationsResponse.proto new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/fixture/ListConfigurationsResponse.proto diff --git a/fixture/StartDataCollectionByAgentIds.yaml b/fixture/StartDataCollectionByAgentIds.yaml new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/fixture/StartDataCollectionByAgentIds.yaml diff --git a/fixture/StartDataCollectionByAgentIdsResponse.proto b/fixture/StartDataCollectionByAgentIdsResponse.proto new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/fixture/StartDataCollectionByAgentIdsResponse.proto diff --git a/fixture/StopDataCollectionByAgentIds.yaml b/fixture/StopDataCollectionByAgentIds.yaml new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/fixture/StopDataCollectionByAgentIds.yaml diff --git a/fixture/StopDataCollectionByAgentIdsResponse.proto b/fixture/StopDataCollectionByAgentIdsResponse.proto new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/fixture/StopDataCollectionByAgentIdsResponse.proto diff --git a/gen/Network/AWS/Discovery.hs b/gen/Network/AWS/Discovery.hs new file mode 100644 index 0000000..bbeca6b --- /dev/null +++ b/gen/Network/AWS/Discovery.hs @@ -0,0 +1,402 @@ +{-# OPTIONS_GHC -fno-warn-unused-imports #-} +{-# OPTIONS_GHC -fno-warn-duplicate-exports #-} + +-- Derived from AWS service descriptions, licensed under Apache 2.0. + +-- | +-- Module : Network.AWS.Discovery +-- Copyright : (c) 2013-2016 Brendan Hay +-- License : Mozilla Public License, v. 2.0. +-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> +-- Stability : auto-generated +-- Portability : non-portable (GHC extensions) +-- +-- The AWS Application Discovery Service helps Systems Integrators quickly +-- and reliably plan application migration projects by automatically +-- identifying applications running in on-premises data centers, their +-- associated dependencies, and their performance profile. +-- +-- Planning data center migrations can involve thousands of workloads that +-- are often deeply interdependent. Application discovery and dependency +-- mapping are important early first steps in the migration process, but +-- difficult to perform at scale due to the lack of automated tools. +-- +-- The AWS Application Discovery Service automatically collects +-- configuration and usage data from servers to develop a list of +-- applications, how they perform, and how they are interdependent. This +-- information is securely retained in an AWS Application Discovery Service +-- database which you can export as a CSV file into your preferred +-- visualization tool or cloud migration solution to help reduce the +-- complexity and time in planning your cloud migration. +-- +-- The Application Discovery Service is currently available for preview. +-- Only customers who are engaged with +-- <https://aws.amazon.com/professional-services/ AWS Professional Services> +-- or a certified AWS partner can use the service. To see the list of +-- certified partners and request access to the Application Discovery +-- Service, complete the following +-- <http://aws.amazon.com/application-discovery/preview/ preview form>. +-- +-- This API reference provides descriptions, syntax, and usage examples for +-- each of the actions and data types for the Discovery Service. The topic +-- for each action shows the API request parameters and the response. +-- Alternatively, you can use one of the AWS SDKs to access an API that is +-- tailored to the programming language or platform that you\'re using. For +-- more information, see <http://aws.amazon.com/tools/#SDKs AWS SDKs>. +-- +-- This guide is intended for use with the +-- <http://docs.aws.amazon.com/application-discovery/latest/userguide/what-is-appdiscovery.html AWS Discovery Service User Guide>. +-- +-- The following are short descriptions of each API action, organized by +-- function. +-- +-- __Managing AWS Agents Using the Application Discovery Service__ +-- +-- An AWS agent is software that you install on on-premises servers and +-- virtual machines that are targeted for discovery and migration. Agents +-- run on Linux and Windows Server and collect server configuration and +-- activity information about your applications and infrastructure. +-- Specifically, agents collect the following information and send it to +-- the Application Discovery Service using Secure Sockets Layer (SSL) +-- encryption: +-- +-- - User information (user name, home directory) +-- +-- - Group information (name) +-- +-- - List of installed packages +-- +-- - List of kernel modules +-- +-- - All create and stop process events +-- +-- - DNS queries +-- +-- - NIC information +-- +-- - TCP\/UDP process listening ports +-- +-- - TCPV4\/V6 connections +-- +-- - Operating system information +-- +-- - System performance +-- +-- - Process performance +-- +-- The Application Discovery Service API includes the following actions to +-- manage AWS agents: +-- +-- - /StartDataCollectionByAgentIds/: Instructs the specified agents to +-- start collecting data. The Application Discovery Service takes +-- several minutes to receive and process data after you initiate data +-- collection. +-- +-- - /StopDataCollectionByAgentIds/: Instructs the specified agents to +-- stop collecting data. +-- +-- - /DescribeAgents/: Lists AWS agents by ID or lists all agents +-- associated with your user account if you did not specify an agent +-- ID. The output includes agent IDs, IP addresses, media access +-- control (MAC) addresses, agent health, host name where the agent +-- resides, and the version number of each agent. +-- +-- __Querying Configuration Items__ +-- +-- A /configuration item/ is an IT asset that was discovered in your data +-- center by an AWS agent. When you use the Application Discovery Service, +-- you can specify filters and query specific configuration items. The +-- service supports Server, Process, and Connection configuration items. +-- This means you can specify a value for the following keys and query your +-- IT assets: +-- +-- __Server__ +-- +-- - server.HostName +-- +-- - server.osName +-- +-- - server.osVersion +-- +-- - server.configurationId +-- +-- - server.agentId +-- +-- __Process__ +-- +-- - process.name +-- +-- - process.CommandLine +-- +-- - process.configurationId +-- +-- - server.hostName +-- +-- - server.osName +-- +-- - server.osVersion +-- +-- - server.configurationId +-- +-- - server.agentId +-- +-- __Connection__ +-- +-- - connection.sourceIp +-- +-- - connection.sourcePort +-- +-- - connection.destinationIp +-- +-- - connection.destinationPort +-- +-- - sourceProcess.configurationId +-- +-- - sourceProcess.commandLine +-- +-- - sourceProcess.name +-- +-- - destinationProcessId.configurationId +-- +-- - destinationProcess.commandLine +-- +-- - destinationProcess.name +-- +-- - sourceServer.configurationId +-- +-- - sourceServer.hostName +-- +-- - sourceServer.osName +-- +-- - sourceServer.osVersion +-- +-- - destinationServer.configurationId +-- +-- - destinationServer.hostName +-- +-- - destinationServer.osName +-- +-- - destinationServer.osVersion +-- +-- The Application Discovery Service includes the following actions for +-- querying configuration items. +-- +-- - /DescribeConfigurations/: Retrieves a list of attributes for a +-- specific configuration ID. For example, the output for a /server/ +-- configuration item includes a list of attributes about the server, +-- including host name, operating system, number of network cards, etc. +-- +-- - /ListConfigurations/: Retrieves a list of configuration items +-- according to the criteria you specify in a filter. The filter +-- criteria identify relationship requirements. For example, you can +-- specify filter criteria of process.name with values of /nginx/ and +-- /apache/. +-- +-- __Tagging Discovered Configuration Items__ +-- +-- You can tag discovered configuration items. Tags are metadata that help +-- you categorize IT assets in your data center. Tags use a /key/-/value/ +-- format. For example, +-- '{\"key\": \"serverType\", \"value\": \"webServer\"}'. +-- +-- - /CreateTags/: Creates one or more tags for a configuration items. +-- +-- - /DescribeTags/: Retrieves a list of configuration items that are +-- tagged with a specific tag. /Or/, retrieves a list of all tags +-- assigned to a specific configuration item. +-- +-- - /DeleteTags/: Deletes the association between a configuration item +-- and one or more tags. +-- +-- __Exporting Data__ +-- +-- You can export data as a CSV file to an Amazon S3 bucket or into your +-- preferred visualization tool or cloud migration solution to help reduce +-- the complexity and time in planning your cloud migration. +-- +-- - /ExportConfigurations/: Exports all discovered configuration data to +-- an Amazon S3 bucket. Data includes tags and tag associations, +-- processes, connections, servers, and system performance. This API +-- returns an export ID which you can query using the GetExportStatus +-- API. +-- +-- - /DescribeExportConfigurations/: Gets the status of the data export. +-- When the export is complete, the service returns an Amazon S3 URL +-- where you can download CSV files that include the data. +-- +module Network.AWS.Discovery + ( + -- * Service Configuration + discovery + + -- * Errors + -- $errors + + -- ** AuthorizationErrorException + , _AuthorizationErrorException + + -- ** InvalidParameterException + , _InvalidParameterException + + -- ** InvalidParameterValueException + , _InvalidParameterValueException + + -- ** ServerInternalErrorException + , _ServerInternalErrorException + + -- ** OperationNotPermittedException + , _OperationNotPermittedException + + -- ** ResourceNotFoundException + , _ResourceNotFoundException + + -- * Waiters + -- $waiters + + -- * Operations + -- $operations + + -- ** DescribeTags + , module Network.AWS.Discovery.DescribeTags + + -- ** ExportConfigurations + , module Network.AWS.Discovery.ExportConfigurations + + -- ** StopDataCollectionByAgentIds + , module Network.AWS.Discovery.StopDataCollectionByAgentIds + + -- ** CreateTags + , module Network.AWS.Discovery.CreateTags + + -- ** DeleteTags + , module Network.AWS.Discovery.DeleteTags + + -- ** DescribeConfigurations + , module Network.AWS.Discovery.DescribeConfigurations + + -- ** ListConfigurations + , module Network.AWS.Discovery.ListConfigurations + + -- ** DescribeAgents + , module Network.AWS.Discovery.DescribeAgents + + -- ** DescribeExportConfigurations + , module Network.AWS.Discovery.DescribeExportConfigurations + + -- ** StartDataCollectionByAgentIds + , module Network.AWS.Discovery.StartDataCollectionByAgentIds + + -- * Types + + -- ** AgentStatus + , AgentStatus (..) + + -- ** ConfigurationItemType + , ConfigurationItemType (..) + + -- ** ExportStatus + , ExportStatus (..) + + -- ** AgentConfigurationStatus + , AgentConfigurationStatus + , agentConfigurationStatus + , acsAgentId + , acsOperationSucceeded + , acsDescription + + -- ** AgentInfo + , AgentInfo + , agentInfo + , aiHostName + , aiAgentNetworkInfoList + , aiConnectorId + , aiHealth + , aiAgentId + , aiVersion + + -- ** AgentNetworkInfo + , AgentNetworkInfo + , agentNetworkInfo + , aniIpAddress + , aniMacAddress + + -- ** ConfigurationTag + , ConfigurationTag + , configurationTag + , ctTimeOfCreation + , ctConfigurationId + , ctConfigurationType + , ctValue + , ctKey + + -- ** ExportInfo + , ExportInfo + , exportInfo + , eiConfigurationsDownloadURL + , eiExportId + , eiExportStatus + , eiStatusMessage + , eiExportRequestTime + + -- ** Filter + , Filter + , filter' + , fName + , fValues + , fCondition + + -- ** Tag + , Tag + , tag + , tagKey + , tagValue + + -- ** TagFilter + , TagFilter + , tagFilter + , tfName + , tfValues + ) where + +import Network.AWS.Discovery.CreateTags +import Network.AWS.Discovery.DeleteTags +import Network.AWS.Discovery.DescribeAgents +import Network.AWS.Discovery.DescribeConfigurations +import Network.AWS.Discovery.DescribeExportConfigurations +import Network.AWS.Discovery.DescribeTags +import Network.AWS.Discovery.ExportConfigurations +import Network.AWS.Discovery.ListConfigurations +import Network.AWS.Discovery.StartDataCollectionByAgentIds +import Network.AWS.Discovery.StopDataCollectionByAgentIds +import Network.AWS.Discovery.Types +import Network.AWS.Discovery.Waiters + +{- $errors +Error matchers are designed for use with the functions provided by +<http://hackage.haskell.org/package/lens/docs/Control-Exception-Lens.html Control.Exception.Lens>. +This allows catching (and rethrowing) service specific errors returned +by 'Discovery'. +-} + +{- $operations +Some AWS operations return results that are incomplete and require subsequent +requests in order to obtain the entire result set. The process of sending +subsequent requests to continue where a previous request left off is called +pagination. For example, the 'ListObjects' operation of Amazon S3 returns up to +1000 objects at a time, and you must send subsequent requests with the +appropriate Marker in order to retrieve the next page of results. + +Operations that have an 'AWSPager' instance can transparently perform subsequent +requests, correctly setting Markers and other request facets to iterate through +the entire result set of a truncated API operation. Operations which support +this have an additional note in the documentation. + +Many operations have the ability to filter results on the server side. See the +individual operation parameters for details. +-} + +{- $waiters +Waiters poll by repeatedly sending a request until some remote success condition +configured by the 'Wait' specification is fulfilled. The 'Wait' specification +determines how many attempts should be made, in addition to delay and retry strategies. +-} diff --git a/gen/Network/AWS/Discovery/CreateTags.hs b/gen/Network/AWS/Discovery/CreateTags.hs new file mode 100644 index 0000000..24e9a8f --- /dev/null +++ b/gen/Network/AWS/Discovery/CreateTags.hs @@ -0,0 +1,137 @@ +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE TypeFamilies #-} + +{-# OPTIONS_GHC -fno-warn-unused-imports #-} +{-# OPTIONS_GHC -fno-warn-unused-binds #-} +{-# OPTIONS_GHC -fno-warn-unused-matches #-} + +-- Derived from AWS service descriptions, licensed under Apache 2.0. + +-- | +-- Module : Network.AWS.Discovery.CreateTags +-- Copyright : (c) 2013-2016 Brendan Hay +-- License : Mozilla Public License, v. 2.0. +-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> +-- Stability : auto-generated +-- Portability : non-portable (GHC extensions) +-- +-- Creates one or more tags for configuration items. Tags are metadata that +-- help you categorize IT assets. This API accepts a list of multiple +-- configuration items. +module Network.AWS.Discovery.CreateTags + ( + -- * Creating a Request + createTags + , CreateTags + -- * Request Lenses + , ctConfigurationIds + , ctTags + + -- * Destructuring the Response + , createTagsResponse + , CreateTagsResponse + -- * Response Lenses + , ctrsResponseStatus + ) where + +import Network.AWS.Discovery.Types +import Network.AWS.Discovery.Types.Product +import Network.AWS.Lens +import Network.AWS.Prelude +import Network.AWS.Request +import Network.AWS.Response + +-- | /See:/ 'createTags' smart constructor. +data CreateTags = CreateTags' + { _ctConfigurationIds :: ![Text] + , _ctTags :: ![Tag] + } deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'CreateTags' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'ctConfigurationIds' +-- +-- * 'ctTags' +createTags + :: CreateTags +createTags = + CreateTags' + { _ctConfigurationIds = mempty + , _ctTags = mempty + } + +-- | A list of configuration items that you want to tag. +ctConfigurationIds :: Lens' CreateTags [Text] +ctConfigurationIds = lens _ctConfigurationIds (\ s a -> s{_ctConfigurationIds = a}) . _Coerce; + +-- | Tags that you want to associate with one or more configuration items. +-- Specify the tags that you want to create in a /key/-/value/ format. For +-- example: +-- +-- '{\"key\": \"serverType\", \"value\": \"webServer\"}' +ctTags :: Lens' CreateTags [Tag] +ctTags = lens _ctTags (\ s a -> s{_ctTags = a}) . _Coerce; + +instance AWSRequest CreateTags where + type Rs CreateTags = CreateTagsResponse + request = postJSON discovery + response + = receiveEmpty + (\ s h x -> + CreateTagsResponse' <$> (pure (fromEnum s))) + +instance Hashable CreateTags + +instance NFData CreateTags + +instance ToHeaders CreateTags where + toHeaders + = const + (mconcat + ["X-Amz-Target" =# + ("AWSPoseidonService_V2015_11_01.CreateTags" :: + ByteString), + "Content-Type" =# + ("application/x-amz-json-1.1" :: ByteString)]) + +instance ToJSON CreateTags where + toJSON CreateTags'{..} + = object + (catMaybes + [Just ("configurationIds" .= _ctConfigurationIds), + Just ("tags" .= _ctTags)]) + +instance ToPath CreateTags where + toPath = const "/" + +instance ToQuery CreateTags where + toQuery = const mempty + +-- | /See:/ 'createTagsResponse' smart constructor. +newtype CreateTagsResponse = CreateTagsResponse' + { _ctrsResponseStatus :: Int + } deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'CreateTagsResponse' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'ctrsResponseStatus' +createTagsResponse + :: Int -- ^ 'ctrsResponseStatus' + -> CreateTagsResponse +createTagsResponse pResponseStatus_ = + CreateTagsResponse' + { _ctrsResponseStatus = pResponseStatus_ + } + +-- | The response status code. +ctrsResponseStatus :: Lens' CreateTagsResponse Int +ctrsResponseStatus = lens _ctrsResponseStatus (\ s a -> s{_ctrsResponseStatus = a}); + +instance NFData CreateTagsResponse diff --git a/gen/Network/AWS/Discovery/DeleteTags.hs b/gen/Network/AWS/Discovery/DeleteTags.hs new file mode 100644 index 0000000..9a950a9 --- /dev/null +++ b/gen/Network/AWS/Discovery/DeleteTags.hs @@ -0,0 +1,136 @@ +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE TypeFamilies #-} + +{-# OPTIONS_GHC -fno-warn-unused-imports #-} +{-# OPTIONS_GHC -fno-warn-unused-binds #-} +{-# OPTIONS_GHC -fno-warn-unused-matches #-} + +-- Derived from AWS service descriptions, licensed under Apache 2.0. + +-- | +-- Module : Network.AWS.Discovery.DeleteTags +-- Copyright : (c) 2013-2016 Brendan Hay +-- License : Mozilla Public License, v. 2.0. +-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> +-- Stability : auto-generated +-- Portability : non-portable (GHC extensions) +-- +-- Deletes the association between configuration items and one or more +-- tags. This API accepts a list of multiple configuration items. +module Network.AWS.Discovery.DeleteTags + ( + -- * Creating a Request + deleteTags + , DeleteTags + -- * Request Lenses + , dtTags + , dtConfigurationIds + + -- * Destructuring the Response + , deleteTagsResponse + , DeleteTagsResponse + -- * Response Lenses + , drsResponseStatus + ) where + +import Network.AWS.Discovery.Types +import Network.AWS.Discovery.Types.Product +import Network.AWS.Lens +import Network.AWS.Prelude +import Network.AWS.Request +import Network.AWS.Response + +-- | /See:/ 'deleteTags' smart constructor. +data DeleteTags = DeleteTags' + { _dtTags :: !(Maybe [Tag]) + , _dtConfigurationIds :: ![Text] + } deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'DeleteTags' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'dtTags' +-- +-- * 'dtConfigurationIds' +deleteTags + :: DeleteTags +deleteTags = + DeleteTags' + { _dtTags = Nothing + , _dtConfigurationIds = mempty + } + +-- | Tags that you want to delete from one or more configuration items. +-- Specify the tags that you want to delete in a /key/-/value/ format. For +-- example: +-- +-- '{\"key\": \"serverType\", \"value\": \"webServer\"}' +dtTags :: Lens' DeleteTags [Tag] +dtTags = lens _dtTags (\ s a -> s{_dtTags = a}) . _Default . _Coerce; + +-- | A list of configuration items with tags that you want to delete. +dtConfigurationIds :: Lens' DeleteTags [Text] +dtConfigurationIds = lens _dtConfigurationIds (\ s a -> s{_dtConfigurationIds = a}) . _Coerce; + +instance AWSRequest DeleteTags where + type Rs DeleteTags = DeleteTagsResponse + request = postJSON discovery + response + = receiveEmpty + (\ s h x -> + DeleteTagsResponse' <$> (pure (fromEnum s))) + +instance Hashable DeleteTags + +instance NFData DeleteTags + +instance ToHeaders DeleteTags where + toHeaders + = const + (mconcat + ["X-Amz-Target" =# + ("AWSPoseidonService_V2015_11_01.DeleteTags" :: + ByteString), + "Content-Type" =# + ("application/x-amz-json-1.1" :: ByteString)]) + +instance ToJSON DeleteTags where + toJSON DeleteTags'{..} + = object + (catMaybes + [("tags" .=) <$> _dtTags, + Just ("configurationIds" .= _dtConfigurationIds)]) + +instance ToPath DeleteTags where + toPath = const "/" + +instance ToQuery DeleteTags where + toQuery = const mempty + +-- | /See:/ 'deleteTagsResponse' smart constructor. +newtype DeleteTagsResponse = DeleteTagsResponse' + { _drsResponseStatus :: Int + } deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'DeleteTagsResponse' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'drsResponseStatus' +deleteTagsResponse + :: Int -- ^ 'drsResponseStatus' + -> DeleteTagsResponse +deleteTagsResponse pResponseStatus_ = + DeleteTagsResponse' + { _drsResponseStatus = pResponseStatus_ + } + +-- | The response status code. +drsResponseStatus :: Lens' DeleteTagsResponse Int +drsResponseStatus = lens _drsResponseStatus (\ s a -> s{_drsResponseStatus = a}); + +instance NFData DeleteTagsResponse diff --git a/gen/Network/AWS/Discovery/DescribeAgents.hs b/gen/Network/AWS/Discovery/DescribeAgents.hs new file mode 100644 index 0000000..aa42477 --- /dev/null +++ b/gen/Network/AWS/Discovery/DescribeAgents.hs @@ -0,0 +1,169 @@ +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE TypeFamilies #-} + +{-# OPTIONS_GHC -fno-warn-unused-imports #-} +{-# OPTIONS_GHC -fno-warn-unused-binds #-} +{-# OPTIONS_GHC -fno-warn-unused-matches #-} + +-- Derived from AWS service descriptions, licensed under Apache 2.0. + +-- | +-- Module : Network.AWS.Discovery.DescribeAgents +-- Copyright : (c) 2013-2016 Brendan Hay +-- License : Mozilla Public License, v. 2.0. +-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> +-- Stability : auto-generated +-- Portability : non-portable (GHC extensions) +-- +-- Lists AWS agents by ID or lists all agents associated with your user +-- account if you did not specify an agent ID. +module Network.AWS.Discovery.DescribeAgents + ( + -- * Creating a Request + describeAgents + , DescribeAgents + -- * Request Lenses + , daAgentIds + , daNextToken + , daMaxResults + + -- * Destructuring the Response + , describeAgentsResponse + , DescribeAgentsResponse + -- * Response Lenses + , darsAgentsInfo + , darsNextToken + , darsResponseStatus + ) where + +import Network.AWS.Discovery.Types +import Network.AWS.Discovery.Types.Product +import Network.AWS.Lens +import Network.AWS.Prelude +import Network.AWS.Request +import Network.AWS.Response + +-- | /See:/ 'describeAgents' smart constructor. +data DescribeAgents = DescribeAgents' + { _daAgentIds :: !(Maybe [Text]) + , _daNextToken :: !(Maybe Text) + , _daMaxResults :: !(Maybe Int) + } deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'DescribeAgents' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'daAgentIds' +-- +-- * 'daNextToken' +-- +-- * 'daMaxResults' +describeAgents + :: DescribeAgents +describeAgents = + DescribeAgents' + { _daAgentIds = Nothing + , _daNextToken = Nothing + , _daMaxResults = Nothing + } + +-- | The agent IDs for which you want information. If you specify no IDs, the +-- system returns information about all agents associated with your AWS +-- user account. +daAgentIds :: Lens' DescribeAgents [Text] +daAgentIds = lens _daAgentIds (\ s a -> s{_daAgentIds = a}) . _Default . _Coerce; + +-- | A token to start the list. Use this token to get the next set of +-- results. +daNextToken :: Lens' DescribeAgents (Maybe Text) +daNextToken = lens _daNextToken (\ s a -> s{_daNextToken = a}); + +-- | The total number of agents to return. The maximum value is 100. +daMaxResults :: Lens' DescribeAgents (Maybe Int) +daMaxResults = lens _daMaxResults (\ s a -> s{_daMaxResults = a}); + +instance AWSRequest DescribeAgents where + type Rs DescribeAgents = DescribeAgentsResponse + request = postJSON discovery + response + = receiveJSON + (\ s h x -> + DescribeAgentsResponse' <$> + (x .?> "agentsInfo" .!@ mempty) <*> + (x .?> "nextToken") + <*> (pure (fromEnum s))) + +instance Hashable DescribeAgents + +instance NFData DescribeAgents + +instance ToHeaders DescribeAgents where + toHeaders + = const + (mconcat + ["X-Amz-Target" =# + ("AWSPoseidonService_V2015_11_01.DescribeAgents" :: + ByteString), + "Content-Type" =# + ("application/x-amz-json-1.1" :: ByteString)]) + +instance ToJSON DescribeAgents where + toJSON DescribeAgents'{..} + = object + (catMaybes + [("agentIds" .=) <$> _daAgentIds, + ("nextToken" .=) <$> _daNextToken, + ("maxResults" .=) <$> _daMaxResults]) + +instance ToPath DescribeAgents where + toPath = const "/" + +instance ToQuery DescribeAgents where + toQuery = const mempty + +-- | /See:/ 'describeAgentsResponse' smart constructor. +data DescribeAgentsResponse = DescribeAgentsResponse' + { _darsAgentsInfo :: !(Maybe [AgentInfo]) + , _darsNextToken :: !(Maybe Text) + , _darsResponseStatus :: !Int + } deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'DescribeAgentsResponse' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'darsAgentsInfo' +-- +-- * 'darsNextToken' +-- +-- * 'darsResponseStatus' +describeAgentsResponse + :: Int -- ^ 'darsResponseStatus' + -> DescribeAgentsResponse +describeAgentsResponse pResponseStatus_ = + DescribeAgentsResponse' + { _darsAgentsInfo = Nothing + , _darsNextToken = Nothing + , _darsResponseStatus = pResponseStatus_ + } + +-- | Lists AWS agents by ID or lists all agents associated with your user +-- account if you did not specify an agent ID. The output includes agent +-- IDs, IP addresses, media access control (MAC) addresses, agent health, +-- host name where the agent resides, and the version number of each agent. +darsAgentsInfo :: Lens' DescribeAgentsResponse [AgentInfo] +darsAgentsInfo = lens _darsAgentsInfo (\ s a -> s{_darsAgentsInfo = a}) . _Default . _Coerce; + +-- | The call returns a token. Use this token to get the next set of results. +darsNextToken :: Lens' DescribeAgentsResponse (Maybe Text) +darsNextToken = lens _darsNextToken (\ s a -> s{_darsNextToken = a}); + +-- | The response status code. +darsResponseStatus :: Lens' DescribeAgentsResponse Int +darsResponseStatus = lens _darsResponseStatus (\ s a -> s{_darsResponseStatus = a}); + +instance NFData DescribeAgentsResponse diff --git a/gen/Network/AWS/Discovery/DescribeConfigurations.hs b/gen/Network/AWS/Discovery/DescribeConfigurations.hs new file mode 100644 index 0000000..2ad2b65 --- /dev/null +++ b/gen/Network/AWS/Discovery/DescribeConfigurations.hs @@ -0,0 +1,136 @@ +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE TypeFamilies #-} + +{-# OPTIONS_GHC -fno-warn-unused-imports #-} +{-# OPTIONS_GHC -fno-warn-unused-binds #-} +{-# OPTIONS_GHC -fno-warn-unused-matches #-} + +-- Derived from AWS service descriptions, licensed under Apache 2.0. + +-- | +-- Module : Network.AWS.Discovery.DescribeConfigurations +-- Copyright : (c) 2013-2016 Brendan Hay +-- License : Mozilla Public License, v. 2.0. +-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> +-- Stability : auto-generated +-- Portability : non-portable (GHC extensions) +-- +-- Retrieves a list of attributes for a specific configuration ID. For +-- example, the output for a /server/ configuration item includes a list of +-- attributes about the server, including host name, operating system, +-- number of network cards, etc. +module Network.AWS.Discovery.DescribeConfigurations + ( + -- * Creating a Request + describeConfigurations + , DescribeConfigurations + -- * Request Lenses + , dcConfigurationIds + + -- * Destructuring the Response + , describeConfigurationsResponse + , DescribeConfigurationsResponse + -- * Response Lenses + , dcrsConfigurations + , dcrsResponseStatus + ) where + +import Network.AWS.Discovery.Types +import Network.AWS.Discovery.Types.Product +import Network.AWS.Lens +import Network.AWS.Prelude +import Network.AWS.Request +import Network.AWS.Response + +-- | /See:/ 'describeConfigurations' smart constructor. +newtype DescribeConfigurations = DescribeConfigurations' + { _dcConfigurationIds :: [Text] + } deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'DescribeConfigurations' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'dcConfigurationIds' +describeConfigurations + :: DescribeConfigurations +describeConfigurations = + DescribeConfigurations' + { _dcConfigurationIds = mempty + } + +-- | One or more configuration IDs. +dcConfigurationIds :: Lens' DescribeConfigurations [Text] +dcConfigurationIds = lens _dcConfigurationIds (\ s a -> s{_dcConfigurationIds = a}) . _Coerce; + +instance AWSRequest DescribeConfigurations where + type Rs DescribeConfigurations = + DescribeConfigurationsResponse + request = postJSON discovery + response + = receiveJSON + (\ s h x -> + DescribeConfigurationsResponse' <$> + (x .?> "configurations" .!@ mempty) <*> + (pure (fromEnum s))) + +instance Hashable DescribeConfigurations + +instance NFData DescribeConfigurations + +instance ToHeaders DescribeConfigurations where + toHeaders + = const + (mconcat + ["X-Amz-Target" =# + ("AWSPoseidonService_V2015_11_01.DescribeConfigurations" + :: ByteString), + "Content-Type" =# + ("application/x-amz-json-1.1" :: ByteString)]) + +instance ToJSON DescribeConfigurations where + toJSON DescribeConfigurations'{..} + = object + (catMaybes + [Just ("configurationIds" .= _dcConfigurationIds)]) + +instance ToPath DescribeConfigurations where + toPath = const "/" + +instance ToQuery DescribeConfigurations where + toQuery = const mempty + +-- | /See:/ 'describeConfigurationsResponse' smart constructor. +data DescribeConfigurationsResponse = DescribeConfigurationsResponse' + { _dcrsConfigurations :: !(Maybe [Map Text Text]) + , _dcrsResponseStatus :: !Int + } deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'DescribeConfigurationsResponse' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'dcrsConfigurations' +-- +-- * 'dcrsResponseStatus' +describeConfigurationsResponse + :: Int -- ^ 'dcrsResponseStatus' + -> DescribeConfigurationsResponse +describeConfigurationsResponse pResponseStatus_ = + DescribeConfigurationsResponse' + { _dcrsConfigurations = Nothing + , _dcrsResponseStatus = pResponseStatus_ + } + +-- | A key in the response map. The value is an array of data. +dcrsConfigurations :: Lens' DescribeConfigurationsResponse [HashMap Text Text] +dcrsConfigurations = lens _dcrsConfigurations (\ s a -> s{_dcrsConfigurations = a}) . _Default . _Coerce; + +-- | The response status code. +dcrsResponseStatus :: Lens' DescribeConfigurationsResponse Int +dcrsResponseStatus = lens _dcrsResponseStatus (\ s a -> s{_dcrsResponseStatus = a}); + +instance NFData DescribeConfigurationsResponse diff --git a/gen/Network/AWS/Discovery/DescribeExportConfigurations.hs b/gen/Network/AWS/Discovery/DescribeExportConfigurations.hs new file mode 100644 index 0000000..145dd59 --- /dev/null +++ b/gen/Network/AWS/Discovery/DescribeExportConfigurations.hs @@ -0,0 +1,176 @@ +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE TypeFamilies #-} + +{-# OPTIONS_GHC -fno-warn-unused-imports #-} +{-# OPTIONS_GHC -fno-warn-unused-binds #-} +{-# OPTIONS_GHC -fno-warn-unused-matches #-} + +-- Derived from AWS service descriptions, licensed under Apache 2.0. + +-- | +-- Module : Network.AWS.Discovery.DescribeExportConfigurations +-- Copyright : (c) 2013-2016 Brendan Hay +-- License : Mozilla Public License, v. 2.0. +-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> +-- Stability : auto-generated +-- Portability : non-portable (GHC extensions) +-- +-- Retrieves the status of a given export process. You can retrieve status +-- from a maximum of 100 processes. +module Network.AWS.Discovery.DescribeExportConfigurations + ( + -- * Creating a Request + describeExportConfigurations + , DescribeExportConfigurations + -- * Request Lenses + , decNextToken + , decExportIds + , decMaxResults + + -- * Destructuring the Response + , describeExportConfigurationsResponse + , DescribeExportConfigurationsResponse + -- * Response Lenses + , decrsNextToken + , decrsExportsInfo + , decrsResponseStatus + ) where + +import Network.AWS.Discovery.Types +import Network.AWS.Discovery.Types.Product +import Network.AWS.Lens +import Network.AWS.Prelude +import Network.AWS.Request +import Network.AWS.Response + +-- | /See:/ 'describeExportConfigurations' smart constructor. +data DescribeExportConfigurations = DescribeExportConfigurations' + { _decNextToken :: !(Maybe Text) + , _decExportIds :: !(Maybe [Text]) + , _decMaxResults :: !(Maybe Int) + } deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'DescribeExportConfigurations' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'decNextToken' +-- +-- * 'decExportIds' +-- +-- * 'decMaxResults' +describeExportConfigurations + :: DescribeExportConfigurations +describeExportConfigurations = + DescribeExportConfigurations' + { _decNextToken = Nothing + , _decExportIds = Nothing + , _decMaxResults = Nothing + } + +-- | A token to get the next set of results. For example, if you specified +-- 100 IDs for 'DescribeConfigurationsRequest$configurationIds' but set +-- 'DescribeExportConfigurationsRequest$maxResults' to 10, you will get +-- results in a set of 10. Use the token in the query to get the next set +-- of 10. +decNextToken :: Lens' DescribeExportConfigurations (Maybe Text) +decNextToken = lens _decNextToken (\ s a -> s{_decNextToken = a}); + +-- | A unique identifier that you can use to query the export status. +decExportIds :: Lens' DescribeExportConfigurations [Text] +decExportIds = lens _decExportIds (\ s a -> s{_decExportIds = a}) . _Default . _Coerce; + +-- | The maximum number of results that you want to display as a part of the +-- query. +decMaxResults :: Lens' DescribeExportConfigurations (Maybe Int) +decMaxResults = lens _decMaxResults (\ s a -> s{_decMaxResults = a}); + +instance AWSRequest DescribeExportConfigurations + where + type Rs DescribeExportConfigurations = + DescribeExportConfigurationsResponse + request = postJSON discovery + response + = receiveJSON + (\ s h x -> + DescribeExportConfigurationsResponse' <$> + (x .?> "nextToken") <*> + (x .?> "exportsInfo" .!@ mempty) + <*> (pure (fromEnum s))) + +instance Hashable DescribeExportConfigurations + +instance NFData DescribeExportConfigurations + +instance ToHeaders DescribeExportConfigurations where + toHeaders + = const + (mconcat + ["X-Amz-Target" =# + ("AWSPoseidonService_V2015_11_01.DescribeExportConfigurations" + :: ByteString), + "Content-Type" =# + ("application/x-amz-json-1.1" :: ByteString)]) + +instance ToJSON DescribeExportConfigurations where + toJSON DescribeExportConfigurations'{..} + = object + (catMaybes + [("nextToken" .=) <$> _decNextToken, + ("exportIds" .=) <$> _decExportIds, + ("maxResults" .=) <$> _decMaxResults]) + +instance ToPath DescribeExportConfigurations where + toPath = const "/" + +instance ToQuery DescribeExportConfigurations where + toQuery = const mempty + +-- | /See:/ 'describeExportConfigurationsResponse' smart constructor. +data DescribeExportConfigurationsResponse = DescribeExportConfigurationsResponse' + { _decrsNextToken :: !(Maybe Text) + , _decrsExportsInfo :: !(Maybe [ExportInfo]) + , _decrsResponseStatus :: !Int + } deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'DescribeExportConfigurationsResponse' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'decrsNextToken' +-- +-- * 'decrsExportsInfo' +-- +-- * 'decrsResponseStatus' +describeExportConfigurationsResponse + :: Int -- ^ 'decrsResponseStatus' + -> DescribeExportConfigurationsResponse +describeExportConfigurationsResponse pResponseStatus_ = + DescribeExportConfigurationsResponse' + { _decrsNextToken = Nothing + , _decrsExportsInfo = Nothing + , _decrsResponseStatus = pResponseStatus_ + } + +-- | A token to get the next set of results. For example, if you specified +-- 100 IDs for 'DescribeConfigurationsRequest$configurationIds' but set +-- 'DescribeExportConfigurationsRequest$maxResults' to 10, you will get +-- results in a set of 10. Use the token in the query to get the next set +-- of 10. +decrsNextToken :: Lens' DescribeExportConfigurationsResponse (Maybe Text) +decrsNextToken = lens _decrsNextToken (\ s a -> s{_decrsNextToken = a}); + +-- | Returns export details. When the status is complete, the response +-- includes a URL for an Amazon S3 bucket where you can view the data in a +-- CSV file. +decrsExportsInfo :: Lens' DescribeExportConfigurationsResponse [ExportInfo] +decrsExportsInfo = lens _decrsExportsInfo (\ s a -> s{_decrsExportsInfo = a}) . _Default . _Coerce; + +-- | The response status code. +decrsResponseStatus :: Lens' DescribeExportConfigurationsResponse Int +decrsResponseStatus = lens _decrsResponseStatus (\ s a -> s{_decrsResponseStatus = a}); + +instance NFData DescribeExportConfigurationsResponse diff --git a/gen/Network/AWS/Discovery/DescribeTags.hs b/gen/Network/AWS/Discovery/DescribeTags.hs new file mode 100644 index 0000000..26e8ed7 --- /dev/null +++ b/gen/Network/AWS/Discovery/DescribeTags.hs @@ -0,0 +1,168 @@ +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE TypeFamilies #-} + +{-# OPTIONS_GHC -fno-warn-unused-imports #-} +{-# OPTIONS_GHC -fno-warn-unused-binds #-} +{-# OPTIONS_GHC -fno-warn-unused-matches #-} + +-- Derived from AWS service descriptions, licensed under Apache 2.0. + +-- | +-- Module : Network.AWS.Discovery.DescribeTags +-- Copyright : (c) 2013-2016 Brendan Hay +-- License : Mozilla Public License, v. 2.0. +-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> +-- Stability : auto-generated +-- Portability : non-portable (GHC extensions) +-- +-- Retrieves a list of configuration items that are tagged with a specific +-- tag. Or retrieves a list of all tags assigned to a specific +-- configuration item. +module Network.AWS.Discovery.DescribeTags + ( + -- * Creating a Request + describeTags + , DescribeTags + -- * Request Lenses + , dtFilters + , dtNextToken + , dtMaxResults + + -- * Destructuring the Response + , describeTagsResponse + , DescribeTagsResponse + -- * Response Lenses + , dtrsNextToken + , dtrsTags + , dtrsResponseStatus + ) where + +import Network.AWS.Discovery.Types +import Network.AWS.Discovery.Types.Product +import Network.AWS.Lens +import Network.AWS.Prelude +import Network.AWS.Request +import Network.AWS.Response + +-- | /See:/ 'describeTags' smart constructor. +data DescribeTags = DescribeTags' + { _dtFilters :: !(Maybe [TagFilter]) + , _dtNextToken :: !(Maybe Text) + , _dtMaxResults :: !(Maybe Int) + } deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'DescribeTags' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'dtFilters' +-- +-- * 'dtNextToken' +-- +-- * 'dtMaxResults' +describeTags + :: DescribeTags +describeTags = + DescribeTags' + { _dtFilters = Nothing + , _dtNextToken = Nothing + , _dtMaxResults = Nothing + } + +-- | You can filter the list using a /key/-/value/ format. You can separate +-- these items by using logical operators. Allowed filters include +-- 'tagKey', 'tagValue', and 'configurationId'. +dtFilters :: Lens' DescribeTags [TagFilter] +dtFilters = lens _dtFilters (\ s a -> s{_dtFilters = a}) . _Default . _Coerce; + +-- | A token to start the list. Use this token to get the next set of +-- results. +dtNextToken :: Lens' DescribeTags (Maybe Text) +dtNextToken = lens _dtNextToken (\ s a -> s{_dtNextToken = a}); + +-- | The total number of items to return. The maximum value is 100. +dtMaxResults :: Lens' DescribeTags (Maybe Int) +dtMaxResults = lens _dtMaxResults (\ s a -> s{_dtMaxResults = a}); + +instance AWSRequest DescribeTags where + type Rs DescribeTags = DescribeTagsResponse + request = postJSON discovery + response + = receiveJSON + (\ s h x -> + DescribeTagsResponse' <$> + (x .?> "nextToken") <*> (x .?> "tags" .!@ mempty) <*> + (pure (fromEnum s))) + +instance Hashable DescribeTags + +instance NFData DescribeTags + +instance ToHeaders DescribeTags where + toHeaders + = const + (mconcat + ["X-Amz-Target" =# + ("AWSPoseidonService_V2015_11_01.DescribeTags" :: + ByteString), + "Content-Type" =# + ("application/x-amz-json-1.1" :: ByteString)]) + +instance ToJSON DescribeTags where + toJSON DescribeTags'{..} + = object + (catMaybes + [("filters" .=) <$> _dtFilters, + ("nextToken" .=) <$> _dtNextToken, + ("maxResults" .=) <$> _dtMaxResults]) + +instance ToPath DescribeTags where + toPath = const "/" + +instance ToQuery DescribeTags where + toQuery = const mempty + +-- | /See:/ 'describeTagsResponse' smart constructor. +data DescribeTagsResponse = DescribeTagsResponse' + { _dtrsNextToken :: !(Maybe Text) + , _dtrsTags :: !(Maybe [ConfigurationTag]) + , _dtrsResponseStatus :: !Int + } deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'DescribeTagsResponse' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'dtrsNextToken' +-- +-- * 'dtrsTags' +-- +-- * 'dtrsResponseStatus' +describeTagsResponse + :: Int -- ^ 'dtrsResponseStatus' + -> DescribeTagsResponse +describeTagsResponse pResponseStatus_ = + DescribeTagsResponse' + { _dtrsNextToken = Nothing + , _dtrsTags = Nothing + , _dtrsResponseStatus = pResponseStatus_ + } + +-- | The call returns a token. Use this token to get the next set of results. +dtrsNextToken :: Lens' DescribeTagsResponse (Maybe Text) +dtrsNextToken = lens _dtrsNextToken (\ s a -> s{_dtrsNextToken = a}); + +-- | Depending on the input, this is a list of configuration items tagged +-- with a specific tag, or a list of tags for a specific configuration +-- item. +dtrsTags :: Lens' DescribeTagsResponse [ConfigurationTag] +dtrsTags = lens _dtrsTags (\ s a -> s{_dtrsTags = a}) . _Default . _Coerce; + +-- | The response status code. +dtrsResponseStatus :: Lens' DescribeTagsResponse Int +dtrsResponseStatus = lens _dtrsResponseStatus (\ s a -> s{_dtrsResponseStatus = a}); + +instance NFData DescribeTagsResponse diff --git a/gen/Network/AWS/Discovery/ExportConfigurations.hs b/gen/Network/AWS/Discovery/ExportConfigurations.hs new file mode 100644 index 0000000..ecb4bc5 --- /dev/null +++ b/gen/Network/AWS/Discovery/ExportConfigurations.hs @@ -0,0 +1,122 @@ +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE TypeFamilies #-} + +{-# OPTIONS_GHC -fno-warn-unused-imports #-} +{-# OPTIONS_GHC -fno-warn-unused-binds #-} +{-# OPTIONS_GHC -fno-warn-unused-matches #-} + +-- Derived from AWS service descriptions, licensed under Apache 2.0. + +-- | +-- Module : Network.AWS.Discovery.ExportConfigurations +-- Copyright : (c) 2013-2016 Brendan Hay +-- License : Mozilla Public License, v. 2.0. +-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> +-- Stability : auto-generated +-- Portability : non-portable (GHC extensions) +-- +-- Exports all discovered configuration data to an Amazon S3 bucket or an +-- application that enables you to view and evaluate the data. Data +-- includes tags and tag associations, processes, connections, servers, and +-- system performance. This API returns an export ID which you can query +-- using the /GetExportStatus/ API. The system imposes a limit of two +-- configuration exports in six hours. +module Network.AWS.Discovery.ExportConfigurations + ( + -- * Creating a Request + exportConfigurations + , ExportConfigurations + + -- * Destructuring the Response + , exportConfigurationsResponse + , ExportConfigurationsResponse + -- * Response Lenses + , ecrsExportId + , ecrsResponseStatus + ) where + +import Network.AWS.Discovery.Types +import Network.AWS.Discovery.Types.Product +import Network.AWS.Lens +import Network.AWS.Prelude +import Network.AWS.Request +import Network.AWS.Response + +-- | /See:/ 'exportConfigurations' smart constructor. +data ExportConfigurations = + ExportConfigurations' + deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'ExportConfigurations' with the minimum fields required to make a request. +-- +exportConfigurations + :: ExportConfigurations +exportConfigurations = ExportConfigurations' + +instance AWSRequest ExportConfigurations where + type Rs ExportConfigurations = + ExportConfigurationsResponse + request = postJSON discovery + response + = receiveJSON + (\ s h x -> + ExportConfigurationsResponse' <$> + (x .?> "exportId") <*> (pure (fromEnum s))) + +instance Hashable ExportConfigurations + +instance NFData ExportConfigurations + +instance ToHeaders ExportConfigurations where + toHeaders + = const + (mconcat + ["X-Amz-Target" =# + ("AWSPoseidonService_V2015_11_01.ExportConfigurations" + :: ByteString), + "Content-Type" =# + ("application/x-amz-json-1.1" :: ByteString)]) + +instance ToJSON ExportConfigurations where + toJSON = const (Object mempty) + +instance ToPath ExportConfigurations where + toPath = const "/" + +instance ToQuery ExportConfigurations where + toQuery = const mempty + +-- | /See:/ 'exportConfigurationsResponse' smart constructor. +data ExportConfigurationsResponse = ExportConfigurationsResponse' + { _ecrsExportId :: !(Maybe Text) + , _ecrsResponseStatus :: !Int + } deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'ExportConfigurationsResponse' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'ecrsExportId' +-- +-- * 'ecrsResponseStatus' +exportConfigurationsResponse + :: Int -- ^ 'ecrsResponseStatus' + -> ExportConfigurationsResponse +exportConfigurationsResponse pResponseStatus_ = + ExportConfigurationsResponse' + { _ecrsExportId = Nothing + , _ecrsResponseStatus = pResponseStatus_ + } + +-- | A unique identifier that you can use to query the export status. +ecrsExportId :: Lens' ExportConfigurationsResponse (Maybe Text) +ecrsExportId = lens _ecrsExportId (\ s a -> s{_ecrsExportId = a}); + +-- | The response status code. +ecrsResponseStatus :: Lens' ExportConfigurationsResponse Int +ecrsResponseStatus = lens _ecrsResponseStatus (\ s a -> s{_ecrsResponseStatus = a}); + +instance NFData ExportConfigurationsResponse diff --git a/gen/Network/AWS/Discovery/ListConfigurations.hs b/gen/Network/AWS/Discovery/ListConfigurations.hs new file mode 100644 index 0000000..5b19437 --- /dev/null +++ b/gen/Network/AWS/Discovery/ListConfigurations.hs @@ -0,0 +1,182 @@ +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE TypeFamilies #-} + +{-# OPTIONS_GHC -fno-warn-unused-imports #-} +{-# OPTIONS_GHC -fno-warn-unused-binds #-} +{-# OPTIONS_GHC -fno-warn-unused-matches #-} + +-- Derived from AWS service descriptions, licensed under Apache 2.0. + +-- | +-- Module : Network.AWS.Discovery.ListConfigurations +-- Copyright : (c) 2013-2016 Brendan Hay +-- License : Mozilla Public License, v. 2.0. +-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> +-- Stability : auto-generated +-- Portability : non-portable (GHC extensions) +-- +-- Retrieves a list of configurations items according to the criteria you +-- specify in a filter. The filter criteria identify relationship +-- requirements. +module Network.AWS.Discovery.ListConfigurations + ( + -- * Creating a Request + listConfigurations + , ListConfigurations + -- * Request Lenses + , lcFilters + , lcNextToken + , lcMaxResults + , lcConfigurationType + + -- * Destructuring the Response + , listConfigurationsResponse + , ListConfigurationsResponse + -- * Response Lenses + , lcrsConfigurations + , lcrsNextToken + , lcrsResponseStatus + ) where + +import Network.AWS.Discovery.Types +import Network.AWS.Discovery.Types.Product +import Network.AWS.Lens +import Network.AWS.Prelude +import Network.AWS.Request +import Network.AWS.Response + +-- | /See:/ 'listConfigurations' smart constructor. +data ListConfigurations = ListConfigurations' + { _lcFilters :: !(Maybe [Filter]) + , _lcNextToken :: !(Maybe Text) + , _lcMaxResults :: !(Maybe Int) + , _lcConfigurationType :: !ConfigurationItemType + } deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'ListConfigurations' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'lcFilters' +-- +-- * 'lcNextToken' +-- +-- * 'lcMaxResults' +-- +-- * 'lcConfigurationType' +listConfigurations + :: ConfigurationItemType -- ^ 'lcConfigurationType' + -> ListConfigurations +listConfigurations pConfigurationType_ = + ListConfigurations' + { _lcFilters = Nothing + , _lcNextToken = Nothing + , _lcMaxResults = Nothing + , _lcConfigurationType = pConfigurationType_ + } + +-- | You can filter the list using a /key/-/value/ format. For example: +-- +-- '{\"key\": \"serverType\", \"value\": \"webServer\"}' +-- +-- You can separate these items by using logical operators. +lcFilters :: Lens' ListConfigurations [Filter] +lcFilters = lens _lcFilters (\ s a -> s{_lcFilters = a}) . _Default . _Coerce; + +-- | A token to start the list. Use this token to get the next set of +-- results. +lcNextToken :: Lens' ListConfigurations (Maybe Text) +lcNextToken = lens _lcNextToken (\ s a -> s{_lcNextToken = a}); + +-- | The total number of items to return. The maximum value is 100. +lcMaxResults :: Lens' ListConfigurations (Maybe Int) +lcMaxResults = lens _lcMaxResults (\ s a -> s{_lcMaxResults = a}); + +-- | A valid configuration identified by the Discovery Service. +lcConfigurationType :: Lens' ListConfigurations ConfigurationItemType +lcConfigurationType = lens _lcConfigurationType (\ s a -> s{_lcConfigurationType = a}); + +instance AWSRequest ListConfigurations where + type Rs ListConfigurations = + ListConfigurationsResponse + request = postJSON discovery + response + = receiveJSON + (\ s h x -> + ListConfigurationsResponse' <$> + (x .?> "configurations" .!@ mempty) <*> + (x .?> "nextToken") + <*> (pure (fromEnum s))) + +instance Hashable ListConfigurations + +instance NFData ListConfigurations + +instance ToHeaders ListConfigurations where + toHeaders + = const + (mconcat + ["X-Amz-Target" =# + ("AWSPoseidonService_V2015_11_01.ListConfigurations" + :: ByteString), + "Content-Type" =# + ("application/x-amz-json-1.1" :: ByteString)]) + +instance ToJSON ListConfigurations where + toJSON ListConfigurations'{..} + = object + (catMaybes + [("filters" .=) <$> _lcFilters, + ("nextToken" .=) <$> _lcNextToken, + ("maxResults" .=) <$> _lcMaxResults, + Just ("configurationType" .= _lcConfigurationType)]) + +instance ToPath ListConfigurations where + toPath = const "/" + +instance ToQuery ListConfigurations where + toQuery = const mempty + +-- | /See:/ 'listConfigurationsResponse' smart constructor. +data ListConfigurationsResponse = ListConfigurationsResponse' + { _lcrsConfigurations :: !(Maybe [Map Text Text]) + , _lcrsNextToken :: !(Maybe Text) + , _lcrsResponseStatus :: !Int + } deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'ListConfigurationsResponse' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'lcrsConfigurations' +-- +-- * 'lcrsNextToken' +-- +-- * 'lcrsResponseStatus' +listConfigurationsResponse + :: Int -- ^ 'lcrsResponseStatus' + -> ListConfigurationsResponse +listConfigurationsResponse pResponseStatus_ = + ListConfigurationsResponse' + { _lcrsConfigurations = Nothing + , _lcrsNextToken = Nothing + , _lcrsResponseStatus = pResponseStatus_ + } + +-- | Returns configuration details, including the configuration ID, attribute +-- names, and attribute values. +lcrsConfigurations :: Lens' ListConfigurationsResponse [HashMap Text Text] +lcrsConfigurations = lens _lcrsConfigurations (\ s a -> s{_lcrsConfigurations = a}) . _Default . _Coerce; + +-- | The call returns a token. Use this token to get the next set of results. +lcrsNextToken :: Lens' ListConfigurationsResponse (Maybe Text) +lcrsNextToken = lens _lcrsNextToken (\ s a -> s{_lcrsNextToken = a}); + +-- | The response status code. +lcrsResponseStatus :: Lens' ListConfigurationsResponse Int +lcrsResponseStatus = lens _lcrsResponseStatus (\ s a -> s{_lcrsResponseStatus = a}); + +instance NFData ListConfigurationsResponse diff --git a/gen/Network/AWS/Discovery/StartDataCollectionByAgentIds.hs b/gen/Network/AWS/Discovery/StartDataCollectionByAgentIds.hs new file mode 100644 index 0000000..6831fd2 --- /dev/null +++ b/gen/Network/AWS/Discovery/StartDataCollectionByAgentIds.hs @@ -0,0 +1,143 @@ +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE TypeFamilies #-} + +{-# OPTIONS_GHC -fno-warn-unused-imports #-} +{-# OPTIONS_GHC -fno-warn-unused-binds #-} +{-# OPTIONS_GHC -fno-warn-unused-matches #-} + +-- Derived from AWS service descriptions, licensed under Apache 2.0. + +-- | +-- Module : Network.AWS.Discovery.StartDataCollectionByAgentIds +-- Copyright : (c) 2013-2016 Brendan Hay +-- License : Mozilla Public License, v. 2.0. +-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> +-- Stability : auto-generated +-- Portability : non-portable (GHC extensions) +-- +-- Instructs the specified agents to start collecting data. Agents can +-- reside on host servers or virtual machines in your data center. +module Network.AWS.Discovery.StartDataCollectionByAgentIds + ( + -- * Creating a Request + startDataCollectionByAgentIds + , StartDataCollectionByAgentIds + -- * Request Lenses + , sAgentIds + + -- * Destructuring the Response + , startDataCollectionByAgentIdsResponse + , StartDataCollectionByAgentIdsResponse + -- * Response Lenses + , srsAgentsConfigurationStatus + , srsResponseStatus + ) where + +import Network.AWS.Discovery.Types +import Network.AWS.Discovery.Types.Product +import Network.AWS.Lens +import Network.AWS.Prelude +import Network.AWS.Request +import Network.AWS.Response + +-- | /See:/ 'startDataCollectionByAgentIds' smart constructor. +newtype StartDataCollectionByAgentIds = StartDataCollectionByAgentIds' + { _sAgentIds :: [Text] + } deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'StartDataCollectionByAgentIds' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'sAgentIds' +startDataCollectionByAgentIds + :: StartDataCollectionByAgentIds +startDataCollectionByAgentIds = + StartDataCollectionByAgentIds' + { _sAgentIds = mempty + } + +-- | The IDs of the agents that you want to start collecting data. If you +-- send a request to an AWS agent ID that you do not have permission to +-- contact, according to your AWS account, the service does not throw an +-- exception. Instead, it returns the error in the /Description/ field. If +-- you send a request to multiple agents and you do not have permission to +-- contact some of those agents, the system does not throw an exception. +-- Instead, the system shows 'Failed' in the /Description/ field. +sAgentIds :: Lens' StartDataCollectionByAgentIds [Text] +sAgentIds = lens _sAgentIds (\ s a -> s{_sAgentIds = a}) . _Coerce; + +instance AWSRequest StartDataCollectionByAgentIds + where + type Rs StartDataCollectionByAgentIds = + StartDataCollectionByAgentIdsResponse + request = postJSON discovery + response + = receiveJSON + (\ s h x -> + StartDataCollectionByAgentIdsResponse' <$> + (x .?> "agentsConfigurationStatus" .!@ mempty) <*> + (pure (fromEnum s))) + +instance Hashable StartDataCollectionByAgentIds + +instance NFData StartDataCollectionByAgentIds + +instance ToHeaders StartDataCollectionByAgentIds + where + toHeaders + = const + (mconcat + ["X-Amz-Target" =# + ("AWSPoseidonService_V2015_11_01.StartDataCollectionByAgentIds" + :: ByteString), + "Content-Type" =# + ("application/x-amz-json-1.1" :: ByteString)]) + +instance ToJSON StartDataCollectionByAgentIds where + toJSON StartDataCollectionByAgentIds'{..} + = object + (catMaybes [Just ("agentIds" .= _sAgentIds)]) + +instance ToPath StartDataCollectionByAgentIds where + toPath = const "/" + +instance ToQuery StartDataCollectionByAgentIds where + toQuery = const mempty + +-- | /See:/ 'startDataCollectionByAgentIdsResponse' smart constructor. +data StartDataCollectionByAgentIdsResponse = StartDataCollectionByAgentIdsResponse' + { _srsAgentsConfigurationStatus :: !(Maybe [AgentConfigurationStatus]) + , _srsResponseStatus :: !Int + } deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'StartDataCollectionByAgentIdsResponse' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'srsAgentsConfigurationStatus' +-- +-- * 'srsResponseStatus' +startDataCollectionByAgentIdsResponse + :: Int -- ^ 'srsResponseStatus' + -> StartDataCollectionByAgentIdsResponse +startDataCollectionByAgentIdsResponse pResponseStatus_ = + StartDataCollectionByAgentIdsResponse' + { _srsAgentsConfigurationStatus = Nothing + , _srsResponseStatus = pResponseStatus_ + } + +-- | Information about agents that were instructed to start collecting data. +-- Information includes the agent ID, a description of the operation +-- performed, and whether or not the agent configuration was updated. +srsAgentsConfigurationStatus :: Lens' StartDataCollectionByAgentIdsResponse [AgentConfigurationStatus] +srsAgentsConfigurationStatus = lens _srsAgentsConfigurationStatus (\ s a -> s{_srsAgentsConfigurationStatus = a}) . _Default . _Coerce; + +-- | The response status code. +srsResponseStatus :: Lens' StartDataCollectionByAgentIdsResponse Int +srsResponseStatus = lens _srsResponseStatus (\ s a -> s{_srsResponseStatus = a}); + +instance NFData StartDataCollectionByAgentIdsResponse diff --git a/gen/Network/AWS/Discovery/StopDataCollectionByAgentIds.hs b/gen/Network/AWS/Discovery/StopDataCollectionByAgentIds.hs new file mode 100644 index 0000000..087b34d --- /dev/null +++ b/gen/Network/AWS/Discovery/StopDataCollectionByAgentIds.hs @@ -0,0 +1,135 @@ +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE TypeFamilies #-} + +{-# OPTIONS_GHC -fno-warn-unused-imports #-} +{-# OPTIONS_GHC -fno-warn-unused-binds #-} +{-# OPTIONS_GHC -fno-warn-unused-matches #-} + +-- Derived from AWS service descriptions, licensed under Apache 2.0. + +-- | +-- Module : Network.AWS.Discovery.StopDataCollectionByAgentIds +-- Copyright : (c) 2013-2016 Brendan Hay +-- License : Mozilla Public License, v. 2.0. +-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> +-- Stability : auto-generated +-- Portability : non-portable (GHC extensions) +-- +-- Instructs the specified agents to stop collecting data. +module Network.AWS.Discovery.StopDataCollectionByAgentIds + ( + -- * Creating a Request + stopDataCollectionByAgentIds + , StopDataCollectionByAgentIds + -- * Request Lenses + , sdcbaiAgentIds + + -- * Destructuring the Response + , stopDataCollectionByAgentIdsResponse + , StopDataCollectionByAgentIdsResponse + -- * Response Lenses + , sdcbairsAgentsConfigurationStatus + , sdcbairsResponseStatus + ) where + +import Network.AWS.Discovery.Types +import Network.AWS.Discovery.Types.Product +import Network.AWS.Lens +import Network.AWS.Prelude +import Network.AWS.Request +import Network.AWS.Response + +-- | /See:/ 'stopDataCollectionByAgentIds' smart constructor. +newtype StopDataCollectionByAgentIds = StopDataCollectionByAgentIds' + { _sdcbaiAgentIds :: [Text] + } deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'StopDataCollectionByAgentIds' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'sdcbaiAgentIds' +stopDataCollectionByAgentIds + :: StopDataCollectionByAgentIds +stopDataCollectionByAgentIds = + StopDataCollectionByAgentIds' + { _sdcbaiAgentIds = mempty + } + +-- | The IDs of the agents that you want to stop collecting data. +sdcbaiAgentIds :: Lens' StopDataCollectionByAgentIds [Text] +sdcbaiAgentIds = lens _sdcbaiAgentIds (\ s a -> s{_sdcbaiAgentIds = a}) . _Coerce; + +instance AWSRequest StopDataCollectionByAgentIds + where + type Rs StopDataCollectionByAgentIds = + StopDataCollectionByAgentIdsResponse + request = postJSON discovery + response + = receiveJSON + (\ s h x -> + StopDataCollectionByAgentIdsResponse' <$> + (x .?> "agentsConfigurationStatus" .!@ mempty) <*> + (pure (fromEnum s))) + +instance Hashable StopDataCollectionByAgentIds + +instance NFData StopDataCollectionByAgentIds + +instance ToHeaders StopDataCollectionByAgentIds where + toHeaders + = const + (mconcat + ["X-Amz-Target" =# + ("AWSPoseidonService_V2015_11_01.StopDataCollectionByAgentIds" + :: ByteString), + "Content-Type" =# + ("application/x-amz-json-1.1" :: ByteString)]) + +instance ToJSON StopDataCollectionByAgentIds where + toJSON StopDataCollectionByAgentIds'{..} + = object + (catMaybes [Just ("agentIds" .= _sdcbaiAgentIds)]) + +instance ToPath StopDataCollectionByAgentIds where + toPath = const "/" + +instance ToQuery StopDataCollectionByAgentIds where + toQuery = const mempty + +-- | /See:/ 'stopDataCollectionByAgentIdsResponse' smart constructor. +data StopDataCollectionByAgentIdsResponse = StopDataCollectionByAgentIdsResponse' + { _sdcbairsAgentsConfigurationStatus :: !(Maybe [AgentConfigurationStatus]) + , _sdcbairsResponseStatus :: !Int + } deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'StopDataCollectionByAgentIdsResponse' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'sdcbairsAgentsConfigurationStatus' +-- +-- * 'sdcbairsResponseStatus' +stopDataCollectionByAgentIdsResponse + :: Int -- ^ 'sdcbairsResponseStatus' + -> StopDataCollectionByAgentIdsResponse +stopDataCollectionByAgentIdsResponse pResponseStatus_ = + StopDataCollectionByAgentIdsResponse' + { _sdcbairsAgentsConfigurationStatus = Nothing + , _sdcbairsResponseStatus = pResponseStatus_ + } + +-- | Information about agents that were instructed to stop collecting data. +-- Information includes the agent ID, a description of the operation +-- performed, and whether or not the agent configuration was updated. +sdcbairsAgentsConfigurationStatus :: Lens' StopDataCollectionByAgentIdsResponse [AgentConfigurationStatus] +sdcbairsAgentsConfigurationStatus = lens _sdcbairsAgentsConfigurationStatus (\ s a -> s{_sdcbairsAgentsConfigurationStatus = a}) . _Default . _Coerce; + +-- | The response status code. +sdcbairsResponseStatus :: Lens' StopDataCollectionByAgentIdsResponse Int +sdcbairsResponseStatus = lens _sdcbairsResponseStatus (\ s a -> s{_sdcbairsResponseStatus = a}); + +instance NFData StopDataCollectionByAgentIdsResponse diff --git a/gen/Network/AWS/Discovery/Types.hs b/gen/Network/AWS/Discovery/Types.hs new file mode 100644 index 0000000..eff8ce5 --- /dev/null +++ b/gen/Network/AWS/Discovery/Types.hs @@ -0,0 +1,168 @@ +{-# LANGUAGE OverloadedStrings #-} + +-- Derived from AWS service descriptions, licensed under Apache 2.0. + +-- | +-- Module : Network.AWS.Discovery.Types +-- Copyright : (c) 2013-2016 Brendan Hay +-- License : Mozilla Public License, v. 2.0. +-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> +-- Stability : auto-generated +-- Portability : non-portable (GHC extensions) +-- +module Network.AWS.Discovery.Types + ( + -- * Service Configuration + discovery + + -- * Errors + , _AuthorizationErrorException + , _InvalidParameterException + , _InvalidParameterValueException + , _ServerInternalErrorException + , _OperationNotPermittedException + , _ResourceNotFoundException + + -- * AgentStatus + , AgentStatus (..) + + -- * ConfigurationItemType + , ConfigurationItemType (..) + + -- * ExportStatus + , ExportStatus (..) + + -- * AgentConfigurationStatus + , AgentConfigurationStatus + , agentConfigurationStatus + , acsAgentId + , acsOperationSucceeded + , acsDescription + + -- * AgentInfo + , AgentInfo + , agentInfo + , aiHostName + , aiAgentNetworkInfoList + , aiConnectorId + , aiHealth + , aiAgentId + , aiVersion + + -- * AgentNetworkInfo + , AgentNetworkInfo + , agentNetworkInfo + , aniIpAddress + , aniMacAddress + + -- * ConfigurationTag + , ConfigurationTag + , configurationTag + , ctTimeOfCreation + , ctConfigurationId + , ctConfigurationType + , ctValue + , ctKey + + -- * ExportInfo + , ExportInfo + , exportInfo + , eiConfigurationsDownloadURL + , eiExportId + , eiExportStatus + , eiStatusMessage + , eiExportRequestTime + + -- * Filter + , Filter + , filter' + , fName + , fValues + , fCondition + + -- * Tag + , Tag + , tag + , tagKey + , tagValue + + -- * TagFilter + , TagFilter + , tagFilter + , tfName + , tfValues + ) where + +import Network.AWS.Discovery.Types.Product +import Network.AWS.Discovery.Types.Sum +import Network.AWS.Lens +import Network.AWS.Prelude +import Network.AWS.Sign.V4 + +-- | API version '2015-11-01' of the Amazon Application Discovery Service SDK configuration. +discovery :: Service +discovery = + Service + { _svcAbbrev = "Discovery" + , _svcSigner = v4 + , _svcPrefix = "discovery" + , _svcVersion = "2015-11-01" + , _svcEndpoint = defaultEndpoint discovery + , _svcTimeout = Just 70 + , _svcCheck = statusSuccess + , _svcError = parseJSONError "Discovery" + , _svcRetry = retry + } + where + retry = + Exponential + { _retryBase = 5.0e-2 + , _retryGrowth = 2 + , _retryAttempts = 5 + , _retryCheck = check + } + check e + | has (hasStatus 429) e = Just "too_many_requests" + | has (hasCode "ThrottlingException" . hasStatus 400) e = + Just "throttling_exception" + | has (hasCode "Throttling" . hasStatus 400) e = Just "throttling" + | has (hasStatus 504) e = Just "gateway_timeout" + | has (hasStatus 502) e = Just "bad_gateway" + | has (hasStatus 503) e = Just "service_unavailable" + | has (hasStatus 500) e = Just "general_server_error" + | has (hasStatus 509) e = Just "limit_exceeded" + | otherwise = Nothing + +-- | The AWS user account does not have permission to perform the action. +-- Check the IAM policy associated with this account. +_AuthorizationErrorException :: AsError a => Getting (First ServiceError) a ServiceError +_AuthorizationErrorException = + _ServiceError . hasCode "AuthorizationErrorException" + +-- | One or more parameters are not valid. Verify the parameters and try +-- again. +_InvalidParameterException :: AsError a => Getting (First ServiceError) a ServiceError +_InvalidParameterException = + _ServiceError . hasCode "InvalidParameterException" + +-- | The value of one or more parameters are either invalid or out of range. +-- Verify the parameter values and try again. +_InvalidParameterValueException :: AsError a => Getting (First ServiceError) a ServiceError +_InvalidParameterValueException = + _ServiceError . hasCode "InvalidParameterValueException" + +-- | The server experienced an internal error. Try again. +_ServerInternalErrorException :: AsError a => Getting (First ServiceError) a ServiceError +_ServerInternalErrorException = + _ServiceError . hasCode "ServerInternalErrorException" + +-- | This operation is not permitted. +_OperationNotPermittedException :: AsError a => Getting (First ServiceError) a ServiceError +_OperationNotPermittedException = + _ServiceError . hasCode "OperationNotPermittedException" + +-- | The specified configuration ID was not located. Verify the configuration +-- ID and try again. +_ResourceNotFoundException :: AsError a => Getting (First ServiceError) a ServiceError +_ResourceNotFoundException = + _ServiceError . hasCode "ResourceNotFoundException" diff --git a/gen/Network/AWS/Discovery/Types/Product.hs b/gen/Network/AWS/Discovery/Types/Product.hs new file mode 100644 index 0000000..837f265 --- /dev/null +++ b/gen/Network/AWS/Discovery/Types/Product.hs @@ -0,0 +1,582 @@ +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} + +{-# OPTIONS_GHC -fno-warn-unused-imports #-} + +-- Derived from AWS service descriptions, licensed under Apache 2.0. + +-- | +-- Module : Network.AWS.Discovery.Types.Product +-- Copyright : (c) 2013-2016 Brendan Hay +-- License : Mozilla Public License, v. 2.0. +-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> +-- Stability : auto-generated +-- Portability : non-portable (GHC extensions) +-- +module Network.AWS.Discovery.Types.Product where + +import Network.AWS.Discovery.Types.Sum +import Network.AWS.Lens +import Network.AWS.Prelude + +-- | Information about agents that were instructed to start collecting data. +-- Information includes the agent ID, a description of the operation, and +-- whether or not the agent configuration was updated. +-- +-- /See:/ 'agentConfigurationStatus' smart constructor. +data AgentConfigurationStatus = AgentConfigurationStatus' + { _acsAgentId :: !(Maybe Text) + , _acsOperationSucceeded :: !(Maybe Bool) + , _acsDescription :: !(Maybe Text) + } deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'AgentConfigurationStatus' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'acsAgentId' +-- +-- * 'acsOperationSucceeded' +-- +-- * 'acsDescription' +agentConfigurationStatus + :: AgentConfigurationStatus +agentConfigurationStatus = + AgentConfigurationStatus' + { _acsAgentId = Nothing + , _acsOperationSucceeded = Nothing + , _acsDescription = Nothing + } + +-- | The agent ID. +acsAgentId :: Lens' AgentConfigurationStatus (Maybe Text) +acsAgentId = lens _acsAgentId (\ s a -> s{_acsAgentId = a}); + +-- | Information about the status of the 'StartDataCollection' and +-- 'StopDataCollection' operations. The system has recorded the data +-- collection operation. The agent receives this command the next time it +-- polls for a new command. +acsOperationSucceeded :: Lens' AgentConfigurationStatus (Maybe Bool) +acsOperationSucceeded = lens _acsOperationSucceeded (\ s a -> s{_acsOperationSucceeded = a}); + +-- | A description of the operation performed. +acsDescription :: Lens' AgentConfigurationStatus (Maybe Text) +acsDescription = lens _acsDescription (\ s a -> s{_acsDescription = a}); + +instance FromJSON AgentConfigurationStatus where + parseJSON + = withObject "AgentConfigurationStatus" + (\ x -> + AgentConfigurationStatus' <$> + (x .:? "agentId") <*> (x .:? "operationSucceeded") + <*> (x .:? "description")) + +instance Hashable AgentConfigurationStatus + +instance NFData AgentConfigurationStatus + +-- | Information about agents associated with the user’s AWS account. +-- Information includes agent IDs, IP addresses, media access control (MAC) +-- addresses, agent health, hostname where the agent resides, and agent +-- version for each agent. +-- +-- /See:/ 'agentInfo' smart constructor. +data AgentInfo = AgentInfo' + { _aiHostName :: !(Maybe Text) + , _aiAgentNetworkInfoList :: !(Maybe [AgentNetworkInfo]) + , _aiConnectorId :: !(Maybe Text) + , _aiHealth :: !(Maybe AgentStatus) + , _aiAgentId :: !(Maybe Text) + , _aiVersion :: !(Maybe Text) + } deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'AgentInfo' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'aiHostName' +-- +-- * 'aiAgentNetworkInfoList' +-- +-- * 'aiConnectorId' +-- +-- * 'aiHealth' +-- +-- * 'aiAgentId' +-- +-- * 'aiVersion' +agentInfo + :: AgentInfo +agentInfo = + AgentInfo' + { _aiHostName = Nothing + , _aiAgentNetworkInfoList = Nothing + , _aiConnectorId = Nothing + , _aiHealth = Nothing + , _aiAgentId = Nothing + , _aiVersion = Nothing + } + +-- | The name of the host where the agent resides. The host can be a server +-- or virtual machine. +aiHostName :: Lens' AgentInfo (Maybe Text) +aiHostName = lens _aiHostName (\ s a -> s{_aiHostName = a}); + +-- | Network details about the host where the agent resides. +aiAgentNetworkInfoList :: Lens' AgentInfo [AgentNetworkInfo] +aiAgentNetworkInfoList = lens _aiAgentNetworkInfoList (\ s a -> s{_aiAgentNetworkInfoList = a}) . _Default . _Coerce; + +-- | This data type is currently not valid. +aiConnectorId :: Lens' AgentInfo (Maybe Text) +aiConnectorId = lens _aiConnectorId (\ s a -> s{_aiConnectorId = a}); + +-- | The health of the agent. +aiHealth :: Lens' AgentInfo (Maybe AgentStatus) +aiHealth = lens _aiHealth (\ s a -> s{_aiHealth = a}); + +-- | The agent ID. +aiAgentId :: Lens' AgentInfo (Maybe Text) +aiAgentId = lens _aiAgentId (\ s a -> s{_aiAgentId = a}); + +-- | The agent version. +aiVersion :: Lens' AgentInfo (Maybe Text) +aiVersion = lens _aiVersion (\ s a -> s{_aiVersion = a}); + +instance FromJSON AgentInfo where + parseJSON + = withObject "AgentInfo" + (\ x -> + AgentInfo' <$> + (x .:? "hostName") <*> + (x .:? "agentNetworkInfoList" .!= mempty) + <*> (x .:? "connectorId") + <*> (x .:? "health") + <*> (x .:? "agentId") + <*> (x .:? "version")) + +instance Hashable AgentInfo + +instance NFData AgentInfo + +-- | Network details about the host where the agent resides. +-- +-- /See:/ 'agentNetworkInfo' smart constructor. +data AgentNetworkInfo = AgentNetworkInfo' + { _aniIpAddress :: !(Maybe Text) + , _aniMacAddress :: !(Maybe Text) + } deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'AgentNetworkInfo' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'aniIpAddress' +-- +-- * 'aniMacAddress' +agentNetworkInfo + :: AgentNetworkInfo +agentNetworkInfo = + AgentNetworkInfo' + { _aniIpAddress = Nothing + , _aniMacAddress = Nothing + } + +-- | The IP address for the host where the agent resides. +aniIpAddress :: Lens' AgentNetworkInfo (Maybe Text) +aniIpAddress = lens _aniIpAddress (\ s a -> s{_aniIpAddress = a}); + +-- | The MAC address for the host where the agent resides. +aniMacAddress :: Lens' AgentNetworkInfo (Maybe Text) +aniMacAddress = lens _aniMacAddress (\ s a -> s{_aniMacAddress = a}); + +instance FromJSON AgentNetworkInfo where + parseJSON + = withObject "AgentNetworkInfo" + (\ x -> + AgentNetworkInfo' <$> + (x .:? "ipAddress") <*> (x .:? "macAddress")) + +instance Hashable AgentNetworkInfo + +instance NFData AgentNetworkInfo + +-- | Tags for a configuration item. Tags are metadata that help you +-- categorize IT assets. +-- +-- /See:/ 'configurationTag' smart constructor. +data ConfigurationTag = ConfigurationTag' + { _ctTimeOfCreation :: !(Maybe POSIX) + , _ctConfigurationId :: !(Maybe Text) + , _ctConfigurationType :: !(Maybe ConfigurationItemType) + , _ctValue :: !(Maybe Text) + , _ctKey :: !(Maybe Text) + } deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'ConfigurationTag' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'ctTimeOfCreation' +-- +-- * 'ctConfigurationId' +-- +-- * 'ctConfigurationType' +-- +-- * 'ctValue' +-- +-- * 'ctKey' +configurationTag + :: ConfigurationTag +configurationTag = + ConfigurationTag' + { _ctTimeOfCreation = Nothing + , _ctConfigurationId = Nothing + , _ctConfigurationType = Nothing + , _ctValue = Nothing + , _ctKey = Nothing + } + +-- | The time the configuration tag was created in Coordinated Universal Time +-- (UTC). +ctTimeOfCreation :: Lens' ConfigurationTag (Maybe UTCTime) +ctTimeOfCreation = lens _ctTimeOfCreation (\ s a -> s{_ctTimeOfCreation = a}) . mapping _Time; + +-- | The configuration ID for the item you want to tag. You can specify a +-- list of keys and values. +ctConfigurationId :: Lens' ConfigurationTag (Maybe Text) +ctConfigurationId = lens _ctConfigurationId (\ s a -> s{_ctConfigurationId = a}); + +-- | A type of IT asset that you want to tag. +ctConfigurationType :: Lens' ConfigurationTag (Maybe ConfigurationItemType) +ctConfigurationType = lens _ctConfigurationType (\ s a -> s{_ctConfigurationType = a}); + +-- | A value to filter on. For example /key = serverType/ and /value = web +-- server/. +ctValue :: Lens' ConfigurationTag (Maybe Text) +ctValue = lens _ctValue (\ s a -> s{_ctValue = a}); + +-- | A type of tag to filter on. For example, /serverType/. +ctKey :: Lens' ConfigurationTag (Maybe Text) +ctKey = lens _ctKey (\ s a -> s{_ctKey = a}); + +instance FromJSON ConfigurationTag where + parseJSON + = withObject "ConfigurationTag" + (\ x -> + ConfigurationTag' <$> + (x .:? "timeOfCreation") <*> + (x .:? "configurationId") + <*> (x .:? "configurationType") + <*> (x .:? "value") + <*> (x .:? "key")) + +instance Hashable ConfigurationTag + +instance NFData ConfigurationTag + +-- | Information regarding the export status of the discovered data. The +-- value is an array of objects. +-- +-- /See:/ 'exportInfo' smart constructor. +data ExportInfo = ExportInfo' + { _eiConfigurationsDownloadURL :: !(Maybe Text) + , _eiExportId :: !Text + , _eiExportStatus :: !ExportStatus + , _eiStatusMessage :: !Text + , _eiExportRequestTime :: !POSIX + } deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'ExportInfo' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'eiConfigurationsDownloadURL' +-- +-- * 'eiExportId' +-- +-- * 'eiExportStatus' +-- +-- * 'eiStatusMessage' +-- +-- * 'eiExportRequestTime' +exportInfo + :: Text -- ^ 'eiExportId' + -> ExportStatus -- ^ 'eiExportStatus' + -> Text -- ^ 'eiStatusMessage' + -> UTCTime -- ^ 'eiExportRequestTime' + -> ExportInfo +exportInfo pExportId_ pExportStatus_ pStatusMessage_ pExportRequestTime_ = + ExportInfo' + { _eiConfigurationsDownloadURL = Nothing + , _eiExportId = pExportId_ + , _eiExportStatus = pExportStatus_ + , _eiStatusMessage = pStatusMessage_ + , _eiExportRequestTime = _Time # pExportRequestTime_ + } + +-- | A URL for an Amazon S3 bucket where you can review the configuration +-- data. The URL is displayed only if the export succeeded. +eiConfigurationsDownloadURL :: Lens' ExportInfo (Maybe Text) +eiConfigurationsDownloadURL = lens _eiConfigurationsDownloadURL (\ s a -> s{_eiConfigurationsDownloadURL = a}); + +-- | A unique identifier that you can use to query the export. +eiExportId :: Lens' ExportInfo Text +eiExportId = lens _eiExportId (\ s a -> s{_eiExportId = a}); + +-- | The status of the configuration data export. The status can succeed, +-- fail, or be in-progress. +eiExportStatus :: Lens' ExportInfo ExportStatus +eiExportStatus = lens _eiExportStatus (\ s a -> s{_eiExportStatus = a}); + +-- | Helpful status messages for API callers. For example: Too many exports +-- in the last 6 hours. Export in progress. Export was successful. +eiStatusMessage :: Lens' ExportInfo Text +eiStatusMessage = lens _eiStatusMessage (\ s a -> s{_eiStatusMessage = a}); + +-- | The time the configuration data export was initiated. +eiExportRequestTime :: Lens' ExportInfo UTCTime +eiExportRequestTime = lens _eiExportRequestTime (\ s a -> s{_eiExportRequestTime = a}) . _Time; + +instance FromJSON ExportInfo where + parseJSON + = withObject "ExportInfo" + (\ x -> + ExportInfo' <$> + (x .:? "configurationsDownloadUrl") <*> + (x .: "exportId") + <*> (x .: "exportStatus") + <*> (x .: "statusMessage") + <*> (x .: "exportRequestTime")) + +instance Hashable ExportInfo + +instance NFData ExportInfo + +-- | A filter that can use conditional operators. +-- +-- /See:/ 'filter'' smart constructor. +data Filter = Filter' + { _fName :: !Text + , _fValues :: ![Text] + , _fCondition :: !Text + } deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'Filter' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'fName' +-- +-- * 'fValues' +-- +-- * 'fCondition' +filter' + :: Text -- ^ 'fName' + -> Text -- ^ 'fCondition' + -> Filter +filter' pName_ pCondition_ = + Filter' + { _fName = pName_ + , _fValues = mempty + , _fCondition = pCondition_ + } + +-- | The name of the filter. The following filter names are allowed for +-- 'SERVER' configuration items. +-- +-- __Server__ +-- +-- - 'server.hostName' +-- +-- - 'server.osName' +-- +-- - 'server.osVersion' +-- +-- - 'server.configurationid' +-- +-- - 'server.agentid' +-- +-- The name of the filter. The following filter names are allowed for +-- 'PROCESS' configuration items. +-- +-- __Process__ +-- +-- - 'process.configurationid' +-- +-- - 'process.name' +-- +-- - 'process.commandLine' +-- +-- - 'server.configurationid' +-- +-- - 'server.hostName' +-- +-- - 'server.osName' +-- +-- - 'server.osVersion' +-- +-- - 'server.agentId' +-- +-- The name of the filter. The following filter names are allowed for +-- 'CONNECTION' configuration items. +-- +-- __Connection__ +-- +-- - 'connection.sourceIp' +-- +-- - 'connection.destinationIp' +-- +-- - 'connection.destinationPort' +-- +-- - 'sourceProcess.configurationId' +-- +-- - 'sourceProcess.name' +-- +-- - 'sourceProcess.commandLine' +-- +-- - 'destinationProcess.configurationId' +-- +-- - 'destinationProcess.name' +-- +-- - 'destinationProcess.commandLine' +-- +-- - 'sourceServer.configurationId' +-- +-- - 'sourceServer.hostName' +-- +-- - 'sourceServer.osName' +-- +-- - 'sourceServer.osVersion' +-- +-- - 'sourceServer.agentId' +-- +-- - 'destinationServer.configurationId' +-- +-- - 'destinationServer.hostName' +-- +-- - 'destinationServer.osName' +-- +-- - 'destinationServer.osVersion' +-- +-- - 'destinationServer.agentId' +-- +fName :: Lens' Filter Text +fName = lens _fName (\ s a -> s{_fName = a}); + +-- | A string value that you want to filter on. For example, if you choose +-- the 'destinationServer.osVersion' filter name, you could specify +-- 'Ubuntu' for the value. +fValues :: Lens' Filter [Text] +fValues = lens _fValues (\ s a -> s{_fValues = a}) . _Coerce; + +-- | A conditional operator. The following operators are valid: EQUALS, +-- NOT_EQUALS, CONTAINS, NOT_CONTAINS. If you specify multiple filters, the +-- system utilizes all filters as though concatenated by /AND/. If you +-- specify multiple values for a particular filter, the system +-- differentiates the values using /OR/. Calling either +-- /DescribeConfigurations/ or /ListConfigurations/ returns attributes of +-- matching configuration items. +fCondition :: Lens' Filter Text +fCondition = lens _fCondition (\ s a -> s{_fCondition = a}); + +instance Hashable Filter + +instance NFData Filter + +instance ToJSON Filter where + toJSON Filter'{..} + = object + (catMaybes + [Just ("name" .= _fName), + Just ("values" .= _fValues), + Just ("condition" .= _fCondition)]) + +-- | Metadata that help you categorize IT assets. +-- +-- /See:/ 'tag' smart constructor. +data Tag = Tag' + { _tagKey :: !Text + , _tagValue :: !Text + } deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'Tag' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'tagKey' +-- +-- * 'tagValue' +tag + :: Text -- ^ 'tagKey' + -> Text -- ^ 'tagValue' + -> Tag +tag pKey_ pValue_ = + Tag' + { _tagKey = pKey_ + , _tagValue = pValue_ + } + +-- | A type of tag to filter on. +tagKey :: Lens' Tag Text +tagKey = lens _tagKey (\ s a -> s{_tagKey = a}); + +-- | A value for a tag key to filter on. +tagValue :: Lens' Tag Text +tagValue = lens _tagValue (\ s a -> s{_tagValue = a}); + +instance Hashable Tag + +instance NFData Tag + +instance ToJSON Tag where + toJSON Tag'{..} + = object + (catMaybes + [Just ("key" .= _tagKey), + Just ("value" .= _tagValue)]) + +-- | The name of a tag filter. Valid names are: 'tagKey', 'tagValue', +-- 'configurationId'. +-- +-- /See:/ 'tagFilter' smart constructor. +data TagFilter = TagFilter' + { _tfName :: !Text + , _tfValues :: ![Text] + } deriving (Eq,Read,Show,Data,Typeable,Generic) + +-- | Creates a value of 'TagFilter' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'tfName' +-- +-- * 'tfValues' +tagFilter + :: Text -- ^ 'tfName' + -> TagFilter +tagFilter pName_ = + TagFilter' + { _tfName = pName_ + , _tfValues = mempty + } + +-- | A name of a tag filter. +tfName :: Lens' TagFilter Text +tfName = lens _tfName (\ s a -> s{_tfName = a}); + +-- | Values of a tag filter. +tfValues :: Lens' TagFilter [Text] +tfValues = lens _tfValues (\ s a -> s{_tfValues = a}) . _Coerce; + +instance Hashable TagFilter + +instance NFData TagFilter + +instance ToJSON TagFilter where + toJSON TagFilter'{..} + = object + (catMaybes + [Just ("name" .= _tfName), + Just ("values" .= _tfValues)]) diff --git a/gen/Network/AWS/Discovery/Types/Sum.hs b/gen/Network/AWS/Discovery/Types/Sum.hs new file mode 100644 index 0000000..65222ae --- /dev/null +++ b/gen/Network/AWS/Discovery/Types/Sum.hs @@ -0,0 +1,119 @@ +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE LambdaCase #-} +{-# LANGUAGE OverloadedStrings #-} + +{-# OPTIONS_GHC -fno-warn-unused-imports #-} + +-- Derived from AWS service descriptions, licensed under Apache 2.0. + +-- | +-- Module : Network.AWS.Discovery.Types.Sum +-- Copyright : (c) 2013-2016 Brendan Hay +-- License : Mozilla Public License, v. 2.0. +-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> +-- Stability : auto-generated +-- Portability : non-portable (GHC extensions) +-- +module Network.AWS.Discovery.Types.Sum where + +import Network.AWS.Prelude + +data AgentStatus + = Blacklisted + | Healthy + | Running + | Shutdown + | Unhealthy + | Unknown + deriving (Eq,Ord,Read,Show,Enum,Bounded,Data,Typeable,Generic) + +instance FromText AgentStatus where + parser = takeLowerText >>= \case + "blacklisted" -> pure Blacklisted + "healthy" -> pure Healthy + "running" -> pure Running + "shutdown" -> pure Shutdown + "unhealthy" -> pure Unhealthy + "unknown" -> pure Unknown + e -> fromTextError $ "Failure parsing AgentStatus from value: '" <> e + <> "'. Accepted values: BLACKLISTED, HEALTHY, RUNNING, SHUTDOWN, UNHEALTHY, UNKNOWN" + +instance ToText AgentStatus where + toText = \case + Blacklisted -> "BLACKLISTED" + Healthy -> "HEALTHY" + Running -> "RUNNING" + Shutdown -> "SHUTDOWN" + Unhealthy -> "UNHEALTHY" + Unknown -> "UNKNOWN" + +instance Hashable AgentStatus +instance NFData AgentStatus +instance ToByteString AgentStatus +instance ToQuery AgentStatus +instance ToHeader AgentStatus + +instance FromJSON AgentStatus where + parseJSON = parseJSONText "AgentStatus" + +data ConfigurationItemType + = Connection + | Process + | Server + deriving (Eq,Ord,Read,Show,Enum,Bounded,Data,Typeable,Generic) + +instance FromText ConfigurationItemType where + parser = takeLowerText >>= \case + "connection" -> pure Connection + "process" -> pure Process + "server" -> pure Server + e -> fromTextError $ "Failure parsing ConfigurationItemType from value: '" <> e + <> "'. Accepted values: CONNECTION, PROCESS, SERVER" + +instance ToText ConfigurationItemType where + toText = \case + Connection -> "CONNECTION" + Process -> "PROCESS" + Server -> "SERVER" + +instance Hashable ConfigurationItemType +instance NFData ConfigurationItemType +instance ToByteString ConfigurationItemType +instance ToQuery ConfigurationItemType +instance ToHeader ConfigurationItemType + +instance ToJSON ConfigurationItemType where + toJSON = toJSONText + +instance FromJSON ConfigurationItemType where + parseJSON = parseJSONText "ConfigurationItemType" + +data ExportStatus + = Failed + | InProgress + | Succeeded + deriving (Eq,Ord,Read,Show,Enum,Bounded,Data,Typeable,Generic) + +instance FromText ExportStatus where + parser = takeLowerText >>= \case + "failed" -> pure Failed + "in_progress" -> pure InProgress + "succeeded" -> pure Succeeded + e -> fromTextError $ "Failure parsing ExportStatus from value: '" <> e + <> "'. Accepted values: FAILED, IN_PROGRESS, SUCCEEDED" + +instance ToText ExportStatus where + toText = \case + Failed -> "FAILED" + InProgress -> "IN_PROGRESS" + Succeeded -> "SUCCEEDED" + +instance Hashable ExportStatus +instance NFData ExportStatus +instance ToByteString ExportStatus +instance ToQuery ExportStatus +instance ToHeader ExportStatus + +instance FromJSON ExportStatus where + parseJSON = parseJSONText "ExportStatus" diff --git a/gen/Network/AWS/Discovery/Waiters.hs b/gen/Network/AWS/Discovery/Waiters.hs new file mode 100644 index 0000000..fd7c4ab --- /dev/null +++ b/gen/Network/AWS/Discovery/Waiters.hs @@ -0,0 +1,21 @@ +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE TypeFamilies #-} + +{-# OPTIONS_GHC -fno-warn-unused-imports #-} + +-- Derived from AWS service descriptions, licensed under Apache 2.0. + +-- | +-- Module : Network.AWS.Discovery.Waiters +-- Copyright : (c) 2013-2016 Brendan Hay +-- License : Mozilla Public License, v. 2.0. +-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> +-- Stability : auto-generated +-- Portability : non-portable (GHC extensions) +-- +module Network.AWS.Discovery.Waiters where + +import Network.AWS.Discovery.Types +import Network.AWS.Lens +import Network.AWS.Prelude +import Network.AWS.Waiter diff --git a/test/Main.hs b/test/Main.hs new file mode 100644 index 0000000..421bcbc --- /dev/null +++ b/test/Main.hs @@ -0,0 +1,21 @@ +{-# OPTIONS_GHC -fno-warn-unused-imports #-} + +-- | +-- Module : Main +-- Copyright : (c) 2013-2016 Brendan Hay +-- License : Mozilla Public License, v. 2.0. +-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> +-- Stability : auto-generated +-- Portability : non-portable (GHC extensions) +-- +module Main (main) where + +import Test.Tasty +import Test.AWS.Discovery +import Test.AWS.Discovery.Internal + +main :: IO () +main = defaultMain $ testGroup "Discovery" + [ testGroup "tests" tests + , testGroup "fixtures" fixtures + ] diff --git a/test/Test/AWS/Discovery.hs b/test/Test/AWS/Discovery.hs new file mode 100644 index 0000000..8e38b45 --- /dev/null +++ b/test/Test/AWS/Discovery.hs @@ -0,0 +1,27 @@ +{-# LANGUAGE OverloadedStrings #-} + +-- | +-- Module : Test.AWS.Discovery +-- Copyright : (c) 2013-2016 Brendan Hay +-- License : This Source Code Form is subject to the terms of +-- the Mozilla Public License, v. 2.0. +-- A copy of the MPL can be found in the LICENSE file or +-- you can obtain it at http://mozilla.org/MPL/2.0/. +-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> +-- Stability : experimental +-- Portability : non-portable (GHC extensions) + +module Test.AWS.Discovery + ( tests + , fixtures + ) where + +import Network.AWS.Discovery +import Test.AWS.Gen.Discovery +import Test.Tasty + +tests :: [TestTree] +tests = [] + +fixtures :: [TestTree] +fixtures = [] diff --git a/test/Test/AWS/Discovery/Internal.hs b/test/Test/AWS/Discovery/Internal.hs new file mode 100644 index 0000000..7b9b03f --- /dev/null +++ b/test/Test/AWS/Discovery/Internal.hs @@ -0,0 +1,17 @@ +{-# LANGUAGE OverloadedStrings #-} +{-# OPTIONS_GHC -fno-warn-unused-imports #-} + +-- | +-- Module : Test.AWS.Discovery.Internal +-- Copyright : (c) 2013-2016 Brendan Hay +-- License : This Source Code Form is subject to the terms of +-- the Mozilla Public License, v. 2.0. +-- A copy of the MPL can be found in the LICENSE file or +-- you can obtain it at http://mozilla.org/MPL/2.0/. +-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> +-- Stability : experimental +-- Portability : non-portable (GHC extensions) + +module Test.AWS.Discovery.Internal where + +import Test.AWS.Prelude diff --git a/test/Test/AWS/Gen/Discovery.hs b/test/Test/AWS/Gen/Discovery.hs new file mode 100644 index 0000000..8079fe8 --- /dev/null +++ b/test/Test/AWS/Gen/Discovery.hs @@ -0,0 +1,219 @@ +{-# OPTIONS_GHC -fno-warn-unused-imports #-} +{-# OPTIONS_GHC -fno-warn-orphans #-} + +-- Derived from AWS service descriptions, licensed under Apache 2.0. + +-- | +-- Module : Test.AWS.Gen.Discovery +-- Copyright : (c) 2013-2016 Brendan Hay +-- License : Mozilla Public License, v. 2.0. +-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> +-- Stability : auto-generated +-- Portability : non-portable (GHC extensions) +-- +module Test.AWS.Gen.Discovery where + +import Data.Proxy +import Test.AWS.Fixture +import Test.AWS.Prelude +import Test.Tasty +import Network.AWS.Discovery +import Test.AWS.Discovery.Internal + +-- Auto-generated: the actual test selection needs to be manually placed into +-- the top-level so that real test data can be incrementally added. +-- +-- This commented snippet is what the entire set should look like: + +-- fixtures :: TestTree +-- fixtures = +-- [ testGroup "request" +-- [ testDescribeTags $ +-- describeTags +-- +-- , testExportConfigurations $ +-- exportConfigurations +-- +-- , testStopDataCollectionByAgentIds $ +-- stopDataCollectionByAgentIds +-- +-- , testCreateTags $ +-- createTags +-- +-- , testDeleteTags $ +-- deleteTags +-- +-- , testDescribeConfigurations $ +-- describeConfigurations +-- +-- , testListConfigurations $ +-- listConfigurations +-- +-- , testDescribeAgents $ +-- describeAgents +-- +-- , testDescribeExportConfigurations $ +-- describeExportConfigurations +-- +-- , testStartDataCollectionByAgentIds $ +-- startDataCollectionByAgentIds +-- +-- ] + +-- , testGroup "response" +-- [ testDescribeTagsResponse $ +-- describeTagsResponse +-- +-- , testExportConfigurationsResponse $ +-- exportConfigurationsResponse +-- +-- , testStopDataCollectionByAgentIdsResponse $ +-- stopDataCollectionByAgentIdsResponse +-- +-- , testCreateTagsResponse $ +-- createTagsResponse +-- +-- , testDeleteTagsResponse $ +-- deleteTagsResponse +-- +-- , testDescribeConfigurationsResponse $ +-- describeConfigurationsResponse +-- +-- , testListConfigurationsResponse $ +-- listConfigurationsResponse +-- +-- , testDescribeAgentsResponse $ +-- describeAgentsResponse +-- +-- , testDescribeExportConfigurationsResponse $ +-- describeExportConfigurationsResponse +-- +-- , testStartDataCollectionByAgentIdsResponse $ +-- startDataCollectionByAgentIdsResponse +-- +-- ] +-- ] + +-- Requests + +testDescribeTags :: DescribeTags -> TestTree +testDescribeTags = req + "DescribeTags" + "fixture/DescribeTags.yaml" + +testExportConfigurations :: ExportConfigurations -> TestTree +testExportConfigurations = req + "ExportConfigurations" + "fixture/ExportConfigurations.yaml" + +testStopDataCollectionByAgentIds :: StopDataCollectionByAgentIds -> TestTree +testStopDataCollectionByAgentIds = req + "StopDataCollectionByAgentIds" + "fixture/StopDataCollectionByAgentIds.yaml" + +testCreateTags :: CreateTags -> TestTree +testCreateTags = req + "CreateTags" + "fixture/CreateTags.yaml" + +testDeleteTags :: DeleteTags -> TestTree +testDeleteTags = req + "DeleteTags" + "fixture/DeleteTags.yaml" + +testDescribeConfigurations :: DescribeConfigurations -> TestTree +testDescribeConfigurations = req + "DescribeConfigurations" + "fixture/DescribeConfigurations.yaml" + +testListConfigurations :: ListConfigurations -> TestTree +testListConfigurations = req + "ListConfigurations" + "fixture/ListConfigurations.yaml" + +testDescribeAgents :: DescribeAgents -> TestTree +testDescribeAgents = req + "DescribeAgents" + "fixture/DescribeAgents.yaml" + +testDescribeExportConfigurations :: DescribeExportConfigurations -> TestTree +testDescribeExportConfigurations = req + "DescribeExportConfigurations" + "fixture/DescribeExportConfigurations.yaml" + +testStartDataCollectionByAgentIds :: StartDataCollectionByAgentIds -> TestTree +testStartDataCollectionByAgentIds = req + "StartDataCollectionByAgentIds" + "fixture/StartDataCollectionByAgentIds.yaml" + +-- Responses + +testDescribeTagsResponse :: DescribeTagsResponse -> TestTree +testDescribeTagsResponse = res + "DescribeTagsResponse" + "fixture/DescribeTagsResponse.proto" + discovery + (Proxy :: Proxy DescribeTags) + +testExportConfigurationsResponse :: ExportConfigurationsResponse -> TestTree +testExportConfigurationsResponse = res + "ExportConfigurationsResponse" + "fixture/ExportConfigurationsResponse.proto" + discovery + (Proxy :: Proxy ExportConfigurations) + +testStopDataCollectionByAgentIdsResponse :: StopDataCollectionByAgentIdsResponse -> TestTree +testStopDataCollectionByAgentIdsResponse = res + "StopDataCollectionByAgentIdsResponse" + "fixture/StopDataCollectionByAgentIdsResponse.proto" + discovery + (Proxy :: Proxy StopDataCollectionByAgentIds) + +testCreateTagsResponse :: CreateTagsResponse -> TestTree +testCreateTagsResponse = res + "CreateTagsResponse" + "fixture/CreateTagsResponse.proto" + discovery + (Proxy :: Proxy CreateTags) + +testDeleteTagsResponse :: DeleteTagsResponse -> TestTree +testDeleteTagsResponse = res + "DeleteTagsResponse" + "fixture/DeleteTagsResponse.proto" + discovery + (Proxy :: Proxy DeleteTags) + +testDescribeConfigurationsResponse :: DescribeConfigurationsResponse -> TestTree +testDescribeConfigurationsResponse = res + "DescribeConfigurationsResponse" + "fixture/DescribeConfigurationsResponse.proto" + discovery + (Proxy :: Proxy DescribeConfigurations) + +testListConfigurationsResponse :: ListConfigurationsResponse -> TestTree +testListConfigurationsResponse = res + "ListConfigurationsResponse" + "fixture/ListConfigurationsResponse.proto" + discovery + (Proxy :: Proxy ListConfigurations) + +testDescribeAgentsResponse :: DescribeAgentsResponse -> TestTree +testDescribeAgentsResponse = res + "DescribeAgentsResponse" + "fixture/DescribeAgentsResponse.proto" + discovery + (Proxy :: Proxy DescribeAgents) + +testDescribeExportConfigurationsResponse :: DescribeExportConfigurationsResponse -> TestTree +testDescribeExportConfigurationsResponse = res + "DescribeExportConfigurationsResponse" + "fixture/DescribeExportConfigurationsResponse.proto" + discovery + (Proxy :: Proxy DescribeExportConfigurations) + +testStartDataCollectionByAgentIdsResponse :: StartDataCollectionByAgentIdsResponse -> TestTree +testStartDataCollectionByAgentIdsResponse = res + "StartDataCollectionByAgentIdsResponse" + "fixture/StartDataCollectionByAgentIdsResponse.proto" + discovery + (Proxy :: Proxy StartDataCollectionByAgentIds) |