api.go 154 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. // Package cloudwatchlogs provides a client for Amazon CloudWatch Logs.
  3. package cloudwatchlogs
  4. import (
  5. "fmt"
  6. "github.com/aws/aws-sdk-go/aws/awsutil"
  7. "github.com/aws/aws-sdk-go/aws/request"
  8. "github.com/aws/aws-sdk-go/private/protocol"
  9. "github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
  10. )
  11. const opCancelExportTask = "CancelExportTask"
  12. // CancelExportTaskRequest generates a "aws/request.Request" representing the
  13. // client's request for the CancelExportTask operation. The "output" return
  14. // value can be used to capture response data after the request's "Send" method
  15. // is called.
  16. //
  17. // See CancelExportTask for usage and error information.
  18. //
  19. // Creating a request object using this method should be used when you want to inject
  20. // custom logic into the request's lifecycle using a custom handler, or if you want to
  21. // access properties on the request object before or after sending the request. If
  22. // you just want the service response, call the CancelExportTask method directly
  23. // instead.
  24. //
  25. // Note: You must call the "Send" method on the returned request object in order
  26. // to execute the request.
  27. //
  28. // // Example sending a request using the CancelExportTaskRequest method.
  29. // req, resp := client.CancelExportTaskRequest(params)
  30. //
  31. // err := req.Send()
  32. // if err == nil { // resp is now filled
  33. // fmt.Println(resp)
  34. // }
  35. //
  36. func (c *CloudWatchLogs) CancelExportTaskRequest(input *CancelExportTaskInput) (req *request.Request, output *CancelExportTaskOutput) {
  37. op := &request.Operation{
  38. Name: opCancelExportTask,
  39. HTTPMethod: "POST",
  40. HTTPPath: "/",
  41. }
  42. if input == nil {
  43. input = &CancelExportTaskInput{}
  44. }
  45. req = c.newRequest(op, input, output)
  46. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  47. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  48. output = &CancelExportTaskOutput{}
  49. req.Data = output
  50. return
  51. }
  52. // CancelExportTask API operation for Amazon CloudWatch Logs.
  53. //
  54. // Cancels an export task if it is in PENDING or RUNNING state.
  55. //
  56. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  57. // with awserr.Error's Code and Message methods to get detailed information about
  58. // the error.
  59. //
  60. // See the AWS API reference guide for Amazon CloudWatch Logs's
  61. // API operation CancelExportTask for usage and error information.
  62. //
  63. // Returned Error Codes:
  64. // * InvalidParameterException
  65. // Returned if a parameter of the request is incorrectly specified.
  66. //
  67. // * ResourceNotFoundException
  68. // Returned if the specified resource does not exist.
  69. //
  70. // * InvalidOperationException
  71. // Returned if the operation is not valid on the specified resource
  72. //
  73. // * ServiceUnavailableException
  74. // Returned if the service cannot complete the request.
  75. //
  76. func (c *CloudWatchLogs) CancelExportTask(input *CancelExportTaskInput) (*CancelExportTaskOutput, error) {
  77. req, out := c.CancelExportTaskRequest(input)
  78. err := req.Send()
  79. return out, err
  80. }
  81. const opCreateExportTask = "CreateExportTask"
  82. // CreateExportTaskRequest generates a "aws/request.Request" representing the
  83. // client's request for the CreateExportTask operation. The "output" return
  84. // value can be used to capture response data after the request's "Send" method
  85. // is called.
  86. //
  87. // See CreateExportTask for usage and error information.
  88. //
  89. // Creating a request object using this method should be used when you want to inject
  90. // custom logic into the request's lifecycle using a custom handler, or if you want to
  91. // access properties on the request object before or after sending the request. If
  92. // you just want the service response, call the CreateExportTask method directly
  93. // instead.
  94. //
  95. // Note: You must call the "Send" method on the returned request object in order
  96. // to execute the request.
  97. //
  98. // // Example sending a request using the CreateExportTaskRequest method.
  99. // req, resp := client.CreateExportTaskRequest(params)
  100. //
  101. // err := req.Send()
  102. // if err == nil { // resp is now filled
  103. // fmt.Println(resp)
  104. // }
  105. //
  106. func (c *CloudWatchLogs) CreateExportTaskRequest(input *CreateExportTaskInput) (req *request.Request, output *CreateExportTaskOutput) {
  107. op := &request.Operation{
  108. Name: opCreateExportTask,
  109. HTTPMethod: "POST",
  110. HTTPPath: "/",
  111. }
  112. if input == nil {
  113. input = &CreateExportTaskInput{}
  114. }
  115. req = c.newRequest(op, input, output)
  116. output = &CreateExportTaskOutput{}
  117. req.Data = output
  118. return
  119. }
  120. // CreateExportTask API operation for Amazon CloudWatch Logs.
  121. //
  122. // Creates an ExportTask which allows you to efficiently export data from a
  123. // Log Group to your Amazon S3 bucket.
  124. //
  125. // This is an asynchronous call. If all the required information is provided,
  126. // this API will initiate an export task and respond with the task Id. Once
  127. // started, DescribeExportTasks can be used to get the status of an export task.
  128. // You can only have one active (RUNNING or PENDING) export task at a time,
  129. // per account.
  130. //
  131. // You can export logs from multiple log groups or multiple time ranges to the
  132. // same Amazon S3 bucket. To separate out log data for each export task, you
  133. // can specify a prefix that will be used as the Amazon S3 key prefix for all
  134. // exported objects.
  135. //
  136. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  137. // with awserr.Error's Code and Message methods to get detailed information about
  138. // the error.
  139. //
  140. // See the AWS API reference guide for Amazon CloudWatch Logs's
  141. // API operation CreateExportTask for usage and error information.
  142. //
  143. // Returned Error Codes:
  144. // * InvalidParameterException
  145. // Returned if a parameter of the request is incorrectly specified.
  146. //
  147. // * LimitExceededException
  148. // Returned if you have reached the maximum number of resources that can be
  149. // created.
  150. //
  151. // * OperationAbortedException
  152. // Returned if multiple requests to update the same resource were in conflict.
  153. //
  154. // * ServiceUnavailableException
  155. // Returned if the service cannot complete the request.
  156. //
  157. // * ResourceNotFoundException
  158. // Returned if the specified resource does not exist.
  159. //
  160. // * ResourceAlreadyExistsException
  161. // Returned if the specified resource already exists.
  162. //
  163. func (c *CloudWatchLogs) CreateExportTask(input *CreateExportTaskInput) (*CreateExportTaskOutput, error) {
  164. req, out := c.CreateExportTaskRequest(input)
  165. err := req.Send()
  166. return out, err
  167. }
  168. const opCreateLogGroup = "CreateLogGroup"
  169. // CreateLogGroupRequest generates a "aws/request.Request" representing the
  170. // client's request for the CreateLogGroup operation. The "output" return
  171. // value can be used to capture response data after the request's "Send" method
  172. // is called.
  173. //
  174. // See CreateLogGroup for usage and error information.
  175. //
  176. // Creating a request object using this method should be used when you want to inject
  177. // custom logic into the request's lifecycle using a custom handler, or if you want to
  178. // access properties on the request object before or after sending the request. If
  179. // you just want the service response, call the CreateLogGroup method directly
  180. // instead.
  181. //
  182. // Note: You must call the "Send" method on the returned request object in order
  183. // to execute the request.
  184. //
  185. // // Example sending a request using the CreateLogGroupRequest method.
  186. // req, resp := client.CreateLogGroupRequest(params)
  187. //
  188. // err := req.Send()
  189. // if err == nil { // resp is now filled
  190. // fmt.Println(resp)
  191. // }
  192. //
  193. func (c *CloudWatchLogs) CreateLogGroupRequest(input *CreateLogGroupInput) (req *request.Request, output *CreateLogGroupOutput) {
  194. op := &request.Operation{
  195. Name: opCreateLogGroup,
  196. HTTPMethod: "POST",
  197. HTTPPath: "/",
  198. }
  199. if input == nil {
  200. input = &CreateLogGroupInput{}
  201. }
  202. req = c.newRequest(op, input, output)
  203. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  204. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  205. output = &CreateLogGroupOutput{}
  206. req.Data = output
  207. return
  208. }
  209. // CreateLogGroup API operation for Amazon CloudWatch Logs.
  210. //
  211. // Creates a new log group with the specified name. The name of the log group
  212. // must be unique within a region for an AWS account. You can create up to 500
  213. // log groups per account.
  214. //
  215. // You must use the following guidelines when naming a log group:
  216. //
  217. // * Log group names can be between 1 and 512 characters long.
  218. //
  219. // * Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen),
  220. // '/' (forward slash), and '.' (period).
  221. //
  222. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  223. // with awserr.Error's Code and Message methods to get detailed information about
  224. // the error.
  225. //
  226. // See the AWS API reference guide for Amazon CloudWatch Logs's
  227. // API operation CreateLogGroup for usage and error information.
  228. //
  229. // Returned Error Codes:
  230. // * InvalidParameterException
  231. // Returned if a parameter of the request is incorrectly specified.
  232. //
  233. // * ResourceAlreadyExistsException
  234. // Returned if the specified resource already exists.
  235. //
  236. // * LimitExceededException
  237. // Returned if you have reached the maximum number of resources that can be
  238. // created.
  239. //
  240. // * OperationAbortedException
  241. // Returned if multiple requests to update the same resource were in conflict.
  242. //
  243. // * ServiceUnavailableException
  244. // Returned if the service cannot complete the request.
  245. //
  246. func (c *CloudWatchLogs) CreateLogGroup(input *CreateLogGroupInput) (*CreateLogGroupOutput, error) {
  247. req, out := c.CreateLogGroupRequest(input)
  248. err := req.Send()
  249. return out, err
  250. }
  251. const opCreateLogStream = "CreateLogStream"
  252. // CreateLogStreamRequest generates a "aws/request.Request" representing the
  253. // client's request for the CreateLogStream operation. The "output" return
  254. // value can be used to capture response data after the request's "Send" method
  255. // is called.
  256. //
  257. // See CreateLogStream for usage and error information.
  258. //
  259. // Creating a request object using this method should be used when you want to inject
  260. // custom logic into the request's lifecycle using a custom handler, or if you want to
  261. // access properties on the request object before or after sending the request. If
  262. // you just want the service response, call the CreateLogStream method directly
  263. // instead.
  264. //
  265. // Note: You must call the "Send" method on the returned request object in order
  266. // to execute the request.
  267. //
  268. // // Example sending a request using the CreateLogStreamRequest method.
  269. // req, resp := client.CreateLogStreamRequest(params)
  270. //
  271. // err := req.Send()
  272. // if err == nil { // resp is now filled
  273. // fmt.Println(resp)
  274. // }
  275. //
  276. func (c *CloudWatchLogs) CreateLogStreamRequest(input *CreateLogStreamInput) (req *request.Request, output *CreateLogStreamOutput) {
  277. op := &request.Operation{
  278. Name: opCreateLogStream,
  279. HTTPMethod: "POST",
  280. HTTPPath: "/",
  281. }
  282. if input == nil {
  283. input = &CreateLogStreamInput{}
  284. }
  285. req = c.newRequest(op, input, output)
  286. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  287. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  288. output = &CreateLogStreamOutput{}
  289. req.Data = output
  290. return
  291. }
  292. // CreateLogStream API operation for Amazon CloudWatch Logs.
  293. //
  294. // Creates a new log stream in the specified log group. The name of the log
  295. // stream must be unique within the log group. There is no limit on the number
  296. // of log streams that can exist in a log group.
  297. //
  298. // You must use the following guidelines when naming a log stream:
  299. //
  300. // * Log stream names can be between 1 and 512 characters long.
  301. //
  302. // * The ':' colon character is not allowed.
  303. //
  304. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  305. // with awserr.Error's Code and Message methods to get detailed information about
  306. // the error.
  307. //
  308. // See the AWS API reference guide for Amazon CloudWatch Logs's
  309. // API operation CreateLogStream for usage and error information.
  310. //
  311. // Returned Error Codes:
  312. // * InvalidParameterException
  313. // Returned if a parameter of the request is incorrectly specified.
  314. //
  315. // * ResourceAlreadyExistsException
  316. // Returned if the specified resource already exists.
  317. //
  318. // * ResourceNotFoundException
  319. // Returned if the specified resource does not exist.
  320. //
  321. // * ServiceUnavailableException
  322. // Returned if the service cannot complete the request.
  323. //
  324. func (c *CloudWatchLogs) CreateLogStream(input *CreateLogStreamInput) (*CreateLogStreamOutput, error) {
  325. req, out := c.CreateLogStreamRequest(input)
  326. err := req.Send()
  327. return out, err
  328. }
  329. const opDeleteDestination = "DeleteDestination"
  330. // DeleteDestinationRequest generates a "aws/request.Request" representing the
  331. // client's request for the DeleteDestination operation. The "output" return
  332. // value can be used to capture response data after the request's "Send" method
  333. // is called.
  334. //
  335. // See DeleteDestination for usage and error information.
  336. //
  337. // Creating a request object using this method should be used when you want to inject
  338. // custom logic into the request's lifecycle using a custom handler, or if you want to
  339. // access properties on the request object before or after sending the request. If
  340. // you just want the service response, call the DeleteDestination method directly
  341. // instead.
  342. //
  343. // Note: You must call the "Send" method on the returned request object in order
  344. // to execute the request.
  345. //
  346. // // Example sending a request using the DeleteDestinationRequest method.
  347. // req, resp := client.DeleteDestinationRequest(params)
  348. //
  349. // err := req.Send()
  350. // if err == nil { // resp is now filled
  351. // fmt.Println(resp)
  352. // }
  353. //
  354. func (c *CloudWatchLogs) DeleteDestinationRequest(input *DeleteDestinationInput) (req *request.Request, output *DeleteDestinationOutput) {
  355. op := &request.Operation{
  356. Name: opDeleteDestination,
  357. HTTPMethod: "POST",
  358. HTTPPath: "/",
  359. }
  360. if input == nil {
  361. input = &DeleteDestinationInput{}
  362. }
  363. req = c.newRequest(op, input, output)
  364. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  365. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  366. output = &DeleteDestinationOutput{}
  367. req.Data = output
  368. return
  369. }
  370. // DeleteDestination API operation for Amazon CloudWatch Logs.
  371. //
  372. // Deletes the destination with the specified name and eventually disables all
  373. // the subscription filters that publish to it. This will not delete the physical
  374. // resource encapsulated by the destination.
  375. //
  376. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  377. // with awserr.Error's Code and Message methods to get detailed information about
  378. // the error.
  379. //
  380. // See the AWS API reference guide for Amazon CloudWatch Logs's
  381. // API operation DeleteDestination for usage and error information.
  382. //
  383. // Returned Error Codes:
  384. // * InvalidParameterException
  385. // Returned if a parameter of the request is incorrectly specified.
  386. //
  387. // * ResourceNotFoundException
  388. // Returned if the specified resource does not exist.
  389. //
  390. // * OperationAbortedException
  391. // Returned if multiple requests to update the same resource were in conflict.
  392. //
  393. // * ServiceUnavailableException
  394. // Returned if the service cannot complete the request.
  395. //
  396. func (c *CloudWatchLogs) DeleteDestination(input *DeleteDestinationInput) (*DeleteDestinationOutput, error) {
  397. req, out := c.DeleteDestinationRequest(input)
  398. err := req.Send()
  399. return out, err
  400. }
  401. const opDeleteLogGroup = "DeleteLogGroup"
  402. // DeleteLogGroupRequest generates a "aws/request.Request" representing the
  403. // client's request for the DeleteLogGroup operation. The "output" return
  404. // value can be used to capture response data after the request's "Send" method
  405. // is called.
  406. //
  407. // See DeleteLogGroup for usage and error information.
  408. //
  409. // Creating a request object using this method should be used when you want to inject
  410. // custom logic into the request's lifecycle using a custom handler, or if you want to
  411. // access properties on the request object before or after sending the request. If
  412. // you just want the service response, call the DeleteLogGroup method directly
  413. // instead.
  414. //
  415. // Note: You must call the "Send" method on the returned request object in order
  416. // to execute the request.
  417. //
  418. // // Example sending a request using the DeleteLogGroupRequest method.
  419. // req, resp := client.DeleteLogGroupRequest(params)
  420. //
  421. // err := req.Send()
  422. // if err == nil { // resp is now filled
  423. // fmt.Println(resp)
  424. // }
  425. //
  426. func (c *CloudWatchLogs) DeleteLogGroupRequest(input *DeleteLogGroupInput) (req *request.Request, output *DeleteLogGroupOutput) {
  427. op := &request.Operation{
  428. Name: opDeleteLogGroup,
  429. HTTPMethod: "POST",
  430. HTTPPath: "/",
  431. }
  432. if input == nil {
  433. input = &DeleteLogGroupInput{}
  434. }
  435. req = c.newRequest(op, input, output)
  436. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  437. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  438. output = &DeleteLogGroupOutput{}
  439. req.Data = output
  440. return
  441. }
  442. // DeleteLogGroup API operation for Amazon CloudWatch Logs.
  443. //
  444. // Deletes the log group with the specified name and permanently deletes all
  445. // the archived log events associated with it.
  446. //
  447. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  448. // with awserr.Error's Code and Message methods to get detailed information about
  449. // the error.
  450. //
  451. // See the AWS API reference guide for Amazon CloudWatch Logs's
  452. // API operation DeleteLogGroup for usage and error information.
  453. //
  454. // Returned Error Codes:
  455. // * InvalidParameterException
  456. // Returned if a parameter of the request is incorrectly specified.
  457. //
  458. // * ResourceNotFoundException
  459. // Returned if the specified resource does not exist.
  460. //
  461. // * OperationAbortedException
  462. // Returned if multiple requests to update the same resource were in conflict.
  463. //
  464. // * ServiceUnavailableException
  465. // Returned if the service cannot complete the request.
  466. //
  467. func (c *CloudWatchLogs) DeleteLogGroup(input *DeleteLogGroupInput) (*DeleteLogGroupOutput, error) {
  468. req, out := c.DeleteLogGroupRequest(input)
  469. err := req.Send()
  470. return out, err
  471. }
  472. const opDeleteLogStream = "DeleteLogStream"
  473. // DeleteLogStreamRequest generates a "aws/request.Request" representing the
  474. // client's request for the DeleteLogStream operation. The "output" return
  475. // value can be used to capture response data after the request's "Send" method
  476. // is called.
  477. //
  478. // See DeleteLogStream for usage and error information.
  479. //
  480. // Creating a request object using this method should be used when you want to inject
  481. // custom logic into the request's lifecycle using a custom handler, or if you want to
  482. // access properties on the request object before or after sending the request. If
  483. // you just want the service response, call the DeleteLogStream method directly
  484. // instead.
  485. //
  486. // Note: You must call the "Send" method on the returned request object in order
  487. // to execute the request.
  488. //
  489. // // Example sending a request using the DeleteLogStreamRequest method.
  490. // req, resp := client.DeleteLogStreamRequest(params)
  491. //
  492. // err := req.Send()
  493. // if err == nil { // resp is now filled
  494. // fmt.Println(resp)
  495. // }
  496. //
  497. func (c *CloudWatchLogs) DeleteLogStreamRequest(input *DeleteLogStreamInput) (req *request.Request, output *DeleteLogStreamOutput) {
  498. op := &request.Operation{
  499. Name: opDeleteLogStream,
  500. HTTPMethod: "POST",
  501. HTTPPath: "/",
  502. }
  503. if input == nil {
  504. input = &DeleteLogStreamInput{}
  505. }
  506. req = c.newRequest(op, input, output)
  507. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  508. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  509. output = &DeleteLogStreamOutput{}
  510. req.Data = output
  511. return
  512. }
  513. // DeleteLogStream API operation for Amazon CloudWatch Logs.
  514. //
  515. // Deletes a log stream and permanently deletes all the archived log events
  516. // associated with it.
  517. //
  518. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  519. // with awserr.Error's Code and Message methods to get detailed information about
  520. // the error.
  521. //
  522. // See the AWS API reference guide for Amazon CloudWatch Logs's
  523. // API operation DeleteLogStream for usage and error information.
  524. //
  525. // Returned Error Codes:
  526. // * InvalidParameterException
  527. // Returned if a parameter of the request is incorrectly specified.
  528. //
  529. // * ResourceNotFoundException
  530. // Returned if the specified resource does not exist.
  531. //
  532. // * OperationAbortedException
  533. // Returned if multiple requests to update the same resource were in conflict.
  534. //
  535. // * ServiceUnavailableException
  536. // Returned if the service cannot complete the request.
  537. //
  538. func (c *CloudWatchLogs) DeleteLogStream(input *DeleteLogStreamInput) (*DeleteLogStreamOutput, error) {
  539. req, out := c.DeleteLogStreamRequest(input)
  540. err := req.Send()
  541. return out, err
  542. }
  543. const opDeleteMetricFilter = "DeleteMetricFilter"
  544. // DeleteMetricFilterRequest generates a "aws/request.Request" representing the
  545. // client's request for the DeleteMetricFilter operation. The "output" return
  546. // value can be used to capture response data after the request's "Send" method
  547. // is called.
  548. //
  549. // See DeleteMetricFilter for usage and error information.
  550. //
  551. // Creating a request object using this method should be used when you want to inject
  552. // custom logic into the request's lifecycle using a custom handler, or if you want to
  553. // access properties on the request object before or after sending the request. If
  554. // you just want the service response, call the DeleteMetricFilter method directly
  555. // instead.
  556. //
  557. // Note: You must call the "Send" method on the returned request object in order
  558. // to execute the request.
  559. //
  560. // // Example sending a request using the DeleteMetricFilterRequest method.
  561. // req, resp := client.DeleteMetricFilterRequest(params)
  562. //
  563. // err := req.Send()
  564. // if err == nil { // resp is now filled
  565. // fmt.Println(resp)
  566. // }
  567. //
  568. func (c *CloudWatchLogs) DeleteMetricFilterRequest(input *DeleteMetricFilterInput) (req *request.Request, output *DeleteMetricFilterOutput) {
  569. op := &request.Operation{
  570. Name: opDeleteMetricFilter,
  571. HTTPMethod: "POST",
  572. HTTPPath: "/",
  573. }
  574. if input == nil {
  575. input = &DeleteMetricFilterInput{}
  576. }
  577. req = c.newRequest(op, input, output)
  578. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  579. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  580. output = &DeleteMetricFilterOutput{}
  581. req.Data = output
  582. return
  583. }
  584. // DeleteMetricFilter API operation for Amazon CloudWatch Logs.
  585. //
  586. // Deletes a metric filter associated with the specified log group.
  587. //
  588. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  589. // with awserr.Error's Code and Message methods to get detailed information about
  590. // the error.
  591. //
  592. // See the AWS API reference guide for Amazon CloudWatch Logs's
  593. // API operation DeleteMetricFilter for usage and error information.
  594. //
  595. // Returned Error Codes:
  596. // * InvalidParameterException
  597. // Returned if a parameter of the request is incorrectly specified.
  598. //
  599. // * ResourceNotFoundException
  600. // Returned if the specified resource does not exist.
  601. //
  602. // * OperationAbortedException
  603. // Returned if multiple requests to update the same resource were in conflict.
  604. //
  605. // * ServiceUnavailableException
  606. // Returned if the service cannot complete the request.
  607. //
  608. func (c *CloudWatchLogs) DeleteMetricFilter(input *DeleteMetricFilterInput) (*DeleteMetricFilterOutput, error) {
  609. req, out := c.DeleteMetricFilterRequest(input)
  610. err := req.Send()
  611. return out, err
  612. }
  613. const opDeleteRetentionPolicy = "DeleteRetentionPolicy"
  614. // DeleteRetentionPolicyRequest generates a "aws/request.Request" representing the
  615. // client's request for the DeleteRetentionPolicy operation. The "output" return
  616. // value can be used to capture response data after the request's "Send" method
  617. // is called.
  618. //
  619. // See DeleteRetentionPolicy for usage and error information.
  620. //
  621. // Creating a request object using this method should be used when you want to inject
  622. // custom logic into the request's lifecycle using a custom handler, or if you want to
  623. // access properties on the request object before or after sending the request. If
  624. // you just want the service response, call the DeleteRetentionPolicy method directly
  625. // instead.
  626. //
  627. // Note: You must call the "Send" method on the returned request object in order
  628. // to execute the request.
  629. //
  630. // // Example sending a request using the DeleteRetentionPolicyRequest method.
  631. // req, resp := client.DeleteRetentionPolicyRequest(params)
  632. //
  633. // err := req.Send()
  634. // if err == nil { // resp is now filled
  635. // fmt.Println(resp)
  636. // }
  637. //
  638. func (c *CloudWatchLogs) DeleteRetentionPolicyRequest(input *DeleteRetentionPolicyInput) (req *request.Request, output *DeleteRetentionPolicyOutput) {
  639. op := &request.Operation{
  640. Name: opDeleteRetentionPolicy,
  641. HTTPMethod: "POST",
  642. HTTPPath: "/",
  643. }
  644. if input == nil {
  645. input = &DeleteRetentionPolicyInput{}
  646. }
  647. req = c.newRequest(op, input, output)
  648. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  649. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  650. output = &DeleteRetentionPolicyOutput{}
  651. req.Data = output
  652. return
  653. }
  654. // DeleteRetentionPolicy API operation for Amazon CloudWatch Logs.
  655. //
  656. // Deletes the retention policy of the specified log group. Log events would
  657. // not expire if they belong to log groups without a retention policy.
  658. //
  659. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  660. // with awserr.Error's Code and Message methods to get detailed information about
  661. // the error.
  662. //
  663. // See the AWS API reference guide for Amazon CloudWatch Logs's
  664. // API operation DeleteRetentionPolicy for usage and error information.
  665. //
  666. // Returned Error Codes:
  667. // * InvalidParameterException
  668. // Returned if a parameter of the request is incorrectly specified.
  669. //
  670. // * ResourceNotFoundException
  671. // Returned if the specified resource does not exist.
  672. //
  673. // * OperationAbortedException
  674. // Returned if multiple requests to update the same resource were in conflict.
  675. //
  676. // * ServiceUnavailableException
  677. // Returned if the service cannot complete the request.
  678. //
  679. func (c *CloudWatchLogs) DeleteRetentionPolicy(input *DeleteRetentionPolicyInput) (*DeleteRetentionPolicyOutput, error) {
  680. req, out := c.DeleteRetentionPolicyRequest(input)
  681. err := req.Send()
  682. return out, err
  683. }
  684. const opDeleteSubscriptionFilter = "DeleteSubscriptionFilter"
  685. // DeleteSubscriptionFilterRequest generates a "aws/request.Request" representing the
  686. // client's request for the DeleteSubscriptionFilter operation. The "output" return
  687. // value can be used to capture response data after the request's "Send" method
  688. // is called.
  689. //
  690. // See DeleteSubscriptionFilter for usage and error information.
  691. //
  692. // Creating a request object using this method should be used when you want to inject
  693. // custom logic into the request's lifecycle using a custom handler, or if you want to
  694. // access properties on the request object before or after sending the request. If
  695. // you just want the service response, call the DeleteSubscriptionFilter method directly
  696. // instead.
  697. //
  698. // Note: You must call the "Send" method on the returned request object in order
  699. // to execute the request.
  700. //
  701. // // Example sending a request using the DeleteSubscriptionFilterRequest method.
  702. // req, resp := client.DeleteSubscriptionFilterRequest(params)
  703. //
  704. // err := req.Send()
  705. // if err == nil { // resp is now filled
  706. // fmt.Println(resp)
  707. // }
  708. //
  709. func (c *CloudWatchLogs) DeleteSubscriptionFilterRequest(input *DeleteSubscriptionFilterInput) (req *request.Request, output *DeleteSubscriptionFilterOutput) {
  710. op := &request.Operation{
  711. Name: opDeleteSubscriptionFilter,
  712. HTTPMethod: "POST",
  713. HTTPPath: "/",
  714. }
  715. if input == nil {
  716. input = &DeleteSubscriptionFilterInput{}
  717. }
  718. req = c.newRequest(op, input, output)
  719. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  720. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  721. output = &DeleteSubscriptionFilterOutput{}
  722. req.Data = output
  723. return
  724. }
  725. // DeleteSubscriptionFilter API operation for Amazon CloudWatch Logs.
  726. //
  727. // Deletes a subscription filter associated with the specified log group.
  728. //
  729. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  730. // with awserr.Error's Code and Message methods to get detailed information about
  731. // the error.
  732. //
  733. // See the AWS API reference guide for Amazon CloudWatch Logs's
  734. // API operation DeleteSubscriptionFilter for usage and error information.
  735. //
  736. // Returned Error Codes:
  737. // * InvalidParameterException
  738. // Returned if a parameter of the request is incorrectly specified.
  739. //
  740. // * ResourceNotFoundException
  741. // Returned if the specified resource does not exist.
  742. //
  743. // * OperationAbortedException
  744. // Returned if multiple requests to update the same resource were in conflict.
  745. //
  746. // * ServiceUnavailableException
  747. // Returned if the service cannot complete the request.
  748. //
  749. func (c *CloudWatchLogs) DeleteSubscriptionFilter(input *DeleteSubscriptionFilterInput) (*DeleteSubscriptionFilterOutput, error) {
  750. req, out := c.DeleteSubscriptionFilterRequest(input)
  751. err := req.Send()
  752. return out, err
  753. }
  754. const opDescribeDestinations = "DescribeDestinations"
  755. // DescribeDestinationsRequest generates a "aws/request.Request" representing the
  756. // client's request for the DescribeDestinations operation. The "output" return
  757. // value can be used to capture response data after the request's "Send" method
  758. // is called.
  759. //
  760. // See DescribeDestinations for usage and error information.
  761. //
  762. // Creating a request object using this method should be used when you want to inject
  763. // custom logic into the request's lifecycle using a custom handler, or if you want to
  764. // access properties on the request object before or after sending the request. If
  765. // you just want the service response, call the DescribeDestinations method directly
  766. // instead.
  767. //
  768. // Note: You must call the "Send" method on the returned request object in order
  769. // to execute the request.
  770. //
  771. // // Example sending a request using the DescribeDestinationsRequest method.
  772. // req, resp := client.DescribeDestinationsRequest(params)
  773. //
  774. // err := req.Send()
  775. // if err == nil { // resp is now filled
  776. // fmt.Println(resp)
  777. // }
  778. //
  779. func (c *CloudWatchLogs) DescribeDestinationsRequest(input *DescribeDestinationsInput) (req *request.Request, output *DescribeDestinationsOutput) {
  780. op := &request.Operation{
  781. Name: opDescribeDestinations,
  782. HTTPMethod: "POST",
  783. HTTPPath: "/",
  784. Paginator: &request.Paginator{
  785. InputTokens: []string{"nextToken"},
  786. OutputTokens: []string{"nextToken"},
  787. LimitToken: "limit",
  788. TruncationToken: "",
  789. },
  790. }
  791. if input == nil {
  792. input = &DescribeDestinationsInput{}
  793. }
  794. req = c.newRequest(op, input, output)
  795. output = &DescribeDestinationsOutput{}
  796. req.Data = output
  797. return
  798. }
  799. // DescribeDestinations API operation for Amazon CloudWatch Logs.
  800. //
  801. // Returns all the destinations that are associated with the AWS account making
  802. // the request. The list returned in the response is ASCII-sorted by destination
  803. // name.
  804. //
  805. // By default, this operation returns up to 50 destinations. If there are more
  806. // destinations to list, the response would contain a nextToken value in the
  807. // response body. You can also limit the number of destinations returned in
  808. // the response by specifying the limit parameter in the request.
  809. //
  810. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  811. // with awserr.Error's Code and Message methods to get detailed information about
  812. // the error.
  813. //
  814. // See the AWS API reference guide for Amazon CloudWatch Logs's
  815. // API operation DescribeDestinations for usage and error information.
  816. //
  817. // Returned Error Codes:
  818. // * InvalidParameterException
  819. // Returned if a parameter of the request is incorrectly specified.
  820. //
  821. // * ServiceUnavailableException
  822. // Returned if the service cannot complete the request.
  823. //
  824. func (c *CloudWatchLogs) DescribeDestinations(input *DescribeDestinationsInput) (*DescribeDestinationsOutput, error) {
  825. req, out := c.DescribeDestinationsRequest(input)
  826. err := req.Send()
  827. return out, err
  828. }
  829. // DescribeDestinationsPages iterates over the pages of a DescribeDestinations operation,
  830. // calling the "fn" function with the response data for each page. To stop
  831. // iterating, return false from the fn function.
  832. //
  833. // See DescribeDestinations method for more information on how to use this operation.
  834. //
  835. // Note: This operation can generate multiple requests to a service.
  836. //
  837. // // Example iterating over at most 3 pages of a DescribeDestinations operation.
  838. // pageNum := 0
  839. // err := client.DescribeDestinationsPages(params,
  840. // func(page *DescribeDestinationsOutput, lastPage bool) bool {
  841. // pageNum++
  842. // fmt.Println(page)
  843. // return pageNum <= 3
  844. // })
  845. //
  846. func (c *CloudWatchLogs) DescribeDestinationsPages(input *DescribeDestinationsInput, fn func(p *DescribeDestinationsOutput, lastPage bool) (shouldContinue bool)) error {
  847. page, _ := c.DescribeDestinationsRequest(input)
  848. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  849. return page.EachPage(func(p interface{}, lastPage bool) bool {
  850. return fn(p.(*DescribeDestinationsOutput), lastPage)
  851. })
  852. }
  853. const opDescribeExportTasks = "DescribeExportTasks"
  854. // DescribeExportTasksRequest generates a "aws/request.Request" representing the
  855. // client's request for the DescribeExportTasks operation. The "output" return
  856. // value can be used to capture response data after the request's "Send" method
  857. // is called.
  858. //
  859. // See DescribeExportTasks for usage and error information.
  860. //
  861. // Creating a request object using this method should be used when you want to inject
  862. // custom logic into the request's lifecycle using a custom handler, or if you want to
  863. // access properties on the request object before or after sending the request. If
  864. // you just want the service response, call the DescribeExportTasks method directly
  865. // instead.
  866. //
  867. // Note: You must call the "Send" method on the returned request object in order
  868. // to execute the request.
  869. //
  870. // // Example sending a request using the DescribeExportTasksRequest method.
  871. // req, resp := client.DescribeExportTasksRequest(params)
  872. //
  873. // err := req.Send()
  874. // if err == nil { // resp is now filled
  875. // fmt.Println(resp)
  876. // }
  877. //
  878. func (c *CloudWatchLogs) DescribeExportTasksRequest(input *DescribeExportTasksInput) (req *request.Request, output *DescribeExportTasksOutput) {
  879. op := &request.Operation{
  880. Name: opDescribeExportTasks,
  881. HTTPMethod: "POST",
  882. HTTPPath: "/",
  883. }
  884. if input == nil {
  885. input = &DescribeExportTasksInput{}
  886. }
  887. req = c.newRequest(op, input, output)
  888. output = &DescribeExportTasksOutput{}
  889. req.Data = output
  890. return
  891. }
  892. // DescribeExportTasks API operation for Amazon CloudWatch Logs.
  893. //
  894. // Returns all the export tasks that are associated with the AWS account making
  895. // the request. The export tasks can be filtered based on TaskId or TaskStatus.
  896. //
  897. // By default, this operation returns up to 50 export tasks that satisfy the
  898. // specified filters. If there are more export tasks to list, the response would
  899. // contain a nextToken value in the response body. You can also limit the number
  900. // of export tasks returned in the response by specifying the limit parameter
  901. // in the request.
  902. //
  903. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  904. // with awserr.Error's Code and Message methods to get detailed information about
  905. // the error.
  906. //
  907. // See the AWS API reference guide for Amazon CloudWatch Logs's
  908. // API operation DescribeExportTasks for usage and error information.
  909. //
  910. // Returned Error Codes:
  911. // * InvalidParameterException
  912. // Returned if a parameter of the request is incorrectly specified.
  913. //
  914. // * ServiceUnavailableException
  915. // Returned if the service cannot complete the request.
  916. //
  917. func (c *CloudWatchLogs) DescribeExportTasks(input *DescribeExportTasksInput) (*DescribeExportTasksOutput, error) {
  918. req, out := c.DescribeExportTasksRequest(input)
  919. err := req.Send()
  920. return out, err
  921. }
  922. const opDescribeLogGroups = "DescribeLogGroups"
  923. // DescribeLogGroupsRequest generates a "aws/request.Request" representing the
  924. // client's request for the DescribeLogGroups operation. The "output" return
  925. // value can be used to capture response data after the request's "Send" method
  926. // is called.
  927. //
  928. // See DescribeLogGroups for usage and error information.
  929. //
  930. // Creating a request object using this method should be used when you want to inject
  931. // custom logic into the request's lifecycle using a custom handler, or if you want to
  932. // access properties on the request object before or after sending the request. If
  933. // you just want the service response, call the DescribeLogGroups method directly
  934. // instead.
  935. //
  936. // Note: You must call the "Send" method on the returned request object in order
  937. // to execute the request.
  938. //
  939. // // Example sending a request using the DescribeLogGroupsRequest method.
  940. // req, resp := client.DescribeLogGroupsRequest(params)
  941. //
  942. // err := req.Send()
  943. // if err == nil { // resp is now filled
  944. // fmt.Println(resp)
  945. // }
  946. //
  947. func (c *CloudWatchLogs) DescribeLogGroupsRequest(input *DescribeLogGroupsInput) (req *request.Request, output *DescribeLogGroupsOutput) {
  948. op := &request.Operation{
  949. Name: opDescribeLogGroups,
  950. HTTPMethod: "POST",
  951. HTTPPath: "/",
  952. Paginator: &request.Paginator{
  953. InputTokens: []string{"nextToken"},
  954. OutputTokens: []string{"nextToken"},
  955. LimitToken: "limit",
  956. TruncationToken: "",
  957. },
  958. }
  959. if input == nil {
  960. input = &DescribeLogGroupsInput{}
  961. }
  962. req = c.newRequest(op, input, output)
  963. output = &DescribeLogGroupsOutput{}
  964. req.Data = output
  965. return
  966. }
  967. // DescribeLogGroups API operation for Amazon CloudWatch Logs.
  968. //
  969. // Returns all the log groups that are associated with the AWS account making
  970. // the request. The list returned in the response is ASCII-sorted by log group
  971. // name.
  972. //
  973. // By default, this operation returns up to 50 log groups. If there are more
  974. // log groups to list, the response would contain a nextToken value in the response
  975. // body. You can also limit the number of log groups returned in the response
  976. // by specifying the limit parameter in the request.
  977. //
  978. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  979. // with awserr.Error's Code and Message methods to get detailed information about
  980. // the error.
  981. //
  982. // See the AWS API reference guide for Amazon CloudWatch Logs's
  983. // API operation DescribeLogGroups for usage and error information.
  984. //
  985. // Returned Error Codes:
  986. // * InvalidParameterException
  987. // Returned if a parameter of the request is incorrectly specified.
  988. //
  989. // * ServiceUnavailableException
  990. // Returned if the service cannot complete the request.
  991. //
  992. func (c *CloudWatchLogs) DescribeLogGroups(input *DescribeLogGroupsInput) (*DescribeLogGroupsOutput, error) {
  993. req, out := c.DescribeLogGroupsRequest(input)
  994. err := req.Send()
  995. return out, err
  996. }
  997. // DescribeLogGroupsPages iterates over the pages of a DescribeLogGroups operation,
  998. // calling the "fn" function with the response data for each page. To stop
  999. // iterating, return false from the fn function.
  1000. //
  1001. // See DescribeLogGroups method for more information on how to use this operation.
  1002. //
  1003. // Note: This operation can generate multiple requests to a service.
  1004. //
  1005. // // Example iterating over at most 3 pages of a DescribeLogGroups operation.
  1006. // pageNum := 0
  1007. // err := client.DescribeLogGroupsPages(params,
  1008. // func(page *DescribeLogGroupsOutput, lastPage bool) bool {
  1009. // pageNum++
  1010. // fmt.Println(page)
  1011. // return pageNum <= 3
  1012. // })
  1013. //
  1014. func (c *CloudWatchLogs) DescribeLogGroupsPages(input *DescribeLogGroupsInput, fn func(p *DescribeLogGroupsOutput, lastPage bool) (shouldContinue bool)) error {
  1015. page, _ := c.DescribeLogGroupsRequest(input)
  1016. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  1017. return page.EachPage(func(p interface{}, lastPage bool) bool {
  1018. return fn(p.(*DescribeLogGroupsOutput), lastPage)
  1019. })
  1020. }
  1021. const opDescribeLogStreams = "DescribeLogStreams"
  1022. // DescribeLogStreamsRequest generates a "aws/request.Request" representing the
  1023. // client's request for the DescribeLogStreams operation. The "output" return
  1024. // value can be used to capture response data after the request's "Send" method
  1025. // is called.
  1026. //
  1027. // See DescribeLogStreams for usage and error information.
  1028. //
  1029. // Creating a request object using this method should be used when you want to inject
  1030. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1031. // access properties on the request object before or after sending the request. If
  1032. // you just want the service response, call the DescribeLogStreams method directly
  1033. // instead.
  1034. //
  1035. // Note: You must call the "Send" method on the returned request object in order
  1036. // to execute the request.
  1037. //
  1038. // // Example sending a request using the DescribeLogStreamsRequest method.
  1039. // req, resp := client.DescribeLogStreamsRequest(params)
  1040. //
  1041. // err := req.Send()
  1042. // if err == nil { // resp is now filled
  1043. // fmt.Println(resp)
  1044. // }
  1045. //
  1046. func (c *CloudWatchLogs) DescribeLogStreamsRequest(input *DescribeLogStreamsInput) (req *request.Request, output *DescribeLogStreamsOutput) {
  1047. op := &request.Operation{
  1048. Name: opDescribeLogStreams,
  1049. HTTPMethod: "POST",
  1050. HTTPPath: "/",
  1051. Paginator: &request.Paginator{
  1052. InputTokens: []string{"nextToken"},
  1053. OutputTokens: []string{"nextToken"},
  1054. LimitToken: "limit",
  1055. TruncationToken: "",
  1056. },
  1057. }
  1058. if input == nil {
  1059. input = &DescribeLogStreamsInput{}
  1060. }
  1061. req = c.newRequest(op, input, output)
  1062. output = &DescribeLogStreamsOutput{}
  1063. req.Data = output
  1064. return
  1065. }
  1066. // DescribeLogStreams API operation for Amazon CloudWatch Logs.
  1067. //
  1068. // Returns all the log streams that are associated with the specified log group.
  1069. // The list returned in the response is ASCII-sorted by log stream name.
  1070. //
  1071. // By default, this operation returns up to 50 log streams. If there are more
  1072. // log streams to list, the response would contain a nextToken value in the
  1073. // response body. You can also limit the number of log streams returned in the
  1074. // response by specifying the limit parameter in the request. This operation
  1075. // has a limit of five transactions per second, after which transactions are
  1076. // throttled.
  1077. //
  1078. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1079. // with awserr.Error's Code and Message methods to get detailed information about
  1080. // the error.
  1081. //
  1082. // See the AWS API reference guide for Amazon CloudWatch Logs's
  1083. // API operation DescribeLogStreams for usage and error information.
  1084. //
  1085. // Returned Error Codes:
  1086. // * InvalidParameterException
  1087. // Returned if a parameter of the request is incorrectly specified.
  1088. //
  1089. // * ResourceNotFoundException
  1090. // Returned if the specified resource does not exist.
  1091. //
  1092. // * ServiceUnavailableException
  1093. // Returned if the service cannot complete the request.
  1094. //
  1095. func (c *CloudWatchLogs) DescribeLogStreams(input *DescribeLogStreamsInput) (*DescribeLogStreamsOutput, error) {
  1096. req, out := c.DescribeLogStreamsRequest(input)
  1097. err := req.Send()
  1098. return out, err
  1099. }
  1100. // DescribeLogStreamsPages iterates over the pages of a DescribeLogStreams operation,
  1101. // calling the "fn" function with the response data for each page. To stop
  1102. // iterating, return false from the fn function.
  1103. //
  1104. // See DescribeLogStreams method for more information on how to use this operation.
  1105. //
  1106. // Note: This operation can generate multiple requests to a service.
  1107. //
  1108. // // Example iterating over at most 3 pages of a DescribeLogStreams operation.
  1109. // pageNum := 0
  1110. // err := client.DescribeLogStreamsPages(params,
  1111. // func(page *DescribeLogStreamsOutput, lastPage bool) bool {
  1112. // pageNum++
  1113. // fmt.Println(page)
  1114. // return pageNum <= 3
  1115. // })
  1116. //
  1117. func (c *CloudWatchLogs) DescribeLogStreamsPages(input *DescribeLogStreamsInput, fn func(p *DescribeLogStreamsOutput, lastPage bool) (shouldContinue bool)) error {
  1118. page, _ := c.DescribeLogStreamsRequest(input)
  1119. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  1120. return page.EachPage(func(p interface{}, lastPage bool) bool {
  1121. return fn(p.(*DescribeLogStreamsOutput), lastPage)
  1122. })
  1123. }
  1124. const opDescribeMetricFilters = "DescribeMetricFilters"
  1125. // DescribeMetricFiltersRequest generates a "aws/request.Request" representing the
  1126. // client's request for the DescribeMetricFilters operation. The "output" return
  1127. // value can be used to capture response data after the request's "Send" method
  1128. // is called.
  1129. //
  1130. // See DescribeMetricFilters for usage and error information.
  1131. //
  1132. // Creating a request object using this method should be used when you want to inject
  1133. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1134. // access properties on the request object before or after sending the request. If
  1135. // you just want the service response, call the DescribeMetricFilters method directly
  1136. // instead.
  1137. //
  1138. // Note: You must call the "Send" method on the returned request object in order
  1139. // to execute the request.
  1140. //
  1141. // // Example sending a request using the DescribeMetricFiltersRequest method.
  1142. // req, resp := client.DescribeMetricFiltersRequest(params)
  1143. //
  1144. // err := req.Send()
  1145. // if err == nil { // resp is now filled
  1146. // fmt.Println(resp)
  1147. // }
  1148. //
  1149. func (c *CloudWatchLogs) DescribeMetricFiltersRequest(input *DescribeMetricFiltersInput) (req *request.Request, output *DescribeMetricFiltersOutput) {
  1150. op := &request.Operation{
  1151. Name: opDescribeMetricFilters,
  1152. HTTPMethod: "POST",
  1153. HTTPPath: "/",
  1154. Paginator: &request.Paginator{
  1155. InputTokens: []string{"nextToken"},
  1156. OutputTokens: []string{"nextToken"},
  1157. LimitToken: "limit",
  1158. TruncationToken: "",
  1159. },
  1160. }
  1161. if input == nil {
  1162. input = &DescribeMetricFiltersInput{}
  1163. }
  1164. req = c.newRequest(op, input, output)
  1165. output = &DescribeMetricFiltersOutput{}
  1166. req.Data = output
  1167. return
  1168. }
  1169. // DescribeMetricFilters API operation for Amazon CloudWatch Logs.
  1170. //
  1171. // Returns all the metrics filters associated with the specified log group.
  1172. // The list returned in the response is ASCII-sorted by filter name.
  1173. //
  1174. // By default, this operation returns up to 50 metric filters. If there are
  1175. // more metric filters to list, the response would contain a nextToken value
  1176. // in the response body. You can also limit the number of metric filters returned
  1177. // in the response by specifying the limit parameter in the request.
  1178. //
  1179. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1180. // with awserr.Error's Code and Message methods to get detailed information about
  1181. // the error.
  1182. //
  1183. // See the AWS API reference guide for Amazon CloudWatch Logs's
  1184. // API operation DescribeMetricFilters for usage and error information.
  1185. //
  1186. // Returned Error Codes:
  1187. // * InvalidParameterException
  1188. // Returned if a parameter of the request is incorrectly specified.
  1189. //
  1190. // * ResourceNotFoundException
  1191. // Returned if the specified resource does not exist.
  1192. //
  1193. // * ServiceUnavailableException
  1194. // Returned if the service cannot complete the request.
  1195. //
  1196. func (c *CloudWatchLogs) DescribeMetricFilters(input *DescribeMetricFiltersInput) (*DescribeMetricFiltersOutput, error) {
  1197. req, out := c.DescribeMetricFiltersRequest(input)
  1198. err := req.Send()
  1199. return out, err
  1200. }
  1201. // DescribeMetricFiltersPages iterates over the pages of a DescribeMetricFilters operation,
  1202. // calling the "fn" function with the response data for each page. To stop
  1203. // iterating, return false from the fn function.
  1204. //
  1205. // See DescribeMetricFilters method for more information on how to use this operation.
  1206. //
  1207. // Note: This operation can generate multiple requests to a service.
  1208. //
  1209. // // Example iterating over at most 3 pages of a DescribeMetricFilters operation.
  1210. // pageNum := 0
  1211. // err := client.DescribeMetricFiltersPages(params,
  1212. // func(page *DescribeMetricFiltersOutput, lastPage bool) bool {
  1213. // pageNum++
  1214. // fmt.Println(page)
  1215. // return pageNum <= 3
  1216. // })
  1217. //
  1218. func (c *CloudWatchLogs) DescribeMetricFiltersPages(input *DescribeMetricFiltersInput, fn func(p *DescribeMetricFiltersOutput, lastPage bool) (shouldContinue bool)) error {
  1219. page, _ := c.DescribeMetricFiltersRequest(input)
  1220. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  1221. return page.EachPage(func(p interface{}, lastPage bool) bool {
  1222. return fn(p.(*DescribeMetricFiltersOutput), lastPage)
  1223. })
  1224. }
  1225. const opDescribeSubscriptionFilters = "DescribeSubscriptionFilters"
  1226. // DescribeSubscriptionFiltersRequest generates a "aws/request.Request" representing the
  1227. // client's request for the DescribeSubscriptionFilters operation. The "output" return
  1228. // value can be used to capture response data after the request's "Send" method
  1229. // is called.
  1230. //
  1231. // See DescribeSubscriptionFilters for usage and error information.
  1232. //
  1233. // Creating a request object using this method should be used when you want to inject
  1234. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1235. // access properties on the request object before or after sending the request. If
  1236. // you just want the service response, call the DescribeSubscriptionFilters method directly
  1237. // instead.
  1238. //
  1239. // Note: You must call the "Send" method on the returned request object in order
  1240. // to execute the request.
  1241. //
  1242. // // Example sending a request using the DescribeSubscriptionFiltersRequest method.
  1243. // req, resp := client.DescribeSubscriptionFiltersRequest(params)
  1244. //
  1245. // err := req.Send()
  1246. // if err == nil { // resp is now filled
  1247. // fmt.Println(resp)
  1248. // }
  1249. //
  1250. func (c *CloudWatchLogs) DescribeSubscriptionFiltersRequest(input *DescribeSubscriptionFiltersInput) (req *request.Request, output *DescribeSubscriptionFiltersOutput) {
  1251. op := &request.Operation{
  1252. Name: opDescribeSubscriptionFilters,
  1253. HTTPMethod: "POST",
  1254. HTTPPath: "/",
  1255. Paginator: &request.Paginator{
  1256. InputTokens: []string{"nextToken"},
  1257. OutputTokens: []string{"nextToken"},
  1258. LimitToken: "limit",
  1259. TruncationToken: "",
  1260. },
  1261. }
  1262. if input == nil {
  1263. input = &DescribeSubscriptionFiltersInput{}
  1264. }
  1265. req = c.newRequest(op, input, output)
  1266. output = &DescribeSubscriptionFiltersOutput{}
  1267. req.Data = output
  1268. return
  1269. }
  1270. // DescribeSubscriptionFilters API operation for Amazon CloudWatch Logs.
  1271. //
  1272. // Returns all the subscription filters associated with the specified log group.
  1273. // The list returned in the response is ASCII-sorted by filter name.
  1274. //
  1275. // By default, this operation returns up to 50 subscription filters. If there
  1276. // are more subscription filters to list, the response would contain a nextToken
  1277. // value in the response body. You can also limit the number of subscription
  1278. // filters returned in the response by specifying the limit parameter in the
  1279. // request.
  1280. //
  1281. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1282. // with awserr.Error's Code and Message methods to get detailed information about
  1283. // the error.
  1284. //
  1285. // See the AWS API reference guide for Amazon CloudWatch Logs's
  1286. // API operation DescribeSubscriptionFilters for usage and error information.
  1287. //
  1288. // Returned Error Codes:
  1289. // * InvalidParameterException
  1290. // Returned if a parameter of the request is incorrectly specified.
  1291. //
  1292. // * ResourceNotFoundException
  1293. // Returned if the specified resource does not exist.
  1294. //
  1295. // * ServiceUnavailableException
  1296. // Returned if the service cannot complete the request.
  1297. //
  1298. func (c *CloudWatchLogs) DescribeSubscriptionFilters(input *DescribeSubscriptionFiltersInput) (*DescribeSubscriptionFiltersOutput, error) {
  1299. req, out := c.DescribeSubscriptionFiltersRequest(input)
  1300. err := req.Send()
  1301. return out, err
  1302. }
  1303. // DescribeSubscriptionFiltersPages iterates over the pages of a DescribeSubscriptionFilters operation,
  1304. // calling the "fn" function with the response data for each page. To stop
  1305. // iterating, return false from the fn function.
  1306. //
  1307. // See DescribeSubscriptionFilters method for more information on how to use this operation.
  1308. //
  1309. // Note: This operation can generate multiple requests to a service.
  1310. //
  1311. // // Example iterating over at most 3 pages of a DescribeSubscriptionFilters operation.
  1312. // pageNum := 0
  1313. // err := client.DescribeSubscriptionFiltersPages(params,
  1314. // func(page *DescribeSubscriptionFiltersOutput, lastPage bool) bool {
  1315. // pageNum++
  1316. // fmt.Println(page)
  1317. // return pageNum <= 3
  1318. // })
  1319. //
  1320. func (c *CloudWatchLogs) DescribeSubscriptionFiltersPages(input *DescribeSubscriptionFiltersInput, fn func(p *DescribeSubscriptionFiltersOutput, lastPage bool) (shouldContinue bool)) error {
  1321. page, _ := c.DescribeSubscriptionFiltersRequest(input)
  1322. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  1323. return page.EachPage(func(p interface{}, lastPage bool) bool {
  1324. return fn(p.(*DescribeSubscriptionFiltersOutput), lastPage)
  1325. })
  1326. }
  1327. const opFilterLogEvents = "FilterLogEvents"
  1328. // FilterLogEventsRequest generates a "aws/request.Request" representing the
  1329. // client's request for the FilterLogEvents operation. The "output" return
  1330. // value can be used to capture response data after the request's "Send" method
  1331. // is called.
  1332. //
  1333. // See FilterLogEvents for usage and error information.
  1334. //
  1335. // Creating a request object using this method should be used when you want to inject
  1336. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1337. // access properties on the request object before or after sending the request. If
  1338. // you just want the service response, call the FilterLogEvents method directly
  1339. // instead.
  1340. //
  1341. // Note: You must call the "Send" method on the returned request object in order
  1342. // to execute the request.
  1343. //
  1344. // // Example sending a request using the FilterLogEventsRequest method.
  1345. // req, resp := client.FilterLogEventsRequest(params)
  1346. //
  1347. // err := req.Send()
  1348. // if err == nil { // resp is now filled
  1349. // fmt.Println(resp)
  1350. // }
  1351. //
  1352. func (c *CloudWatchLogs) FilterLogEventsRequest(input *FilterLogEventsInput) (req *request.Request, output *FilterLogEventsOutput) {
  1353. op := &request.Operation{
  1354. Name: opFilterLogEvents,
  1355. HTTPMethod: "POST",
  1356. HTTPPath: "/",
  1357. Paginator: &request.Paginator{
  1358. InputTokens: []string{"nextToken"},
  1359. OutputTokens: []string{"nextToken"},
  1360. LimitToken: "limit",
  1361. TruncationToken: "",
  1362. },
  1363. }
  1364. if input == nil {
  1365. input = &FilterLogEventsInput{}
  1366. }
  1367. req = c.newRequest(op, input, output)
  1368. output = &FilterLogEventsOutput{}
  1369. req.Data = output
  1370. return
  1371. }
  1372. // FilterLogEvents API operation for Amazon CloudWatch Logs.
  1373. //
  1374. // Retrieves log events, optionally filtered by a filter pattern from the specified
  1375. // log group. You can provide an optional time range to filter the results on
  1376. // the event timestamp. You can limit the streams searched to an explicit list
  1377. // of logStreamNames.
  1378. //
  1379. // By default, this operation returns as much matching log events as can fit
  1380. // in a response size of 1MB, up to 10,000 log events, or all the events found
  1381. // within a time-bounded scan window. If the response includes a nextToken,
  1382. // then there is more data to search, and the search can be resumed with a new
  1383. // request providing the nextToken. The response will contain a list of searchedLogStreams
  1384. // that contains information about which streams were searched in the request
  1385. // and whether they have been searched completely or require further pagination.
  1386. // The limit parameter in the request can be used to specify the maximum number
  1387. // of events to return in a page.
  1388. //
  1389. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1390. // with awserr.Error's Code and Message methods to get detailed information about
  1391. // the error.
  1392. //
  1393. // See the AWS API reference guide for Amazon CloudWatch Logs's
  1394. // API operation FilterLogEvents for usage and error information.
  1395. //
  1396. // Returned Error Codes:
  1397. // * InvalidParameterException
  1398. // Returned if a parameter of the request is incorrectly specified.
  1399. //
  1400. // * ResourceNotFoundException
  1401. // Returned if the specified resource does not exist.
  1402. //
  1403. // * ServiceUnavailableException
  1404. // Returned if the service cannot complete the request.
  1405. //
  1406. func (c *CloudWatchLogs) FilterLogEvents(input *FilterLogEventsInput) (*FilterLogEventsOutput, error) {
  1407. req, out := c.FilterLogEventsRequest(input)
  1408. err := req.Send()
  1409. return out, err
  1410. }
  1411. // FilterLogEventsPages iterates over the pages of a FilterLogEvents operation,
  1412. // calling the "fn" function with the response data for each page. To stop
  1413. // iterating, return false from the fn function.
  1414. //
  1415. // See FilterLogEvents method for more information on how to use this operation.
  1416. //
  1417. // Note: This operation can generate multiple requests to a service.
  1418. //
  1419. // // Example iterating over at most 3 pages of a FilterLogEvents operation.
  1420. // pageNum := 0
  1421. // err := client.FilterLogEventsPages(params,
  1422. // func(page *FilterLogEventsOutput, lastPage bool) bool {
  1423. // pageNum++
  1424. // fmt.Println(page)
  1425. // return pageNum <= 3
  1426. // })
  1427. //
  1428. func (c *CloudWatchLogs) FilterLogEventsPages(input *FilterLogEventsInput, fn func(p *FilterLogEventsOutput, lastPage bool) (shouldContinue bool)) error {
  1429. page, _ := c.FilterLogEventsRequest(input)
  1430. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  1431. return page.EachPage(func(p interface{}, lastPage bool) bool {
  1432. return fn(p.(*FilterLogEventsOutput), lastPage)
  1433. })
  1434. }
  1435. const opGetLogEvents = "GetLogEvents"
  1436. // GetLogEventsRequest generates a "aws/request.Request" representing the
  1437. // client's request for the GetLogEvents operation. The "output" return
  1438. // value can be used to capture response data after the request's "Send" method
  1439. // is called.
  1440. //
  1441. // See GetLogEvents for usage and error information.
  1442. //
  1443. // Creating a request object using this method should be used when you want to inject
  1444. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1445. // access properties on the request object before or after sending the request. If
  1446. // you just want the service response, call the GetLogEvents method directly
  1447. // instead.
  1448. //
  1449. // Note: You must call the "Send" method on the returned request object in order
  1450. // to execute the request.
  1451. //
  1452. // // Example sending a request using the GetLogEventsRequest method.
  1453. // req, resp := client.GetLogEventsRequest(params)
  1454. //
  1455. // err := req.Send()
  1456. // if err == nil { // resp is now filled
  1457. // fmt.Println(resp)
  1458. // }
  1459. //
  1460. func (c *CloudWatchLogs) GetLogEventsRequest(input *GetLogEventsInput) (req *request.Request, output *GetLogEventsOutput) {
  1461. op := &request.Operation{
  1462. Name: opGetLogEvents,
  1463. HTTPMethod: "POST",
  1464. HTTPPath: "/",
  1465. Paginator: &request.Paginator{
  1466. InputTokens: []string{"nextToken"},
  1467. OutputTokens: []string{"nextForwardToken"},
  1468. LimitToken: "limit",
  1469. TruncationToken: "",
  1470. },
  1471. }
  1472. if input == nil {
  1473. input = &GetLogEventsInput{}
  1474. }
  1475. req = c.newRequest(op, input, output)
  1476. output = &GetLogEventsOutput{}
  1477. req.Data = output
  1478. return
  1479. }
  1480. // GetLogEvents API operation for Amazon CloudWatch Logs.
  1481. //
  1482. // Retrieves log events from the specified log stream. You can provide an optional
  1483. // time range to filter the results on the event timestamp.
  1484. //
  1485. // By default, this operation returns as much log events as can fit in a response
  1486. // size of 1MB, up to 10,000 log events. The response will always include a
  1487. // nextForwardToken and a nextBackwardToken in the response body. You can use
  1488. // any of these tokens in subsequent GetLogEvents requests to paginate through
  1489. // events in either forward or backward direction. You can also limit the number
  1490. // of log events returned in the response by specifying the limit parameter
  1491. // in the request.
  1492. //
  1493. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1494. // with awserr.Error's Code and Message methods to get detailed information about
  1495. // the error.
  1496. //
  1497. // See the AWS API reference guide for Amazon CloudWatch Logs's
  1498. // API operation GetLogEvents for usage and error information.
  1499. //
  1500. // Returned Error Codes:
  1501. // * InvalidParameterException
  1502. // Returned if a parameter of the request is incorrectly specified.
  1503. //
  1504. // * ResourceNotFoundException
  1505. // Returned if the specified resource does not exist.
  1506. //
  1507. // * ServiceUnavailableException
  1508. // Returned if the service cannot complete the request.
  1509. //
  1510. func (c *CloudWatchLogs) GetLogEvents(input *GetLogEventsInput) (*GetLogEventsOutput, error) {
  1511. req, out := c.GetLogEventsRequest(input)
  1512. err := req.Send()
  1513. return out, err
  1514. }
  1515. // GetLogEventsPages iterates over the pages of a GetLogEvents operation,
  1516. // calling the "fn" function with the response data for each page. To stop
  1517. // iterating, return false from the fn function.
  1518. //
  1519. // See GetLogEvents method for more information on how to use this operation.
  1520. //
  1521. // Note: This operation can generate multiple requests to a service.
  1522. //
  1523. // // Example iterating over at most 3 pages of a GetLogEvents operation.
  1524. // pageNum := 0
  1525. // err := client.GetLogEventsPages(params,
  1526. // func(page *GetLogEventsOutput, lastPage bool) bool {
  1527. // pageNum++
  1528. // fmt.Println(page)
  1529. // return pageNum <= 3
  1530. // })
  1531. //
  1532. func (c *CloudWatchLogs) GetLogEventsPages(input *GetLogEventsInput, fn func(p *GetLogEventsOutput, lastPage bool) (shouldContinue bool)) error {
  1533. page, _ := c.GetLogEventsRequest(input)
  1534. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  1535. return page.EachPage(func(p interface{}, lastPage bool) bool {
  1536. return fn(p.(*GetLogEventsOutput), lastPage)
  1537. })
  1538. }
  1539. const opPutDestination = "PutDestination"
  1540. // PutDestinationRequest generates a "aws/request.Request" representing the
  1541. // client's request for the PutDestination operation. The "output" return
  1542. // value can be used to capture response data after the request's "Send" method
  1543. // is called.
  1544. //
  1545. // See PutDestination for usage and error information.
  1546. //
  1547. // Creating a request object using this method should be used when you want to inject
  1548. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1549. // access properties on the request object before or after sending the request. If
  1550. // you just want the service response, call the PutDestination method directly
  1551. // instead.
  1552. //
  1553. // Note: You must call the "Send" method on the returned request object in order
  1554. // to execute the request.
  1555. //
  1556. // // Example sending a request using the PutDestinationRequest method.
  1557. // req, resp := client.PutDestinationRequest(params)
  1558. //
  1559. // err := req.Send()
  1560. // if err == nil { // resp is now filled
  1561. // fmt.Println(resp)
  1562. // }
  1563. //
  1564. func (c *CloudWatchLogs) PutDestinationRequest(input *PutDestinationInput) (req *request.Request, output *PutDestinationOutput) {
  1565. op := &request.Operation{
  1566. Name: opPutDestination,
  1567. HTTPMethod: "POST",
  1568. HTTPPath: "/",
  1569. }
  1570. if input == nil {
  1571. input = &PutDestinationInput{}
  1572. }
  1573. req = c.newRequest(op, input, output)
  1574. output = &PutDestinationOutput{}
  1575. req.Data = output
  1576. return
  1577. }
  1578. // PutDestination API operation for Amazon CloudWatch Logs.
  1579. //
  1580. // Creates or updates a Destination. A destination encapsulates a physical resource
  1581. // (such as a Kinesis stream) and allows you to subscribe to a real-time stream
  1582. // of log events of a different account, ingested through PutLogEvents requests.
  1583. // Currently, the only supported physical resource is a Amazon Kinesis stream
  1584. // belonging to the same account as the destination.
  1585. //
  1586. // A destination controls what is written to its Amazon Kinesis stream through
  1587. // an access policy. By default, PutDestination does not set any access policy
  1588. // with the destination, which means a cross-account user will not be able to
  1589. // call PutSubscriptionFilter against this destination. To enable that, the
  1590. // destination owner must call PutDestinationPolicy after PutDestination.
  1591. //
  1592. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1593. // with awserr.Error's Code and Message methods to get detailed information about
  1594. // the error.
  1595. //
  1596. // See the AWS API reference guide for Amazon CloudWatch Logs's
  1597. // API operation PutDestination for usage and error information.
  1598. //
  1599. // Returned Error Codes:
  1600. // * InvalidParameterException
  1601. // Returned if a parameter of the request is incorrectly specified.
  1602. //
  1603. // * OperationAbortedException
  1604. // Returned if multiple requests to update the same resource were in conflict.
  1605. //
  1606. // * ServiceUnavailableException
  1607. // Returned if the service cannot complete the request.
  1608. //
  1609. func (c *CloudWatchLogs) PutDestination(input *PutDestinationInput) (*PutDestinationOutput, error) {
  1610. req, out := c.PutDestinationRequest(input)
  1611. err := req.Send()
  1612. return out, err
  1613. }
  1614. const opPutDestinationPolicy = "PutDestinationPolicy"
  1615. // PutDestinationPolicyRequest generates a "aws/request.Request" representing the
  1616. // client's request for the PutDestinationPolicy operation. The "output" return
  1617. // value can be used to capture response data after the request's "Send" method
  1618. // is called.
  1619. //
  1620. // See PutDestinationPolicy for usage and error information.
  1621. //
  1622. // Creating a request object using this method should be used when you want to inject
  1623. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1624. // access properties on the request object before or after sending the request. If
  1625. // you just want the service response, call the PutDestinationPolicy method directly
  1626. // instead.
  1627. //
  1628. // Note: You must call the "Send" method on the returned request object in order
  1629. // to execute the request.
  1630. //
  1631. // // Example sending a request using the PutDestinationPolicyRequest method.
  1632. // req, resp := client.PutDestinationPolicyRequest(params)
  1633. //
  1634. // err := req.Send()
  1635. // if err == nil { // resp is now filled
  1636. // fmt.Println(resp)
  1637. // }
  1638. //
  1639. func (c *CloudWatchLogs) PutDestinationPolicyRequest(input *PutDestinationPolicyInput) (req *request.Request, output *PutDestinationPolicyOutput) {
  1640. op := &request.Operation{
  1641. Name: opPutDestinationPolicy,
  1642. HTTPMethod: "POST",
  1643. HTTPPath: "/",
  1644. }
  1645. if input == nil {
  1646. input = &PutDestinationPolicyInput{}
  1647. }
  1648. req = c.newRequest(op, input, output)
  1649. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  1650. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  1651. output = &PutDestinationPolicyOutput{}
  1652. req.Data = output
  1653. return
  1654. }
  1655. // PutDestinationPolicy API operation for Amazon CloudWatch Logs.
  1656. //
  1657. // Creates or updates an access policy associated with an existing Destination.
  1658. // An access policy is an IAM policy document (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies_overview.html)
  1659. // that is used to authorize claims to register a subscription filter against
  1660. // a given destination.
  1661. //
  1662. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1663. // with awserr.Error's Code and Message methods to get detailed information about
  1664. // the error.
  1665. //
  1666. // See the AWS API reference guide for Amazon CloudWatch Logs's
  1667. // API operation PutDestinationPolicy for usage and error information.
  1668. //
  1669. // Returned Error Codes:
  1670. // * InvalidParameterException
  1671. // Returned if a parameter of the request is incorrectly specified.
  1672. //
  1673. // * OperationAbortedException
  1674. // Returned if multiple requests to update the same resource were in conflict.
  1675. //
  1676. // * ServiceUnavailableException
  1677. // Returned if the service cannot complete the request.
  1678. //
  1679. func (c *CloudWatchLogs) PutDestinationPolicy(input *PutDestinationPolicyInput) (*PutDestinationPolicyOutput, error) {
  1680. req, out := c.PutDestinationPolicyRequest(input)
  1681. err := req.Send()
  1682. return out, err
  1683. }
  1684. const opPutLogEvents = "PutLogEvents"
  1685. // PutLogEventsRequest generates a "aws/request.Request" representing the
  1686. // client's request for the PutLogEvents operation. The "output" return
  1687. // value can be used to capture response data after the request's "Send" method
  1688. // is called.
  1689. //
  1690. // See PutLogEvents for usage and error information.
  1691. //
  1692. // Creating a request object using this method should be used when you want to inject
  1693. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1694. // access properties on the request object before or after sending the request. If
  1695. // you just want the service response, call the PutLogEvents method directly
  1696. // instead.
  1697. //
  1698. // Note: You must call the "Send" method on the returned request object in order
  1699. // to execute the request.
  1700. //
  1701. // // Example sending a request using the PutLogEventsRequest method.
  1702. // req, resp := client.PutLogEventsRequest(params)
  1703. //
  1704. // err := req.Send()
  1705. // if err == nil { // resp is now filled
  1706. // fmt.Println(resp)
  1707. // }
  1708. //
  1709. func (c *CloudWatchLogs) PutLogEventsRequest(input *PutLogEventsInput) (req *request.Request, output *PutLogEventsOutput) {
  1710. op := &request.Operation{
  1711. Name: opPutLogEvents,
  1712. HTTPMethod: "POST",
  1713. HTTPPath: "/",
  1714. }
  1715. if input == nil {
  1716. input = &PutLogEventsInput{}
  1717. }
  1718. req = c.newRequest(op, input, output)
  1719. output = &PutLogEventsOutput{}
  1720. req.Data = output
  1721. return
  1722. }
  1723. // PutLogEvents API operation for Amazon CloudWatch Logs.
  1724. //
  1725. // Uploads a batch of log events to the specified log stream.
  1726. //
  1727. // Every PutLogEvents request must include the sequenceToken obtained from the
  1728. // response of the previous request. An upload in a newly created log stream
  1729. // does not require a sequenceToken. You can also get the sequenceToken using
  1730. // DescribeLogStreams.
  1731. //
  1732. // The batch of events must satisfy the following constraints:
  1733. //
  1734. // * The maximum batch size is 1,048,576 bytes, and this size is calculated
  1735. // as the sum of all event messages in UTF-8, plus 26 bytes for each log
  1736. // event.
  1737. //
  1738. // * None of the log events in the batch can be more than 2 hours in the
  1739. // future.
  1740. //
  1741. // * None of the log events in the batch can be older than 14 days or the
  1742. // retention period of the log group.
  1743. //
  1744. // * The log events in the batch must be in chronological ordered by their
  1745. // timestamp.
  1746. //
  1747. // * The maximum number of log events in a batch is 10,000.
  1748. //
  1749. // * A batch of log events in a single PutLogEvents request cannot span more
  1750. // than 24 hours. Otherwise, the PutLogEvents operation will fail.
  1751. //
  1752. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1753. // with awserr.Error's Code and Message methods to get detailed information about
  1754. // the error.
  1755. //
  1756. // See the AWS API reference guide for Amazon CloudWatch Logs's
  1757. // API operation PutLogEvents for usage and error information.
  1758. //
  1759. // Returned Error Codes:
  1760. // * InvalidParameterException
  1761. // Returned if a parameter of the request is incorrectly specified.
  1762. //
  1763. // * InvalidSequenceTokenException
  1764. //
  1765. // * DataAlreadyAcceptedException
  1766. //
  1767. // * ResourceNotFoundException
  1768. // Returned if the specified resource does not exist.
  1769. //
  1770. // * ServiceUnavailableException
  1771. // Returned if the service cannot complete the request.
  1772. //
  1773. func (c *CloudWatchLogs) PutLogEvents(input *PutLogEventsInput) (*PutLogEventsOutput, error) {
  1774. req, out := c.PutLogEventsRequest(input)
  1775. err := req.Send()
  1776. return out, err
  1777. }
  1778. const opPutMetricFilter = "PutMetricFilter"
  1779. // PutMetricFilterRequest generates a "aws/request.Request" representing the
  1780. // client's request for the PutMetricFilter operation. The "output" return
  1781. // value can be used to capture response data after the request's "Send" method
  1782. // is called.
  1783. //
  1784. // See PutMetricFilter for usage and error information.
  1785. //
  1786. // Creating a request object using this method should be used when you want to inject
  1787. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1788. // access properties on the request object before or after sending the request. If
  1789. // you just want the service response, call the PutMetricFilter method directly
  1790. // instead.
  1791. //
  1792. // Note: You must call the "Send" method on the returned request object in order
  1793. // to execute the request.
  1794. //
  1795. // // Example sending a request using the PutMetricFilterRequest method.
  1796. // req, resp := client.PutMetricFilterRequest(params)
  1797. //
  1798. // err := req.Send()
  1799. // if err == nil { // resp is now filled
  1800. // fmt.Println(resp)
  1801. // }
  1802. //
  1803. func (c *CloudWatchLogs) PutMetricFilterRequest(input *PutMetricFilterInput) (req *request.Request, output *PutMetricFilterOutput) {
  1804. op := &request.Operation{
  1805. Name: opPutMetricFilter,
  1806. HTTPMethod: "POST",
  1807. HTTPPath: "/",
  1808. }
  1809. if input == nil {
  1810. input = &PutMetricFilterInput{}
  1811. }
  1812. req = c.newRequest(op, input, output)
  1813. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  1814. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  1815. output = &PutMetricFilterOutput{}
  1816. req.Data = output
  1817. return
  1818. }
  1819. // PutMetricFilter API operation for Amazon CloudWatch Logs.
  1820. //
  1821. // Creates or updates a metric filter and associates it with the specified log
  1822. // group. Metric filters allow you to configure rules to extract metric data
  1823. // from log events ingested through PutLogEvents requests.
  1824. //
  1825. // The maximum number of metric filters that can be associated with a log group
  1826. // is 100.
  1827. //
  1828. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1829. // with awserr.Error's Code and Message methods to get detailed information about
  1830. // the error.
  1831. //
  1832. // See the AWS API reference guide for Amazon CloudWatch Logs's
  1833. // API operation PutMetricFilter for usage and error information.
  1834. //
  1835. // Returned Error Codes:
  1836. // * InvalidParameterException
  1837. // Returned if a parameter of the request is incorrectly specified.
  1838. //
  1839. // * ResourceNotFoundException
  1840. // Returned if the specified resource does not exist.
  1841. //
  1842. // * OperationAbortedException
  1843. // Returned if multiple requests to update the same resource were in conflict.
  1844. //
  1845. // * LimitExceededException
  1846. // Returned if you have reached the maximum number of resources that can be
  1847. // created.
  1848. //
  1849. // * ServiceUnavailableException
  1850. // Returned if the service cannot complete the request.
  1851. //
  1852. func (c *CloudWatchLogs) PutMetricFilter(input *PutMetricFilterInput) (*PutMetricFilterOutput, error) {
  1853. req, out := c.PutMetricFilterRequest(input)
  1854. err := req.Send()
  1855. return out, err
  1856. }
  1857. const opPutRetentionPolicy = "PutRetentionPolicy"
  1858. // PutRetentionPolicyRequest generates a "aws/request.Request" representing the
  1859. // client's request for the PutRetentionPolicy operation. The "output" return
  1860. // value can be used to capture response data after the request's "Send" method
  1861. // is called.
  1862. //
  1863. // See PutRetentionPolicy for usage and error information.
  1864. //
  1865. // Creating a request object using this method should be used when you want to inject
  1866. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1867. // access properties on the request object before or after sending the request. If
  1868. // you just want the service response, call the PutRetentionPolicy method directly
  1869. // instead.
  1870. //
  1871. // Note: You must call the "Send" method on the returned request object in order
  1872. // to execute the request.
  1873. //
  1874. // // Example sending a request using the PutRetentionPolicyRequest method.
  1875. // req, resp := client.PutRetentionPolicyRequest(params)
  1876. //
  1877. // err := req.Send()
  1878. // if err == nil { // resp is now filled
  1879. // fmt.Println(resp)
  1880. // }
  1881. //
  1882. func (c *CloudWatchLogs) PutRetentionPolicyRequest(input *PutRetentionPolicyInput) (req *request.Request, output *PutRetentionPolicyOutput) {
  1883. op := &request.Operation{
  1884. Name: opPutRetentionPolicy,
  1885. HTTPMethod: "POST",
  1886. HTTPPath: "/",
  1887. }
  1888. if input == nil {
  1889. input = &PutRetentionPolicyInput{}
  1890. }
  1891. req = c.newRequest(op, input, output)
  1892. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  1893. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  1894. output = &PutRetentionPolicyOutput{}
  1895. req.Data = output
  1896. return
  1897. }
  1898. // PutRetentionPolicy API operation for Amazon CloudWatch Logs.
  1899. //
  1900. // Sets the retention of the specified log group. A retention policy allows
  1901. // you to configure the number of days you want to retain log events in the
  1902. // specified log group.
  1903. //
  1904. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1905. // with awserr.Error's Code and Message methods to get detailed information about
  1906. // the error.
  1907. //
  1908. // See the AWS API reference guide for Amazon CloudWatch Logs's
  1909. // API operation PutRetentionPolicy for usage and error information.
  1910. //
  1911. // Returned Error Codes:
  1912. // * InvalidParameterException
  1913. // Returned if a parameter of the request is incorrectly specified.
  1914. //
  1915. // * ResourceNotFoundException
  1916. // Returned if the specified resource does not exist.
  1917. //
  1918. // * OperationAbortedException
  1919. // Returned if multiple requests to update the same resource were in conflict.
  1920. //
  1921. // * ServiceUnavailableException
  1922. // Returned if the service cannot complete the request.
  1923. //
  1924. func (c *CloudWatchLogs) PutRetentionPolicy(input *PutRetentionPolicyInput) (*PutRetentionPolicyOutput, error) {
  1925. req, out := c.PutRetentionPolicyRequest(input)
  1926. err := req.Send()
  1927. return out, err
  1928. }
  1929. const opPutSubscriptionFilter = "PutSubscriptionFilter"
  1930. // PutSubscriptionFilterRequest generates a "aws/request.Request" representing the
  1931. // client's request for the PutSubscriptionFilter operation. The "output" return
  1932. // value can be used to capture response data after the request's "Send" method
  1933. // is called.
  1934. //
  1935. // See PutSubscriptionFilter for usage and error information.
  1936. //
  1937. // Creating a request object using this method should be used when you want to inject
  1938. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1939. // access properties on the request object before or after sending the request. If
  1940. // you just want the service response, call the PutSubscriptionFilter method directly
  1941. // instead.
  1942. //
  1943. // Note: You must call the "Send" method on the returned request object in order
  1944. // to execute the request.
  1945. //
  1946. // // Example sending a request using the PutSubscriptionFilterRequest method.
  1947. // req, resp := client.PutSubscriptionFilterRequest(params)
  1948. //
  1949. // err := req.Send()
  1950. // if err == nil { // resp is now filled
  1951. // fmt.Println(resp)
  1952. // }
  1953. //
  1954. func (c *CloudWatchLogs) PutSubscriptionFilterRequest(input *PutSubscriptionFilterInput) (req *request.Request, output *PutSubscriptionFilterOutput) {
  1955. op := &request.Operation{
  1956. Name: opPutSubscriptionFilter,
  1957. HTTPMethod: "POST",
  1958. HTTPPath: "/",
  1959. }
  1960. if input == nil {
  1961. input = &PutSubscriptionFilterInput{}
  1962. }
  1963. req = c.newRequest(op, input, output)
  1964. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  1965. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  1966. output = &PutSubscriptionFilterOutput{}
  1967. req.Data = output
  1968. return
  1969. }
  1970. // PutSubscriptionFilter API operation for Amazon CloudWatch Logs.
  1971. //
  1972. // Creates or updates a subscription filter and associates it with the specified
  1973. // log group. Subscription filters allow you to subscribe to a real-time stream
  1974. // of log events ingested through PutLogEvents requests and have them delivered
  1975. // to a specific destination. Currently, the supported destinations are:
  1976. //
  1977. // * An Amazon Kinesis stream belonging to the same account as the subscription
  1978. // filter, for same-account delivery.
  1979. //
  1980. // * A logical destination (used via an ARN of Destination) belonging to
  1981. // a different account, for cross-account delivery.
  1982. //
  1983. // * An Amazon Kinesis Firehose stream belonging to the same account as the
  1984. // subscription filter, for same-account delivery.
  1985. //
  1986. // * An AWS Lambda function belonging to the same account as the subscription
  1987. // filter, for same-account delivery.
  1988. //
  1989. // Currently there can only be one subscription filter associated with a log
  1990. // group.
  1991. //
  1992. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1993. // with awserr.Error's Code and Message methods to get detailed information about
  1994. // the error.
  1995. //
  1996. // See the AWS API reference guide for Amazon CloudWatch Logs's
  1997. // API operation PutSubscriptionFilter for usage and error information.
  1998. //
  1999. // Returned Error Codes:
  2000. // * InvalidParameterException
  2001. // Returned if a parameter of the request is incorrectly specified.
  2002. //
  2003. // * ResourceNotFoundException
  2004. // Returned if the specified resource does not exist.
  2005. //
  2006. // * OperationAbortedException
  2007. // Returned if multiple requests to update the same resource were in conflict.
  2008. //
  2009. // * LimitExceededException
  2010. // Returned if you have reached the maximum number of resources that can be
  2011. // created.
  2012. //
  2013. // * ServiceUnavailableException
  2014. // Returned if the service cannot complete the request.
  2015. //
  2016. func (c *CloudWatchLogs) PutSubscriptionFilter(input *PutSubscriptionFilterInput) (*PutSubscriptionFilterOutput, error) {
  2017. req, out := c.PutSubscriptionFilterRequest(input)
  2018. err := req.Send()
  2019. return out, err
  2020. }
  2021. const opTestMetricFilter = "TestMetricFilter"
  2022. // TestMetricFilterRequest generates a "aws/request.Request" representing the
  2023. // client's request for the TestMetricFilter operation. The "output" return
  2024. // value can be used to capture response data after the request's "Send" method
  2025. // is called.
  2026. //
  2027. // See TestMetricFilter for usage and error information.
  2028. //
  2029. // Creating a request object using this method should be used when you want to inject
  2030. // custom logic into the request's lifecycle using a custom handler, or if you want to
  2031. // access properties on the request object before or after sending the request. If
  2032. // you just want the service response, call the TestMetricFilter method directly
  2033. // instead.
  2034. //
  2035. // Note: You must call the "Send" method on the returned request object in order
  2036. // to execute the request.
  2037. //
  2038. // // Example sending a request using the TestMetricFilterRequest method.
  2039. // req, resp := client.TestMetricFilterRequest(params)
  2040. //
  2041. // err := req.Send()
  2042. // if err == nil { // resp is now filled
  2043. // fmt.Println(resp)
  2044. // }
  2045. //
  2046. func (c *CloudWatchLogs) TestMetricFilterRequest(input *TestMetricFilterInput) (req *request.Request, output *TestMetricFilterOutput) {
  2047. op := &request.Operation{
  2048. Name: opTestMetricFilter,
  2049. HTTPMethod: "POST",
  2050. HTTPPath: "/",
  2051. }
  2052. if input == nil {
  2053. input = &TestMetricFilterInput{}
  2054. }
  2055. req = c.newRequest(op, input, output)
  2056. output = &TestMetricFilterOutput{}
  2057. req.Data = output
  2058. return
  2059. }
  2060. // TestMetricFilter API operation for Amazon CloudWatch Logs.
  2061. //
  2062. // Tests the filter pattern of a metric filter against a sample of log event
  2063. // messages. You can use this operation to validate the correctness of a metric
  2064. // filter pattern.
  2065. //
  2066. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  2067. // with awserr.Error's Code and Message methods to get detailed information about
  2068. // the error.
  2069. //
  2070. // See the AWS API reference guide for Amazon CloudWatch Logs's
  2071. // API operation TestMetricFilter for usage and error information.
  2072. //
  2073. // Returned Error Codes:
  2074. // * InvalidParameterException
  2075. // Returned if a parameter of the request is incorrectly specified.
  2076. //
  2077. // * ServiceUnavailableException
  2078. // Returned if the service cannot complete the request.
  2079. //
  2080. func (c *CloudWatchLogs) TestMetricFilter(input *TestMetricFilterInput) (*TestMetricFilterOutput, error) {
  2081. req, out := c.TestMetricFilterRequest(input)
  2082. err := req.Send()
  2083. return out, err
  2084. }
  2085. type CancelExportTaskInput struct {
  2086. _ struct{} `type:"structure"`
  2087. // Id of the export task to cancel.
  2088. //
  2089. // TaskId is a required field
  2090. TaskId *string `locationName:"taskId" min:"1" type:"string" required:"true"`
  2091. }
  2092. // String returns the string representation
  2093. func (s CancelExportTaskInput) String() string {
  2094. return awsutil.Prettify(s)
  2095. }
  2096. // GoString returns the string representation
  2097. func (s CancelExportTaskInput) GoString() string {
  2098. return s.String()
  2099. }
  2100. // Validate inspects the fields of the type to determine if they are valid.
  2101. func (s *CancelExportTaskInput) Validate() error {
  2102. invalidParams := request.ErrInvalidParams{Context: "CancelExportTaskInput"}
  2103. if s.TaskId == nil {
  2104. invalidParams.Add(request.NewErrParamRequired("TaskId"))
  2105. }
  2106. if s.TaskId != nil && len(*s.TaskId) < 1 {
  2107. invalidParams.Add(request.NewErrParamMinLen("TaskId", 1))
  2108. }
  2109. if invalidParams.Len() > 0 {
  2110. return invalidParams
  2111. }
  2112. return nil
  2113. }
  2114. type CancelExportTaskOutput struct {
  2115. _ struct{} `type:"structure"`
  2116. }
  2117. // String returns the string representation
  2118. func (s CancelExportTaskOutput) String() string {
  2119. return awsutil.Prettify(s)
  2120. }
  2121. // GoString returns the string representation
  2122. func (s CancelExportTaskOutput) GoString() string {
  2123. return s.String()
  2124. }
  2125. type CreateExportTaskInput struct {
  2126. _ struct{} `type:"structure"`
  2127. // Name of Amazon S3 bucket to which the log data will be exported.
  2128. //
  2129. // Note: Only buckets in the same AWS region are supported.
  2130. //
  2131. // Destination is a required field
  2132. Destination *string `locationName:"destination" min:"1" type:"string" required:"true"`
  2133. // Prefix that will be used as the start of Amazon S3 key for every object exported.
  2134. // If not specified, this defaults to 'exportedlogs'.
  2135. DestinationPrefix *string `locationName:"destinationPrefix" type:"string"`
  2136. // A point in time expressed as the number of milliseconds since Jan 1, 1970
  2137. // 00:00:00 UTC. It indicates the start time of the range for the request. Events
  2138. // with a timestamp prior to this time will not be exported.
  2139. //
  2140. // From is a required field
  2141. From *int64 `locationName:"from" type:"long" required:"true"`
  2142. // The name of the log group to export.
  2143. //
  2144. // LogGroupName is a required field
  2145. LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"`
  2146. // Will only export log streams that match the provided logStreamNamePrefix.
  2147. // If you don't specify a value, no prefix filter is applied.
  2148. LogStreamNamePrefix *string `locationName:"logStreamNamePrefix" min:"1" type:"string"`
  2149. // The name of the export task.
  2150. TaskName *string `locationName:"taskName" min:"1" type:"string"`
  2151. // A point in time expressed as the number of milliseconds since Jan 1, 1970
  2152. // 00:00:00 UTC. It indicates the end time of the range for the request. Events
  2153. // with a timestamp later than this time will not be exported.
  2154. //
  2155. // To is a required field
  2156. To *int64 `locationName:"to" type:"long" required:"true"`
  2157. }
  2158. // String returns the string representation
  2159. func (s CreateExportTaskInput) String() string {
  2160. return awsutil.Prettify(s)
  2161. }
  2162. // GoString returns the string representation
  2163. func (s CreateExportTaskInput) GoString() string {
  2164. return s.String()
  2165. }
  2166. // Validate inspects the fields of the type to determine if they are valid.
  2167. func (s *CreateExportTaskInput) Validate() error {
  2168. invalidParams := request.ErrInvalidParams{Context: "CreateExportTaskInput"}
  2169. if s.Destination == nil {
  2170. invalidParams.Add(request.NewErrParamRequired("Destination"))
  2171. }
  2172. if s.Destination != nil && len(*s.Destination) < 1 {
  2173. invalidParams.Add(request.NewErrParamMinLen("Destination", 1))
  2174. }
  2175. if s.From == nil {
  2176. invalidParams.Add(request.NewErrParamRequired("From"))
  2177. }
  2178. if s.LogGroupName == nil {
  2179. invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
  2180. }
  2181. if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
  2182. invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
  2183. }
  2184. if s.LogStreamNamePrefix != nil && len(*s.LogStreamNamePrefix) < 1 {
  2185. invalidParams.Add(request.NewErrParamMinLen("LogStreamNamePrefix", 1))
  2186. }
  2187. if s.TaskName != nil && len(*s.TaskName) < 1 {
  2188. invalidParams.Add(request.NewErrParamMinLen("TaskName", 1))
  2189. }
  2190. if s.To == nil {
  2191. invalidParams.Add(request.NewErrParamRequired("To"))
  2192. }
  2193. if invalidParams.Len() > 0 {
  2194. return invalidParams
  2195. }
  2196. return nil
  2197. }
  2198. type CreateExportTaskOutput struct {
  2199. _ struct{} `type:"structure"`
  2200. // Id of the export task that got created.
  2201. TaskId *string `locationName:"taskId" min:"1" type:"string"`
  2202. }
  2203. // String returns the string representation
  2204. func (s CreateExportTaskOutput) String() string {
  2205. return awsutil.Prettify(s)
  2206. }
  2207. // GoString returns the string representation
  2208. func (s CreateExportTaskOutput) GoString() string {
  2209. return s.String()
  2210. }
  2211. type CreateLogGroupInput struct {
  2212. _ struct{} `type:"structure"`
  2213. // The name of the log group to create.
  2214. //
  2215. // LogGroupName is a required field
  2216. LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"`
  2217. }
  2218. // String returns the string representation
  2219. func (s CreateLogGroupInput) String() string {
  2220. return awsutil.Prettify(s)
  2221. }
  2222. // GoString returns the string representation
  2223. func (s CreateLogGroupInput) GoString() string {
  2224. return s.String()
  2225. }
  2226. // Validate inspects the fields of the type to determine if they are valid.
  2227. func (s *CreateLogGroupInput) Validate() error {
  2228. invalidParams := request.ErrInvalidParams{Context: "CreateLogGroupInput"}
  2229. if s.LogGroupName == nil {
  2230. invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
  2231. }
  2232. if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
  2233. invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
  2234. }
  2235. if invalidParams.Len() > 0 {
  2236. return invalidParams
  2237. }
  2238. return nil
  2239. }
  2240. type CreateLogGroupOutput struct {
  2241. _ struct{} `type:"structure"`
  2242. }
  2243. // String returns the string representation
  2244. func (s CreateLogGroupOutput) String() string {
  2245. return awsutil.Prettify(s)
  2246. }
  2247. // GoString returns the string representation
  2248. func (s CreateLogGroupOutput) GoString() string {
  2249. return s.String()
  2250. }
  2251. type CreateLogStreamInput struct {
  2252. _ struct{} `type:"structure"`
  2253. // The name of the log group under which the log stream is to be created.
  2254. //
  2255. // LogGroupName is a required field
  2256. LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"`
  2257. // The name of the log stream to create.
  2258. //
  2259. // LogStreamName is a required field
  2260. LogStreamName *string `locationName:"logStreamName" min:"1" type:"string" required:"true"`
  2261. }
  2262. // String returns the string representation
  2263. func (s CreateLogStreamInput) String() string {
  2264. return awsutil.Prettify(s)
  2265. }
  2266. // GoString returns the string representation
  2267. func (s CreateLogStreamInput) GoString() string {
  2268. return s.String()
  2269. }
  2270. // Validate inspects the fields of the type to determine if they are valid.
  2271. func (s *CreateLogStreamInput) Validate() error {
  2272. invalidParams := request.ErrInvalidParams{Context: "CreateLogStreamInput"}
  2273. if s.LogGroupName == nil {
  2274. invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
  2275. }
  2276. if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
  2277. invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
  2278. }
  2279. if s.LogStreamName == nil {
  2280. invalidParams.Add(request.NewErrParamRequired("LogStreamName"))
  2281. }
  2282. if s.LogStreamName != nil && len(*s.LogStreamName) < 1 {
  2283. invalidParams.Add(request.NewErrParamMinLen("LogStreamName", 1))
  2284. }
  2285. if invalidParams.Len() > 0 {
  2286. return invalidParams
  2287. }
  2288. return nil
  2289. }
  2290. type CreateLogStreamOutput struct {
  2291. _ struct{} `type:"structure"`
  2292. }
  2293. // String returns the string representation
  2294. func (s CreateLogStreamOutput) String() string {
  2295. return awsutil.Prettify(s)
  2296. }
  2297. // GoString returns the string representation
  2298. func (s CreateLogStreamOutput) GoString() string {
  2299. return s.String()
  2300. }
  2301. type DeleteDestinationInput struct {
  2302. _ struct{} `type:"structure"`
  2303. // The name of destination to delete.
  2304. //
  2305. // DestinationName is a required field
  2306. DestinationName *string `locationName:"destinationName" min:"1" type:"string" required:"true"`
  2307. }
  2308. // String returns the string representation
  2309. func (s DeleteDestinationInput) String() string {
  2310. return awsutil.Prettify(s)
  2311. }
  2312. // GoString returns the string representation
  2313. func (s DeleteDestinationInput) GoString() string {
  2314. return s.String()
  2315. }
  2316. // Validate inspects the fields of the type to determine if they are valid.
  2317. func (s *DeleteDestinationInput) Validate() error {
  2318. invalidParams := request.ErrInvalidParams{Context: "DeleteDestinationInput"}
  2319. if s.DestinationName == nil {
  2320. invalidParams.Add(request.NewErrParamRequired("DestinationName"))
  2321. }
  2322. if s.DestinationName != nil && len(*s.DestinationName) < 1 {
  2323. invalidParams.Add(request.NewErrParamMinLen("DestinationName", 1))
  2324. }
  2325. if invalidParams.Len() > 0 {
  2326. return invalidParams
  2327. }
  2328. return nil
  2329. }
  2330. type DeleteDestinationOutput struct {
  2331. _ struct{} `type:"structure"`
  2332. }
  2333. // String returns the string representation
  2334. func (s DeleteDestinationOutput) String() string {
  2335. return awsutil.Prettify(s)
  2336. }
  2337. // GoString returns the string representation
  2338. func (s DeleteDestinationOutput) GoString() string {
  2339. return s.String()
  2340. }
  2341. type DeleteLogGroupInput struct {
  2342. _ struct{} `type:"structure"`
  2343. // The name of the log group to delete.
  2344. //
  2345. // LogGroupName is a required field
  2346. LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"`
  2347. }
  2348. // String returns the string representation
  2349. func (s DeleteLogGroupInput) String() string {
  2350. return awsutil.Prettify(s)
  2351. }
  2352. // GoString returns the string representation
  2353. func (s DeleteLogGroupInput) GoString() string {
  2354. return s.String()
  2355. }
  2356. // Validate inspects the fields of the type to determine if they are valid.
  2357. func (s *DeleteLogGroupInput) Validate() error {
  2358. invalidParams := request.ErrInvalidParams{Context: "DeleteLogGroupInput"}
  2359. if s.LogGroupName == nil {
  2360. invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
  2361. }
  2362. if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
  2363. invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
  2364. }
  2365. if invalidParams.Len() > 0 {
  2366. return invalidParams
  2367. }
  2368. return nil
  2369. }
  2370. type DeleteLogGroupOutput struct {
  2371. _ struct{} `type:"structure"`
  2372. }
  2373. // String returns the string representation
  2374. func (s DeleteLogGroupOutput) String() string {
  2375. return awsutil.Prettify(s)
  2376. }
  2377. // GoString returns the string representation
  2378. func (s DeleteLogGroupOutput) GoString() string {
  2379. return s.String()
  2380. }
  2381. type DeleteLogStreamInput struct {
  2382. _ struct{} `type:"structure"`
  2383. // The name of the log group under which the log stream to delete belongs.
  2384. //
  2385. // LogGroupName is a required field
  2386. LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"`
  2387. // The name of the log stream to delete.
  2388. //
  2389. // LogStreamName is a required field
  2390. LogStreamName *string `locationName:"logStreamName" min:"1" type:"string" required:"true"`
  2391. }
  2392. // String returns the string representation
  2393. func (s DeleteLogStreamInput) String() string {
  2394. return awsutil.Prettify(s)
  2395. }
  2396. // GoString returns the string representation
  2397. func (s DeleteLogStreamInput) GoString() string {
  2398. return s.String()
  2399. }
  2400. // Validate inspects the fields of the type to determine if they are valid.
  2401. func (s *DeleteLogStreamInput) Validate() error {
  2402. invalidParams := request.ErrInvalidParams{Context: "DeleteLogStreamInput"}
  2403. if s.LogGroupName == nil {
  2404. invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
  2405. }
  2406. if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
  2407. invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
  2408. }
  2409. if s.LogStreamName == nil {
  2410. invalidParams.Add(request.NewErrParamRequired("LogStreamName"))
  2411. }
  2412. if s.LogStreamName != nil && len(*s.LogStreamName) < 1 {
  2413. invalidParams.Add(request.NewErrParamMinLen("LogStreamName", 1))
  2414. }
  2415. if invalidParams.Len() > 0 {
  2416. return invalidParams
  2417. }
  2418. return nil
  2419. }
  2420. type DeleteLogStreamOutput struct {
  2421. _ struct{} `type:"structure"`
  2422. }
  2423. // String returns the string representation
  2424. func (s DeleteLogStreamOutput) String() string {
  2425. return awsutil.Prettify(s)
  2426. }
  2427. // GoString returns the string representation
  2428. func (s DeleteLogStreamOutput) GoString() string {
  2429. return s.String()
  2430. }
  2431. type DeleteMetricFilterInput struct {
  2432. _ struct{} `type:"structure"`
  2433. // The name of the metric filter to delete.
  2434. //
  2435. // FilterName is a required field
  2436. FilterName *string `locationName:"filterName" min:"1" type:"string" required:"true"`
  2437. // The name of the log group that is associated with the metric filter to delete.
  2438. //
  2439. // LogGroupName is a required field
  2440. LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"`
  2441. }
  2442. // String returns the string representation
  2443. func (s DeleteMetricFilterInput) String() string {
  2444. return awsutil.Prettify(s)
  2445. }
  2446. // GoString returns the string representation
  2447. func (s DeleteMetricFilterInput) GoString() string {
  2448. return s.String()
  2449. }
  2450. // Validate inspects the fields of the type to determine if they are valid.
  2451. func (s *DeleteMetricFilterInput) Validate() error {
  2452. invalidParams := request.ErrInvalidParams{Context: "DeleteMetricFilterInput"}
  2453. if s.FilterName == nil {
  2454. invalidParams.Add(request.NewErrParamRequired("FilterName"))
  2455. }
  2456. if s.FilterName != nil && len(*s.FilterName) < 1 {
  2457. invalidParams.Add(request.NewErrParamMinLen("FilterName", 1))
  2458. }
  2459. if s.LogGroupName == nil {
  2460. invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
  2461. }
  2462. if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
  2463. invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
  2464. }
  2465. if invalidParams.Len() > 0 {
  2466. return invalidParams
  2467. }
  2468. return nil
  2469. }
  2470. type DeleteMetricFilterOutput struct {
  2471. _ struct{} `type:"structure"`
  2472. }
  2473. // String returns the string representation
  2474. func (s DeleteMetricFilterOutput) String() string {
  2475. return awsutil.Prettify(s)
  2476. }
  2477. // GoString returns the string representation
  2478. func (s DeleteMetricFilterOutput) GoString() string {
  2479. return s.String()
  2480. }
  2481. type DeleteRetentionPolicyInput struct {
  2482. _ struct{} `type:"structure"`
  2483. // The name of the log group that is associated with the retention policy to
  2484. // delete.
  2485. //
  2486. // LogGroupName is a required field
  2487. LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"`
  2488. }
  2489. // String returns the string representation
  2490. func (s DeleteRetentionPolicyInput) String() string {
  2491. return awsutil.Prettify(s)
  2492. }
  2493. // GoString returns the string representation
  2494. func (s DeleteRetentionPolicyInput) GoString() string {
  2495. return s.String()
  2496. }
  2497. // Validate inspects the fields of the type to determine if they are valid.
  2498. func (s *DeleteRetentionPolicyInput) Validate() error {
  2499. invalidParams := request.ErrInvalidParams{Context: "DeleteRetentionPolicyInput"}
  2500. if s.LogGroupName == nil {
  2501. invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
  2502. }
  2503. if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
  2504. invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
  2505. }
  2506. if invalidParams.Len() > 0 {
  2507. return invalidParams
  2508. }
  2509. return nil
  2510. }
  2511. type DeleteRetentionPolicyOutput struct {
  2512. _ struct{} `type:"structure"`
  2513. }
  2514. // String returns the string representation
  2515. func (s DeleteRetentionPolicyOutput) String() string {
  2516. return awsutil.Prettify(s)
  2517. }
  2518. // GoString returns the string representation
  2519. func (s DeleteRetentionPolicyOutput) GoString() string {
  2520. return s.String()
  2521. }
  2522. type DeleteSubscriptionFilterInput struct {
  2523. _ struct{} `type:"structure"`
  2524. // The name of the subscription filter to delete.
  2525. //
  2526. // FilterName is a required field
  2527. FilterName *string `locationName:"filterName" min:"1" type:"string" required:"true"`
  2528. // The name of the log group that is associated with the subscription filter
  2529. // to delete.
  2530. //
  2531. // LogGroupName is a required field
  2532. LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"`
  2533. }
  2534. // String returns the string representation
  2535. func (s DeleteSubscriptionFilterInput) String() string {
  2536. return awsutil.Prettify(s)
  2537. }
  2538. // GoString returns the string representation
  2539. func (s DeleteSubscriptionFilterInput) GoString() string {
  2540. return s.String()
  2541. }
  2542. // Validate inspects the fields of the type to determine if they are valid.
  2543. func (s *DeleteSubscriptionFilterInput) Validate() error {
  2544. invalidParams := request.ErrInvalidParams{Context: "DeleteSubscriptionFilterInput"}
  2545. if s.FilterName == nil {
  2546. invalidParams.Add(request.NewErrParamRequired("FilterName"))
  2547. }
  2548. if s.FilterName != nil && len(*s.FilterName) < 1 {
  2549. invalidParams.Add(request.NewErrParamMinLen("FilterName", 1))
  2550. }
  2551. if s.LogGroupName == nil {
  2552. invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
  2553. }
  2554. if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
  2555. invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
  2556. }
  2557. if invalidParams.Len() > 0 {
  2558. return invalidParams
  2559. }
  2560. return nil
  2561. }
  2562. type DeleteSubscriptionFilterOutput struct {
  2563. _ struct{} `type:"structure"`
  2564. }
  2565. // String returns the string representation
  2566. func (s DeleteSubscriptionFilterOutput) String() string {
  2567. return awsutil.Prettify(s)
  2568. }
  2569. // GoString returns the string representation
  2570. func (s DeleteSubscriptionFilterOutput) GoString() string {
  2571. return s.String()
  2572. }
  2573. type DescribeDestinationsInput struct {
  2574. _ struct{} `type:"structure"`
  2575. // Will only return destinations that match the provided destinationNamePrefix.
  2576. // If you don't specify a value, no prefix is applied.
  2577. DestinationNamePrefix *string `min:"1" type:"string"`
  2578. // The maximum number of results to return.
  2579. Limit *int64 `locationName:"limit" min:"1" type:"integer"`
  2580. // A string token used for pagination that points to the next page of results.
  2581. // It must be a value obtained from the response of the previous request. The
  2582. // token expires after 24 hours.
  2583. NextToken *string `locationName:"nextToken" min:"1" type:"string"`
  2584. }
  2585. // String returns the string representation
  2586. func (s DescribeDestinationsInput) String() string {
  2587. return awsutil.Prettify(s)
  2588. }
  2589. // GoString returns the string representation
  2590. func (s DescribeDestinationsInput) GoString() string {
  2591. return s.String()
  2592. }
  2593. // Validate inspects the fields of the type to determine if they are valid.
  2594. func (s *DescribeDestinationsInput) Validate() error {
  2595. invalidParams := request.ErrInvalidParams{Context: "DescribeDestinationsInput"}
  2596. if s.DestinationNamePrefix != nil && len(*s.DestinationNamePrefix) < 1 {
  2597. invalidParams.Add(request.NewErrParamMinLen("DestinationNamePrefix", 1))
  2598. }
  2599. if s.Limit != nil && *s.Limit < 1 {
  2600. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  2601. }
  2602. if s.NextToken != nil && len(*s.NextToken) < 1 {
  2603. invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
  2604. }
  2605. if invalidParams.Len() > 0 {
  2606. return invalidParams
  2607. }
  2608. return nil
  2609. }
  2610. type DescribeDestinationsOutput struct {
  2611. _ struct{} `type:"structure"`
  2612. Destinations []*Destination `locationName:"destinations" type:"list"`
  2613. // A string token used for pagination that points to the next page of results.
  2614. // It must be a value obtained from the response of the previous request. The
  2615. // token expires after 24 hours.
  2616. NextToken *string `locationName:"nextToken" min:"1" type:"string"`
  2617. }
  2618. // String returns the string representation
  2619. func (s DescribeDestinationsOutput) String() string {
  2620. return awsutil.Prettify(s)
  2621. }
  2622. // GoString returns the string representation
  2623. func (s DescribeDestinationsOutput) GoString() string {
  2624. return s.String()
  2625. }
  2626. type DescribeExportTasksInput struct {
  2627. _ struct{} `type:"structure"`
  2628. // The maximum number of items returned in the response. If you don't specify
  2629. // a value, the request would return up to 50 items.
  2630. Limit *int64 `locationName:"limit" min:"1" type:"integer"`
  2631. // A string token used for pagination that points to the next page of results.
  2632. // It must be a value obtained from the response of the previous DescribeExportTasks
  2633. // request.
  2634. NextToken *string `locationName:"nextToken" min:"1" type:"string"`
  2635. // All export tasks that matches the specified status code will be returned.
  2636. // This can return zero or more export tasks.
  2637. StatusCode *string `locationName:"statusCode" type:"string" enum:"ExportTaskStatusCode"`
  2638. // Export task that matches the specified task Id will be returned. This can
  2639. // result in zero or one export task.
  2640. TaskId *string `locationName:"taskId" min:"1" type:"string"`
  2641. }
  2642. // String returns the string representation
  2643. func (s DescribeExportTasksInput) String() string {
  2644. return awsutil.Prettify(s)
  2645. }
  2646. // GoString returns the string representation
  2647. func (s DescribeExportTasksInput) GoString() string {
  2648. return s.String()
  2649. }
  2650. // Validate inspects the fields of the type to determine if they are valid.
  2651. func (s *DescribeExportTasksInput) Validate() error {
  2652. invalidParams := request.ErrInvalidParams{Context: "DescribeExportTasksInput"}
  2653. if s.Limit != nil && *s.Limit < 1 {
  2654. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  2655. }
  2656. if s.NextToken != nil && len(*s.NextToken) < 1 {
  2657. invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
  2658. }
  2659. if s.TaskId != nil && len(*s.TaskId) < 1 {
  2660. invalidParams.Add(request.NewErrParamMinLen("TaskId", 1))
  2661. }
  2662. if invalidParams.Len() > 0 {
  2663. return invalidParams
  2664. }
  2665. return nil
  2666. }
  2667. type DescribeExportTasksOutput struct {
  2668. _ struct{} `type:"structure"`
  2669. // A list of export tasks.
  2670. ExportTasks []*ExportTask `locationName:"exportTasks" type:"list"`
  2671. // A string token used for pagination that points to the next page of results.
  2672. // It must be a value obtained from the response of the previous request. The
  2673. // token expires after 24 hours.
  2674. NextToken *string `locationName:"nextToken" min:"1" type:"string"`
  2675. }
  2676. // String returns the string representation
  2677. func (s DescribeExportTasksOutput) String() string {
  2678. return awsutil.Prettify(s)
  2679. }
  2680. // GoString returns the string representation
  2681. func (s DescribeExportTasksOutput) GoString() string {
  2682. return s.String()
  2683. }
  2684. type DescribeLogGroupsInput struct {
  2685. _ struct{} `type:"structure"`
  2686. // The maximum number of items returned in the response. If you don't specify
  2687. // a value, the request would return up to 50 items.
  2688. Limit *int64 `locationName:"limit" min:"1" type:"integer"`
  2689. // Will only return log groups that match the provided logGroupNamePrefix. If
  2690. // you don't specify a value, no prefix filter is applied.
  2691. LogGroupNamePrefix *string `locationName:"logGroupNamePrefix" min:"1" type:"string"`
  2692. // A string token used for pagination that points to the next page of results.
  2693. // It must be a value obtained from the response of the previous DescribeLogGroups
  2694. // request.
  2695. NextToken *string `locationName:"nextToken" min:"1" type:"string"`
  2696. }
  2697. // String returns the string representation
  2698. func (s DescribeLogGroupsInput) String() string {
  2699. return awsutil.Prettify(s)
  2700. }
  2701. // GoString returns the string representation
  2702. func (s DescribeLogGroupsInput) GoString() string {
  2703. return s.String()
  2704. }
  2705. // Validate inspects the fields of the type to determine if they are valid.
  2706. func (s *DescribeLogGroupsInput) Validate() error {
  2707. invalidParams := request.ErrInvalidParams{Context: "DescribeLogGroupsInput"}
  2708. if s.Limit != nil && *s.Limit < 1 {
  2709. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  2710. }
  2711. if s.LogGroupNamePrefix != nil && len(*s.LogGroupNamePrefix) < 1 {
  2712. invalidParams.Add(request.NewErrParamMinLen("LogGroupNamePrefix", 1))
  2713. }
  2714. if s.NextToken != nil && len(*s.NextToken) < 1 {
  2715. invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
  2716. }
  2717. if invalidParams.Len() > 0 {
  2718. return invalidParams
  2719. }
  2720. return nil
  2721. }
  2722. type DescribeLogGroupsOutput struct {
  2723. _ struct{} `type:"structure"`
  2724. // A list of log groups.
  2725. LogGroups []*LogGroup `locationName:"logGroups" type:"list"`
  2726. // A string token used for pagination that points to the next page of results.
  2727. // It must be a value obtained from the response of the previous request. The
  2728. // token expires after 24 hours.
  2729. NextToken *string `locationName:"nextToken" min:"1" type:"string"`
  2730. }
  2731. // String returns the string representation
  2732. func (s DescribeLogGroupsOutput) String() string {
  2733. return awsutil.Prettify(s)
  2734. }
  2735. // GoString returns the string representation
  2736. func (s DescribeLogGroupsOutput) GoString() string {
  2737. return s.String()
  2738. }
  2739. type DescribeLogStreamsInput struct {
  2740. _ struct{} `type:"structure"`
  2741. // If set to true, results are returned in descending order. If you don't specify
  2742. // a value or set it to false, results are returned in ascending order.
  2743. Descending *bool `locationName:"descending" type:"boolean"`
  2744. // The maximum number of items returned in the response. If you don't specify
  2745. // a value, the request would return up to 50 items.
  2746. Limit *int64 `locationName:"limit" min:"1" type:"integer"`
  2747. // The log group name for which log streams are to be listed.
  2748. //
  2749. // LogGroupName is a required field
  2750. LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"`
  2751. // Will only return log streams that match the provided logStreamNamePrefix.
  2752. // If you don't specify a value, no prefix filter is applied.
  2753. LogStreamNamePrefix *string `locationName:"logStreamNamePrefix" min:"1" type:"string"`
  2754. // A string token used for pagination that points to the next page of results.
  2755. // It must be a value obtained from the response of the previous DescribeLogStreams
  2756. // request.
  2757. NextToken *string `locationName:"nextToken" min:"1" type:"string"`
  2758. // Specifies what to order the returned log streams by. Valid arguments are
  2759. // 'LogStreamName' or 'LastEventTime'. If you don't specify a value, results
  2760. // are ordered by LogStreamName. If 'LastEventTime' is chosen, the request cannot
  2761. // also contain a logStreamNamePrefix.
  2762. OrderBy *string `locationName:"orderBy" type:"string" enum:"OrderBy"`
  2763. }
  2764. // String returns the string representation
  2765. func (s DescribeLogStreamsInput) String() string {
  2766. return awsutil.Prettify(s)
  2767. }
  2768. // GoString returns the string representation
  2769. func (s DescribeLogStreamsInput) GoString() string {
  2770. return s.String()
  2771. }
  2772. // Validate inspects the fields of the type to determine if they are valid.
  2773. func (s *DescribeLogStreamsInput) Validate() error {
  2774. invalidParams := request.ErrInvalidParams{Context: "DescribeLogStreamsInput"}
  2775. if s.Limit != nil && *s.Limit < 1 {
  2776. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  2777. }
  2778. if s.LogGroupName == nil {
  2779. invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
  2780. }
  2781. if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
  2782. invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
  2783. }
  2784. if s.LogStreamNamePrefix != nil && len(*s.LogStreamNamePrefix) < 1 {
  2785. invalidParams.Add(request.NewErrParamMinLen("LogStreamNamePrefix", 1))
  2786. }
  2787. if s.NextToken != nil && len(*s.NextToken) < 1 {
  2788. invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
  2789. }
  2790. if invalidParams.Len() > 0 {
  2791. return invalidParams
  2792. }
  2793. return nil
  2794. }
  2795. type DescribeLogStreamsOutput struct {
  2796. _ struct{} `type:"structure"`
  2797. // A list of log streams.
  2798. LogStreams []*LogStream `locationName:"logStreams" type:"list"`
  2799. // A string token used for pagination that points to the next page of results.
  2800. // It must be a value obtained from the response of the previous request. The
  2801. // token expires after 24 hours.
  2802. NextToken *string `locationName:"nextToken" min:"1" type:"string"`
  2803. }
  2804. // String returns the string representation
  2805. func (s DescribeLogStreamsOutput) String() string {
  2806. return awsutil.Prettify(s)
  2807. }
  2808. // GoString returns the string representation
  2809. func (s DescribeLogStreamsOutput) GoString() string {
  2810. return s.String()
  2811. }
  2812. type DescribeMetricFiltersInput struct {
  2813. _ struct{} `type:"structure"`
  2814. // Will only return metric filters that match the provided filterNamePrefix.
  2815. // If you don't specify a value, no prefix filter is applied.
  2816. FilterNamePrefix *string `locationName:"filterNamePrefix" min:"1" type:"string"`
  2817. // The maximum number of items returned in the response. If you don't specify
  2818. // a value, the request would return up to 50 items.
  2819. Limit *int64 `locationName:"limit" min:"1" type:"integer"`
  2820. // The log group name for which metric filters are to be listed.
  2821. //
  2822. // LogGroupName is a required field
  2823. LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"`
  2824. // A string token used for pagination that points to the next page of results.
  2825. // It must be a value obtained from the response of the previous DescribeMetricFilters
  2826. // request.
  2827. NextToken *string `locationName:"nextToken" min:"1" type:"string"`
  2828. }
  2829. // String returns the string representation
  2830. func (s DescribeMetricFiltersInput) String() string {
  2831. return awsutil.Prettify(s)
  2832. }
  2833. // GoString returns the string representation
  2834. func (s DescribeMetricFiltersInput) GoString() string {
  2835. return s.String()
  2836. }
  2837. // Validate inspects the fields of the type to determine if they are valid.
  2838. func (s *DescribeMetricFiltersInput) Validate() error {
  2839. invalidParams := request.ErrInvalidParams{Context: "DescribeMetricFiltersInput"}
  2840. if s.FilterNamePrefix != nil && len(*s.FilterNamePrefix) < 1 {
  2841. invalidParams.Add(request.NewErrParamMinLen("FilterNamePrefix", 1))
  2842. }
  2843. if s.Limit != nil && *s.Limit < 1 {
  2844. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  2845. }
  2846. if s.LogGroupName == nil {
  2847. invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
  2848. }
  2849. if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
  2850. invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
  2851. }
  2852. if s.NextToken != nil && len(*s.NextToken) < 1 {
  2853. invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
  2854. }
  2855. if invalidParams.Len() > 0 {
  2856. return invalidParams
  2857. }
  2858. return nil
  2859. }
  2860. type DescribeMetricFiltersOutput struct {
  2861. _ struct{} `type:"structure"`
  2862. MetricFilters []*MetricFilter `locationName:"metricFilters" type:"list"`
  2863. // A string token used for pagination that points to the next page of results.
  2864. // It must be a value obtained from the response of the previous request. The
  2865. // token expires after 24 hours.
  2866. NextToken *string `locationName:"nextToken" min:"1" type:"string"`
  2867. }
  2868. // String returns the string representation
  2869. func (s DescribeMetricFiltersOutput) String() string {
  2870. return awsutil.Prettify(s)
  2871. }
  2872. // GoString returns the string representation
  2873. func (s DescribeMetricFiltersOutput) GoString() string {
  2874. return s.String()
  2875. }
  2876. type DescribeSubscriptionFiltersInput struct {
  2877. _ struct{} `type:"structure"`
  2878. // Will only return subscription filters that match the provided filterNamePrefix.
  2879. // If you don't specify a value, no prefix filter is applied.
  2880. FilterNamePrefix *string `locationName:"filterNamePrefix" min:"1" type:"string"`
  2881. // The maximum number of results to return.
  2882. Limit *int64 `locationName:"limit" min:"1" type:"integer"`
  2883. // The log group name for which subscription filters are to be listed.
  2884. //
  2885. // LogGroupName is a required field
  2886. LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"`
  2887. // A string token used for pagination that points to the next page of results.
  2888. // It must be a value obtained from the response of the previous request. The
  2889. // token expires after 24 hours.
  2890. NextToken *string `locationName:"nextToken" min:"1" type:"string"`
  2891. }
  2892. // String returns the string representation
  2893. func (s DescribeSubscriptionFiltersInput) String() string {
  2894. return awsutil.Prettify(s)
  2895. }
  2896. // GoString returns the string representation
  2897. func (s DescribeSubscriptionFiltersInput) GoString() string {
  2898. return s.String()
  2899. }
  2900. // Validate inspects the fields of the type to determine if they are valid.
  2901. func (s *DescribeSubscriptionFiltersInput) Validate() error {
  2902. invalidParams := request.ErrInvalidParams{Context: "DescribeSubscriptionFiltersInput"}
  2903. if s.FilterNamePrefix != nil && len(*s.FilterNamePrefix) < 1 {
  2904. invalidParams.Add(request.NewErrParamMinLen("FilterNamePrefix", 1))
  2905. }
  2906. if s.Limit != nil && *s.Limit < 1 {
  2907. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  2908. }
  2909. if s.LogGroupName == nil {
  2910. invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
  2911. }
  2912. if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
  2913. invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
  2914. }
  2915. if s.NextToken != nil && len(*s.NextToken) < 1 {
  2916. invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
  2917. }
  2918. if invalidParams.Len() > 0 {
  2919. return invalidParams
  2920. }
  2921. return nil
  2922. }
  2923. type DescribeSubscriptionFiltersOutput struct {
  2924. _ struct{} `type:"structure"`
  2925. // A string token used for pagination that points to the next page of results.
  2926. // It must be a value obtained from the response of the previous request. The
  2927. // token expires after 24 hours.
  2928. NextToken *string `locationName:"nextToken" min:"1" type:"string"`
  2929. SubscriptionFilters []*SubscriptionFilter `locationName:"subscriptionFilters" type:"list"`
  2930. }
  2931. // String returns the string representation
  2932. func (s DescribeSubscriptionFiltersOutput) String() string {
  2933. return awsutil.Prettify(s)
  2934. }
  2935. // GoString returns the string representation
  2936. func (s DescribeSubscriptionFiltersOutput) GoString() string {
  2937. return s.String()
  2938. }
  2939. // A cross account destination that is the recipient of subscription log events.
  2940. type Destination struct {
  2941. _ struct{} `type:"structure"`
  2942. // An IAM policy document that governs which AWS accounts can create subscription
  2943. // filters against this destination.
  2944. AccessPolicy *string `locationName:"accessPolicy" min:"1" type:"string"`
  2945. // ARN of this destination.
  2946. Arn *string `locationName:"arn" type:"string"`
  2947. // A point in time expressed as the number of milliseconds since Jan 1, 1970
  2948. // 00:00:00 UTC specifying when this destination was created.
  2949. CreationTime *int64 `locationName:"creationTime" type:"long"`
  2950. // Name of the destination.
  2951. DestinationName *string `locationName:"destinationName" min:"1" type:"string"`
  2952. // A role for impersonation for delivering log events to the target.
  2953. RoleArn *string `locationName:"roleArn" min:"1" type:"string"`
  2954. // ARN of the physical target where the log events will be delivered (eg. ARN
  2955. // of a Kinesis stream).
  2956. TargetArn *string `locationName:"targetArn" min:"1" type:"string"`
  2957. }
  2958. // String returns the string representation
  2959. func (s Destination) String() string {
  2960. return awsutil.Prettify(s)
  2961. }
  2962. // GoString returns the string representation
  2963. func (s Destination) GoString() string {
  2964. return s.String()
  2965. }
  2966. // Represents an export task.
  2967. type ExportTask struct {
  2968. _ struct{} `type:"structure"`
  2969. // Name of Amazon S3 bucket to which the log data was exported.
  2970. Destination *string `locationName:"destination" min:"1" type:"string"`
  2971. // Prefix that was used as the start of Amazon S3 key for every object exported.
  2972. DestinationPrefix *string `locationName:"destinationPrefix" type:"string"`
  2973. // Execution info about the export task.
  2974. ExecutionInfo *ExportTaskExecutionInfo `locationName:"executionInfo" type:"structure"`
  2975. // A point in time expressed as the number of milliseconds since Jan 1, 1970
  2976. // 00:00:00 UTC. Events with a timestamp prior to this time are not exported.
  2977. From *int64 `locationName:"from" type:"long"`
  2978. // The name of the log group from which logs data was exported.
  2979. LogGroupName *string `locationName:"logGroupName" min:"1" type:"string"`
  2980. // Status of the export task.
  2981. Status *ExportTaskStatus `locationName:"status" type:"structure"`
  2982. // Id of the export task.
  2983. TaskId *string `locationName:"taskId" min:"1" type:"string"`
  2984. // The name of the export task.
  2985. TaskName *string `locationName:"taskName" min:"1" type:"string"`
  2986. // A point in time expressed as the number of milliseconds since Jan 1, 1970
  2987. // 00:00:00 UTC. Events with a timestamp later than this time are not exported.
  2988. To *int64 `locationName:"to" type:"long"`
  2989. }
  2990. // String returns the string representation
  2991. func (s ExportTask) String() string {
  2992. return awsutil.Prettify(s)
  2993. }
  2994. // GoString returns the string representation
  2995. func (s ExportTask) GoString() string {
  2996. return s.String()
  2997. }
  2998. // Represents the status of an export task.
  2999. type ExportTaskExecutionInfo struct {
  3000. _ struct{} `type:"structure"`
  3001. // A point in time when the export task got completed.
  3002. CompletionTime *int64 `locationName:"completionTime" type:"long"`
  3003. // A point in time when the export task got created.
  3004. CreationTime *int64 `locationName:"creationTime" type:"long"`
  3005. }
  3006. // String returns the string representation
  3007. func (s ExportTaskExecutionInfo) String() string {
  3008. return awsutil.Prettify(s)
  3009. }
  3010. // GoString returns the string representation
  3011. func (s ExportTaskExecutionInfo) GoString() string {
  3012. return s.String()
  3013. }
  3014. // Represents the status of an export task.
  3015. type ExportTaskStatus struct {
  3016. _ struct{} `type:"structure"`
  3017. // Status code of the export task.
  3018. Code *string `locationName:"code" type:"string" enum:"ExportTaskStatusCode"`
  3019. // Status message related to the code.
  3020. Message *string `locationName:"message" type:"string"`
  3021. }
  3022. // String returns the string representation
  3023. func (s ExportTaskStatus) String() string {
  3024. return awsutil.Prettify(s)
  3025. }
  3026. // GoString returns the string representation
  3027. func (s ExportTaskStatus) GoString() string {
  3028. return s.String()
  3029. }
  3030. type FilterLogEventsInput struct {
  3031. _ struct{} `type:"structure"`
  3032. // A point in time expressed as the number of milliseconds since Jan 1, 1970
  3033. // 00:00:00 UTC. If provided, events with a timestamp later than this time are
  3034. // not returned.
  3035. EndTime *int64 `locationName:"endTime" type:"long"`
  3036. // A valid CloudWatch Logs filter pattern to use for filtering the response.
  3037. // If not provided, all the events are matched.
  3038. FilterPattern *string `locationName:"filterPattern" type:"string"`
  3039. // If provided, the API will make a best effort to provide responses that contain
  3040. // events from multiple log streams within the log group interleaved in a single
  3041. // response. If not provided, all the matched log events in the first log stream
  3042. // will be searched first, then those in the next log stream, etc.
  3043. Interleaved *bool `locationName:"interleaved" type:"boolean"`
  3044. // The maximum number of events to return in a page of results. Default is 10,000
  3045. // events.
  3046. Limit *int64 `locationName:"limit" min:"1" type:"integer"`
  3047. // The name of the log group to query.
  3048. //
  3049. // LogGroupName is a required field
  3050. LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"`
  3051. // Optional list of log stream names within the specified log group to search.
  3052. // Defaults to all the log streams in the log group.
  3053. LogStreamNames []*string `locationName:"logStreamNames" min:"1" type:"list"`
  3054. // A pagination token obtained from a FilterLogEvents response to continue paginating
  3055. // the FilterLogEvents results. This token is omitted from the response when
  3056. // there are no other events to display.
  3057. NextToken *string `locationName:"nextToken" min:"1" type:"string"`
  3058. // A point in time expressed as the number of milliseconds since Jan 1, 1970
  3059. // 00:00:00 UTC. If provided, events with a timestamp prior to this time are
  3060. // not returned.
  3061. StartTime *int64 `locationName:"startTime" type:"long"`
  3062. }
  3063. // String returns the string representation
  3064. func (s FilterLogEventsInput) String() string {
  3065. return awsutil.Prettify(s)
  3066. }
  3067. // GoString returns the string representation
  3068. func (s FilterLogEventsInput) GoString() string {
  3069. return s.String()
  3070. }
  3071. // Validate inspects the fields of the type to determine if they are valid.
  3072. func (s *FilterLogEventsInput) Validate() error {
  3073. invalidParams := request.ErrInvalidParams{Context: "FilterLogEventsInput"}
  3074. if s.Limit != nil && *s.Limit < 1 {
  3075. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  3076. }
  3077. if s.LogGroupName == nil {
  3078. invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
  3079. }
  3080. if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
  3081. invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
  3082. }
  3083. if s.LogStreamNames != nil && len(s.LogStreamNames) < 1 {
  3084. invalidParams.Add(request.NewErrParamMinLen("LogStreamNames", 1))
  3085. }
  3086. if s.NextToken != nil && len(*s.NextToken) < 1 {
  3087. invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
  3088. }
  3089. if invalidParams.Len() > 0 {
  3090. return invalidParams
  3091. }
  3092. return nil
  3093. }
  3094. type FilterLogEventsOutput struct {
  3095. _ struct{} `type:"structure"`
  3096. // A list of FilteredLogEvent objects representing the matched events from the
  3097. // request.
  3098. Events []*FilteredLogEvent `locationName:"events" type:"list"`
  3099. // A pagination token obtained from a FilterLogEvents response to continue paginating
  3100. // the FilterLogEvents results. This token is omitted from the response when
  3101. // there are no other events to display.
  3102. NextToken *string `locationName:"nextToken" min:"1" type:"string"`
  3103. // A list of SearchedLogStream objects indicating which log streams have been
  3104. // searched in this request and whether each has been searched completely or
  3105. // still has more to be paginated.
  3106. SearchedLogStreams []*SearchedLogStream `locationName:"searchedLogStreams" type:"list"`
  3107. }
  3108. // String returns the string representation
  3109. func (s FilterLogEventsOutput) String() string {
  3110. return awsutil.Prettify(s)
  3111. }
  3112. // GoString returns the string representation
  3113. func (s FilterLogEventsOutput) GoString() string {
  3114. return s.String()
  3115. }
  3116. // Represents a matched event from a FilterLogEvents request.
  3117. type FilteredLogEvent struct {
  3118. _ struct{} `type:"structure"`
  3119. // A unique identifier for this event.
  3120. EventId *string `locationName:"eventId" type:"string"`
  3121. // A point in time expressed as the number of milliseconds since Jan 1, 1970
  3122. // 00:00:00 UTC.
  3123. IngestionTime *int64 `locationName:"ingestionTime" type:"long"`
  3124. // The name of the log stream this event belongs to.
  3125. LogStreamName *string `locationName:"logStreamName" min:"1" type:"string"`
  3126. // The data contained in the log event.
  3127. Message *string `locationName:"message" min:"1" type:"string"`
  3128. // A point in time expressed as the number of milliseconds since Jan 1, 1970
  3129. // 00:00:00 UTC.
  3130. Timestamp *int64 `locationName:"timestamp" type:"long"`
  3131. }
  3132. // String returns the string representation
  3133. func (s FilteredLogEvent) String() string {
  3134. return awsutil.Prettify(s)
  3135. }
  3136. // GoString returns the string representation
  3137. func (s FilteredLogEvent) GoString() string {
  3138. return s.String()
  3139. }
  3140. type GetLogEventsInput struct {
  3141. _ struct{} `type:"structure"`
  3142. // A point in time expressed as the number of milliseconds since Jan 1, 1970
  3143. // 00:00:00 UTC.
  3144. EndTime *int64 `locationName:"endTime" type:"long"`
  3145. // The maximum number of log events returned in the response. If you don't specify
  3146. // a value, the request would return as many log events as can fit in a response
  3147. // size of 1MB, up to 10,000 log events.
  3148. Limit *int64 `locationName:"limit" min:"1" type:"integer"`
  3149. // The name of the log group to query.
  3150. //
  3151. // LogGroupName is a required field
  3152. LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"`
  3153. // The name of the log stream to query.
  3154. //
  3155. // LogStreamName is a required field
  3156. LogStreamName *string `locationName:"logStreamName" min:"1" type:"string" required:"true"`
  3157. // A string token used for pagination that points to the next page of results.
  3158. // It must be a value obtained from the nextForwardToken or nextBackwardToken
  3159. // fields in the response of the previous GetLogEvents request.
  3160. NextToken *string `locationName:"nextToken" min:"1" type:"string"`
  3161. // If set to true, the earliest log events would be returned first. The default
  3162. // is false (the latest log events are returned first).
  3163. StartFromHead *bool `locationName:"startFromHead" type:"boolean"`
  3164. // A point in time expressed as the number of milliseconds since Jan 1, 1970
  3165. // 00:00:00 UTC.
  3166. StartTime *int64 `locationName:"startTime" type:"long"`
  3167. }
  3168. // String returns the string representation
  3169. func (s GetLogEventsInput) String() string {
  3170. return awsutil.Prettify(s)
  3171. }
  3172. // GoString returns the string representation
  3173. func (s GetLogEventsInput) GoString() string {
  3174. return s.String()
  3175. }
  3176. // Validate inspects the fields of the type to determine if they are valid.
  3177. func (s *GetLogEventsInput) Validate() error {
  3178. invalidParams := request.ErrInvalidParams{Context: "GetLogEventsInput"}
  3179. if s.Limit != nil && *s.Limit < 1 {
  3180. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  3181. }
  3182. if s.LogGroupName == nil {
  3183. invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
  3184. }
  3185. if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
  3186. invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
  3187. }
  3188. if s.LogStreamName == nil {
  3189. invalidParams.Add(request.NewErrParamRequired("LogStreamName"))
  3190. }
  3191. if s.LogStreamName != nil && len(*s.LogStreamName) < 1 {
  3192. invalidParams.Add(request.NewErrParamMinLen("LogStreamName", 1))
  3193. }
  3194. if s.NextToken != nil && len(*s.NextToken) < 1 {
  3195. invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
  3196. }
  3197. if invalidParams.Len() > 0 {
  3198. return invalidParams
  3199. }
  3200. return nil
  3201. }
  3202. type GetLogEventsOutput struct {
  3203. _ struct{} `type:"structure"`
  3204. Events []*OutputLogEvent `locationName:"events" type:"list"`
  3205. // A string token used for pagination that points to the next page of results.
  3206. // It must be a value obtained from the response of the previous request. The
  3207. // token expires after 24 hours.
  3208. NextBackwardToken *string `locationName:"nextBackwardToken" min:"1" type:"string"`
  3209. // A string token used for pagination that points to the next page of results.
  3210. // It must be a value obtained from the response of the previous request. The
  3211. // token expires after 24 hours.
  3212. NextForwardToken *string `locationName:"nextForwardToken" min:"1" type:"string"`
  3213. }
  3214. // String returns the string representation
  3215. func (s GetLogEventsOutput) String() string {
  3216. return awsutil.Prettify(s)
  3217. }
  3218. // GoString returns the string representation
  3219. func (s GetLogEventsOutput) GoString() string {
  3220. return s.String()
  3221. }
  3222. // A log event is a record of some activity that was recorded by the application
  3223. // or resource being monitored. The log event record that CloudWatch Logs understands
  3224. // contains two properties: the timestamp of when the event occurred, and the
  3225. // raw event message.
  3226. type InputLogEvent struct {
  3227. _ struct{} `type:"structure"`
  3228. // Message is a required field
  3229. Message *string `locationName:"message" min:"1" type:"string" required:"true"`
  3230. // A point in time expressed as the number of milliseconds since Jan 1, 1970
  3231. // 00:00:00 UTC.
  3232. //
  3233. // Timestamp is a required field
  3234. Timestamp *int64 `locationName:"timestamp" type:"long" required:"true"`
  3235. }
  3236. // String returns the string representation
  3237. func (s InputLogEvent) String() string {
  3238. return awsutil.Prettify(s)
  3239. }
  3240. // GoString returns the string representation
  3241. func (s InputLogEvent) GoString() string {
  3242. return s.String()
  3243. }
  3244. // Validate inspects the fields of the type to determine if they are valid.
  3245. func (s *InputLogEvent) Validate() error {
  3246. invalidParams := request.ErrInvalidParams{Context: "InputLogEvent"}
  3247. if s.Message == nil {
  3248. invalidParams.Add(request.NewErrParamRequired("Message"))
  3249. }
  3250. if s.Message != nil && len(*s.Message) < 1 {
  3251. invalidParams.Add(request.NewErrParamMinLen("Message", 1))
  3252. }
  3253. if s.Timestamp == nil {
  3254. invalidParams.Add(request.NewErrParamRequired("Timestamp"))
  3255. }
  3256. if invalidParams.Len() > 0 {
  3257. return invalidParams
  3258. }
  3259. return nil
  3260. }
  3261. type LogGroup struct {
  3262. _ struct{} `type:"structure"`
  3263. Arn *string `locationName:"arn" type:"string"`
  3264. // A point in time expressed as the number of milliseconds since Jan 1, 1970
  3265. // 00:00:00 UTC.
  3266. CreationTime *int64 `locationName:"creationTime" type:"long"`
  3267. LogGroupName *string `locationName:"logGroupName" min:"1" type:"string"`
  3268. // The number of metric filters associated with the log group.
  3269. MetricFilterCount *int64 `locationName:"metricFilterCount" type:"integer"`
  3270. // Specifies the number of days you want to retain log events in the specified
  3271. // log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180,
  3272. // 365, 400, 545, 731, 1827, 3653.
  3273. RetentionInDays *int64 `locationName:"retentionInDays" type:"integer"`
  3274. StoredBytes *int64 `locationName:"storedBytes" type:"long"`
  3275. }
  3276. // String returns the string representation
  3277. func (s LogGroup) String() string {
  3278. return awsutil.Prettify(s)
  3279. }
  3280. // GoString returns the string representation
  3281. func (s LogGroup) GoString() string {
  3282. return s.String()
  3283. }
  3284. // A log stream is sequence of log events from a single emitter of logs.
  3285. type LogStream struct {
  3286. _ struct{} `type:"structure"`
  3287. Arn *string `locationName:"arn" type:"string"`
  3288. // A point in time expressed as the number of milliseconds since Jan 1, 1970
  3289. // 00:00:00 UTC.
  3290. CreationTime *int64 `locationName:"creationTime" type:"long"`
  3291. // A point in time expressed as the number of milliseconds since Jan 1, 1970
  3292. // 00:00:00 UTC.
  3293. FirstEventTimestamp *int64 `locationName:"firstEventTimestamp" type:"long"`
  3294. // A point in time expressed as the number of milliseconds since Jan 1, 1970
  3295. // 00:00:00 UTC.
  3296. LastEventTimestamp *int64 `locationName:"lastEventTimestamp" type:"long"`
  3297. // A point in time expressed as the number of milliseconds since Jan 1, 1970
  3298. // 00:00:00 UTC.
  3299. LastIngestionTime *int64 `locationName:"lastIngestionTime" type:"long"`
  3300. LogStreamName *string `locationName:"logStreamName" min:"1" type:"string"`
  3301. StoredBytes *int64 `locationName:"storedBytes" type:"long"`
  3302. // A string token used for making PutLogEvents requests. A sequenceToken can
  3303. // only be used once, and PutLogEvents requests must include the sequenceToken
  3304. // obtained from the response of the previous request.
  3305. UploadSequenceToken *string `locationName:"uploadSequenceToken" min:"1" type:"string"`
  3306. }
  3307. // String returns the string representation
  3308. func (s LogStream) String() string {
  3309. return awsutil.Prettify(s)
  3310. }
  3311. // GoString returns the string representation
  3312. func (s LogStream) GoString() string {
  3313. return s.String()
  3314. }
  3315. // Metric filters can be used to express how CloudWatch Logs would extract metric
  3316. // observations from ingested log events and transform them to metric data in
  3317. // a CloudWatch metric.
  3318. type MetricFilter struct {
  3319. _ struct{} `type:"structure"`
  3320. // A point in time expressed as the number of milliseconds since Jan 1, 1970
  3321. // 00:00:00 UTC.
  3322. CreationTime *int64 `locationName:"creationTime" type:"long"`
  3323. // A name for a metric or subscription filter.
  3324. FilterName *string `locationName:"filterName" min:"1" type:"string"`
  3325. // A symbolic description of how CloudWatch Logs should interpret the data in
  3326. // each log event. For example, a log event may contain timestamps, IP addresses,
  3327. // strings, and so on. You use the filter pattern to specify what to look for
  3328. // in the log event message.
  3329. FilterPattern *string `locationName:"filterPattern" type:"string"`
  3330. MetricTransformations []*MetricTransformation `locationName:"metricTransformations" min:"1" type:"list"`
  3331. }
  3332. // String returns the string representation
  3333. func (s MetricFilter) String() string {
  3334. return awsutil.Prettify(s)
  3335. }
  3336. // GoString returns the string representation
  3337. func (s MetricFilter) GoString() string {
  3338. return s.String()
  3339. }
  3340. type MetricFilterMatchRecord struct {
  3341. _ struct{} `type:"structure"`
  3342. EventMessage *string `locationName:"eventMessage" min:"1" type:"string"`
  3343. EventNumber *int64 `locationName:"eventNumber" type:"long"`
  3344. ExtractedValues map[string]*string `locationName:"extractedValues" type:"map"`
  3345. }
  3346. // String returns the string representation
  3347. func (s MetricFilterMatchRecord) String() string {
  3348. return awsutil.Prettify(s)
  3349. }
  3350. // GoString returns the string representation
  3351. func (s MetricFilterMatchRecord) GoString() string {
  3352. return s.String()
  3353. }
  3354. type MetricTransformation struct {
  3355. _ struct{} `type:"structure"`
  3356. // (Optional) A default value to emit when a filter pattern does not match a
  3357. // log event. Can be null.
  3358. DefaultValue *float64 `locationName:"defaultValue" type:"double"`
  3359. // Name of the metric.
  3360. //
  3361. // MetricName is a required field
  3362. MetricName *string `locationName:"metricName" type:"string" required:"true"`
  3363. // Namespace to which the metric belongs.
  3364. //
  3365. // MetricNamespace is a required field
  3366. MetricNamespace *string `locationName:"metricNamespace" type:"string" required:"true"`
  3367. // A string representing a value to publish to this metric when a filter pattern
  3368. // matches a log event.
  3369. //
  3370. // MetricValue is a required field
  3371. MetricValue *string `locationName:"metricValue" type:"string" required:"true"`
  3372. }
  3373. // String returns the string representation
  3374. func (s MetricTransformation) String() string {
  3375. return awsutil.Prettify(s)
  3376. }
  3377. // GoString returns the string representation
  3378. func (s MetricTransformation) GoString() string {
  3379. return s.String()
  3380. }
  3381. // Validate inspects the fields of the type to determine if they are valid.
  3382. func (s *MetricTransformation) Validate() error {
  3383. invalidParams := request.ErrInvalidParams{Context: "MetricTransformation"}
  3384. if s.MetricName == nil {
  3385. invalidParams.Add(request.NewErrParamRequired("MetricName"))
  3386. }
  3387. if s.MetricNamespace == nil {
  3388. invalidParams.Add(request.NewErrParamRequired("MetricNamespace"))
  3389. }
  3390. if s.MetricValue == nil {
  3391. invalidParams.Add(request.NewErrParamRequired("MetricValue"))
  3392. }
  3393. if invalidParams.Len() > 0 {
  3394. return invalidParams
  3395. }
  3396. return nil
  3397. }
  3398. type OutputLogEvent struct {
  3399. _ struct{} `type:"structure"`
  3400. // A point in time expressed as the number of milliseconds since Jan 1, 1970
  3401. // 00:00:00 UTC.
  3402. IngestionTime *int64 `locationName:"ingestionTime" type:"long"`
  3403. Message *string `locationName:"message" min:"1" type:"string"`
  3404. // A point in time expressed as the number of milliseconds since Jan 1, 1970
  3405. // 00:00:00 UTC.
  3406. Timestamp *int64 `locationName:"timestamp" type:"long"`
  3407. }
  3408. // String returns the string representation
  3409. func (s OutputLogEvent) String() string {
  3410. return awsutil.Prettify(s)
  3411. }
  3412. // GoString returns the string representation
  3413. func (s OutputLogEvent) GoString() string {
  3414. return s.String()
  3415. }
  3416. type PutDestinationInput struct {
  3417. _ struct{} `type:"structure"`
  3418. // A name for the destination.
  3419. //
  3420. // DestinationName is a required field
  3421. DestinationName *string `locationName:"destinationName" min:"1" type:"string" required:"true"`
  3422. // The ARN of an IAM role that grants CloudWatch Logs permissions to do Amazon
  3423. // Kinesis PutRecord requests on the destination stream.
  3424. //
  3425. // RoleArn is a required field
  3426. RoleArn *string `locationName:"roleArn" min:"1" type:"string" required:"true"`
  3427. // The ARN of an Amazon Kinesis stream to deliver matching log events to.
  3428. //
  3429. // TargetArn is a required field
  3430. TargetArn *string `locationName:"targetArn" min:"1" type:"string" required:"true"`
  3431. }
  3432. // String returns the string representation
  3433. func (s PutDestinationInput) String() string {
  3434. return awsutil.Prettify(s)
  3435. }
  3436. // GoString returns the string representation
  3437. func (s PutDestinationInput) GoString() string {
  3438. return s.String()
  3439. }
  3440. // Validate inspects the fields of the type to determine if they are valid.
  3441. func (s *PutDestinationInput) Validate() error {
  3442. invalidParams := request.ErrInvalidParams{Context: "PutDestinationInput"}
  3443. if s.DestinationName == nil {
  3444. invalidParams.Add(request.NewErrParamRequired("DestinationName"))
  3445. }
  3446. if s.DestinationName != nil && len(*s.DestinationName) < 1 {
  3447. invalidParams.Add(request.NewErrParamMinLen("DestinationName", 1))
  3448. }
  3449. if s.RoleArn == nil {
  3450. invalidParams.Add(request.NewErrParamRequired("RoleArn"))
  3451. }
  3452. if s.RoleArn != nil && len(*s.RoleArn) < 1 {
  3453. invalidParams.Add(request.NewErrParamMinLen("RoleArn", 1))
  3454. }
  3455. if s.TargetArn == nil {
  3456. invalidParams.Add(request.NewErrParamRequired("TargetArn"))
  3457. }
  3458. if s.TargetArn != nil && len(*s.TargetArn) < 1 {
  3459. invalidParams.Add(request.NewErrParamMinLen("TargetArn", 1))
  3460. }
  3461. if invalidParams.Len() > 0 {
  3462. return invalidParams
  3463. }
  3464. return nil
  3465. }
  3466. type PutDestinationOutput struct {
  3467. _ struct{} `type:"structure"`
  3468. // A cross account destination that is the recipient of subscription log events.
  3469. Destination *Destination `locationName:"destination" type:"structure"`
  3470. }
  3471. // String returns the string representation
  3472. func (s PutDestinationOutput) String() string {
  3473. return awsutil.Prettify(s)
  3474. }
  3475. // GoString returns the string representation
  3476. func (s PutDestinationOutput) GoString() string {
  3477. return s.String()
  3478. }
  3479. type PutDestinationPolicyInput struct {
  3480. _ struct{} `type:"structure"`
  3481. // An IAM policy document that authorizes cross-account users to deliver their
  3482. // log events to associated destination.
  3483. //
  3484. // AccessPolicy is a required field
  3485. AccessPolicy *string `locationName:"accessPolicy" min:"1" type:"string" required:"true"`
  3486. // A name for an existing destination.
  3487. //
  3488. // DestinationName is a required field
  3489. DestinationName *string `locationName:"destinationName" min:"1" type:"string" required:"true"`
  3490. }
  3491. // String returns the string representation
  3492. func (s PutDestinationPolicyInput) String() string {
  3493. return awsutil.Prettify(s)
  3494. }
  3495. // GoString returns the string representation
  3496. func (s PutDestinationPolicyInput) GoString() string {
  3497. return s.String()
  3498. }
  3499. // Validate inspects the fields of the type to determine if they are valid.
  3500. func (s *PutDestinationPolicyInput) Validate() error {
  3501. invalidParams := request.ErrInvalidParams{Context: "PutDestinationPolicyInput"}
  3502. if s.AccessPolicy == nil {
  3503. invalidParams.Add(request.NewErrParamRequired("AccessPolicy"))
  3504. }
  3505. if s.AccessPolicy != nil && len(*s.AccessPolicy) < 1 {
  3506. invalidParams.Add(request.NewErrParamMinLen("AccessPolicy", 1))
  3507. }
  3508. if s.DestinationName == nil {
  3509. invalidParams.Add(request.NewErrParamRequired("DestinationName"))
  3510. }
  3511. if s.DestinationName != nil && len(*s.DestinationName) < 1 {
  3512. invalidParams.Add(request.NewErrParamMinLen("DestinationName", 1))
  3513. }
  3514. if invalidParams.Len() > 0 {
  3515. return invalidParams
  3516. }
  3517. return nil
  3518. }
  3519. type PutDestinationPolicyOutput struct {
  3520. _ struct{} `type:"structure"`
  3521. }
  3522. // String returns the string representation
  3523. func (s PutDestinationPolicyOutput) String() string {
  3524. return awsutil.Prettify(s)
  3525. }
  3526. // GoString returns the string representation
  3527. func (s PutDestinationPolicyOutput) GoString() string {
  3528. return s.String()
  3529. }
  3530. type PutLogEventsInput struct {
  3531. _ struct{} `type:"structure"`
  3532. // A list of log events belonging to a log stream.
  3533. //
  3534. // LogEvents is a required field
  3535. LogEvents []*InputLogEvent `locationName:"logEvents" min:"1" type:"list" required:"true"`
  3536. // The name of the log group to put log events to.
  3537. //
  3538. // LogGroupName is a required field
  3539. LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"`
  3540. // The name of the log stream to put log events to.
  3541. //
  3542. // LogStreamName is a required field
  3543. LogStreamName *string `locationName:"logStreamName" min:"1" type:"string" required:"true"`
  3544. // A string token that must be obtained from the response of the previous PutLogEvents
  3545. // request.
  3546. SequenceToken *string `locationName:"sequenceToken" min:"1" type:"string"`
  3547. }
  3548. // String returns the string representation
  3549. func (s PutLogEventsInput) String() string {
  3550. return awsutil.Prettify(s)
  3551. }
  3552. // GoString returns the string representation
  3553. func (s PutLogEventsInput) GoString() string {
  3554. return s.String()
  3555. }
  3556. // Validate inspects the fields of the type to determine if they are valid.
  3557. func (s *PutLogEventsInput) Validate() error {
  3558. invalidParams := request.ErrInvalidParams{Context: "PutLogEventsInput"}
  3559. if s.LogEvents == nil {
  3560. invalidParams.Add(request.NewErrParamRequired("LogEvents"))
  3561. }
  3562. if s.LogEvents != nil && len(s.LogEvents) < 1 {
  3563. invalidParams.Add(request.NewErrParamMinLen("LogEvents", 1))
  3564. }
  3565. if s.LogGroupName == nil {
  3566. invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
  3567. }
  3568. if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
  3569. invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
  3570. }
  3571. if s.LogStreamName == nil {
  3572. invalidParams.Add(request.NewErrParamRequired("LogStreamName"))
  3573. }
  3574. if s.LogStreamName != nil && len(*s.LogStreamName) < 1 {
  3575. invalidParams.Add(request.NewErrParamMinLen("LogStreamName", 1))
  3576. }
  3577. if s.SequenceToken != nil && len(*s.SequenceToken) < 1 {
  3578. invalidParams.Add(request.NewErrParamMinLen("SequenceToken", 1))
  3579. }
  3580. if s.LogEvents != nil {
  3581. for i, v := range s.LogEvents {
  3582. if v == nil {
  3583. continue
  3584. }
  3585. if err := v.Validate(); err != nil {
  3586. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LogEvents", i), err.(request.ErrInvalidParams))
  3587. }
  3588. }
  3589. }
  3590. if invalidParams.Len() > 0 {
  3591. return invalidParams
  3592. }
  3593. return nil
  3594. }
  3595. type PutLogEventsOutput struct {
  3596. _ struct{} `type:"structure"`
  3597. // A string token used for making PutLogEvents requests. A sequenceToken can
  3598. // only be used once, and PutLogEvents requests must include the sequenceToken
  3599. // obtained from the response of the previous request.
  3600. NextSequenceToken *string `locationName:"nextSequenceToken" min:"1" type:"string"`
  3601. RejectedLogEventsInfo *RejectedLogEventsInfo `locationName:"rejectedLogEventsInfo" type:"structure"`
  3602. }
  3603. // String returns the string representation
  3604. func (s PutLogEventsOutput) String() string {
  3605. return awsutil.Prettify(s)
  3606. }
  3607. // GoString returns the string representation
  3608. func (s PutLogEventsOutput) GoString() string {
  3609. return s.String()
  3610. }
  3611. type PutMetricFilterInput struct {
  3612. _ struct{} `type:"structure"`
  3613. // A name for the metric filter.
  3614. //
  3615. // FilterName is a required field
  3616. FilterName *string `locationName:"filterName" min:"1" type:"string" required:"true"`
  3617. // A valid CloudWatch Logs filter pattern for extracting metric data out of
  3618. // ingested log events.
  3619. //
  3620. // FilterPattern is a required field
  3621. FilterPattern *string `locationName:"filterPattern" type:"string" required:"true"`
  3622. // The name of the log group to associate the metric filter with.
  3623. //
  3624. // LogGroupName is a required field
  3625. LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"`
  3626. // A collection of information needed to define how metric data gets emitted.
  3627. //
  3628. // MetricTransformations is a required field
  3629. MetricTransformations []*MetricTransformation `locationName:"metricTransformations" min:"1" type:"list" required:"true"`
  3630. }
  3631. // String returns the string representation
  3632. func (s PutMetricFilterInput) String() string {
  3633. return awsutil.Prettify(s)
  3634. }
  3635. // GoString returns the string representation
  3636. func (s PutMetricFilterInput) GoString() string {
  3637. return s.String()
  3638. }
  3639. // Validate inspects the fields of the type to determine if they are valid.
  3640. func (s *PutMetricFilterInput) Validate() error {
  3641. invalidParams := request.ErrInvalidParams{Context: "PutMetricFilterInput"}
  3642. if s.FilterName == nil {
  3643. invalidParams.Add(request.NewErrParamRequired("FilterName"))
  3644. }
  3645. if s.FilterName != nil && len(*s.FilterName) < 1 {
  3646. invalidParams.Add(request.NewErrParamMinLen("FilterName", 1))
  3647. }
  3648. if s.FilterPattern == nil {
  3649. invalidParams.Add(request.NewErrParamRequired("FilterPattern"))
  3650. }
  3651. if s.LogGroupName == nil {
  3652. invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
  3653. }
  3654. if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
  3655. invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
  3656. }
  3657. if s.MetricTransformations == nil {
  3658. invalidParams.Add(request.NewErrParamRequired("MetricTransformations"))
  3659. }
  3660. if s.MetricTransformations != nil && len(s.MetricTransformations) < 1 {
  3661. invalidParams.Add(request.NewErrParamMinLen("MetricTransformations", 1))
  3662. }
  3663. if s.MetricTransformations != nil {
  3664. for i, v := range s.MetricTransformations {
  3665. if v == nil {
  3666. continue
  3667. }
  3668. if err := v.Validate(); err != nil {
  3669. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MetricTransformations", i), err.(request.ErrInvalidParams))
  3670. }
  3671. }
  3672. }
  3673. if invalidParams.Len() > 0 {
  3674. return invalidParams
  3675. }
  3676. return nil
  3677. }
  3678. type PutMetricFilterOutput struct {
  3679. _ struct{} `type:"structure"`
  3680. }
  3681. // String returns the string representation
  3682. func (s PutMetricFilterOutput) String() string {
  3683. return awsutil.Prettify(s)
  3684. }
  3685. // GoString returns the string representation
  3686. func (s PutMetricFilterOutput) GoString() string {
  3687. return s.String()
  3688. }
  3689. type PutRetentionPolicyInput struct {
  3690. _ struct{} `type:"structure"`
  3691. // The name of the log group to associate the retention policy with.
  3692. //
  3693. // LogGroupName is a required field
  3694. LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"`
  3695. // Specifies the number of days you want to retain log events in the specified
  3696. // log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180,
  3697. // 365, 400, 545, 731, 1827, 3653.
  3698. //
  3699. // RetentionInDays is a required field
  3700. RetentionInDays *int64 `locationName:"retentionInDays" type:"integer" required:"true"`
  3701. }
  3702. // String returns the string representation
  3703. func (s PutRetentionPolicyInput) String() string {
  3704. return awsutil.Prettify(s)
  3705. }
  3706. // GoString returns the string representation
  3707. func (s PutRetentionPolicyInput) GoString() string {
  3708. return s.String()
  3709. }
  3710. // Validate inspects the fields of the type to determine if they are valid.
  3711. func (s *PutRetentionPolicyInput) Validate() error {
  3712. invalidParams := request.ErrInvalidParams{Context: "PutRetentionPolicyInput"}
  3713. if s.LogGroupName == nil {
  3714. invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
  3715. }
  3716. if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
  3717. invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
  3718. }
  3719. if s.RetentionInDays == nil {
  3720. invalidParams.Add(request.NewErrParamRequired("RetentionInDays"))
  3721. }
  3722. if invalidParams.Len() > 0 {
  3723. return invalidParams
  3724. }
  3725. return nil
  3726. }
  3727. type PutRetentionPolicyOutput struct {
  3728. _ struct{} `type:"structure"`
  3729. }
  3730. // String returns the string representation
  3731. func (s PutRetentionPolicyOutput) String() string {
  3732. return awsutil.Prettify(s)
  3733. }
  3734. // GoString returns the string representation
  3735. func (s PutRetentionPolicyOutput) GoString() string {
  3736. return s.String()
  3737. }
  3738. type PutSubscriptionFilterInput struct {
  3739. _ struct{} `type:"structure"`
  3740. // The ARN of the destination to deliver matching log events to. Currently,
  3741. // the supported destinations are:
  3742. //
  3743. // * An Amazon Kinesis stream belonging to the same account as the subscription
  3744. // filter, for same-account delivery.
  3745. //
  3746. // * A logical destination (used via an ARN of Destination) belonging to
  3747. // a different account, for cross-account delivery.
  3748. //
  3749. // * An Amazon Kinesis Firehose stream belonging to the same account as the
  3750. // subscription filter, for same-account delivery.
  3751. //
  3752. // * An AWS Lambda function belonging to the same account as the subscription
  3753. // filter, for same-account delivery.
  3754. //
  3755. // DestinationArn is a required field
  3756. DestinationArn *string `locationName:"destinationArn" min:"1" type:"string" required:"true"`
  3757. // A name for the subscription filter.
  3758. //
  3759. // FilterName is a required field
  3760. FilterName *string `locationName:"filterName" min:"1" type:"string" required:"true"`
  3761. // A valid CloudWatch Logs filter pattern for subscribing to a filtered stream
  3762. // of log events.
  3763. //
  3764. // FilterPattern is a required field
  3765. FilterPattern *string `locationName:"filterPattern" type:"string" required:"true"`
  3766. // The name of the log group to associate the subscription filter with.
  3767. //
  3768. // LogGroupName is a required field
  3769. LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"`
  3770. // The ARN of an IAM role that grants CloudWatch Logs permissions to deliver
  3771. // ingested log events to the destination stream. You don't need to provide
  3772. // the ARN when you are working with a logical destination (used via an ARN
  3773. // of Destination) for cross-account delivery.
  3774. RoleArn *string `locationName:"roleArn" min:"1" type:"string"`
  3775. }
  3776. // String returns the string representation
  3777. func (s PutSubscriptionFilterInput) String() string {
  3778. return awsutil.Prettify(s)
  3779. }
  3780. // GoString returns the string representation
  3781. func (s PutSubscriptionFilterInput) GoString() string {
  3782. return s.String()
  3783. }
  3784. // Validate inspects the fields of the type to determine if they are valid.
  3785. func (s *PutSubscriptionFilterInput) Validate() error {
  3786. invalidParams := request.ErrInvalidParams{Context: "PutSubscriptionFilterInput"}
  3787. if s.DestinationArn == nil {
  3788. invalidParams.Add(request.NewErrParamRequired("DestinationArn"))
  3789. }
  3790. if s.DestinationArn != nil && len(*s.DestinationArn) < 1 {
  3791. invalidParams.Add(request.NewErrParamMinLen("DestinationArn", 1))
  3792. }
  3793. if s.FilterName == nil {
  3794. invalidParams.Add(request.NewErrParamRequired("FilterName"))
  3795. }
  3796. if s.FilterName != nil && len(*s.FilterName) < 1 {
  3797. invalidParams.Add(request.NewErrParamMinLen("FilterName", 1))
  3798. }
  3799. if s.FilterPattern == nil {
  3800. invalidParams.Add(request.NewErrParamRequired("FilterPattern"))
  3801. }
  3802. if s.LogGroupName == nil {
  3803. invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
  3804. }
  3805. if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
  3806. invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
  3807. }
  3808. if s.RoleArn != nil && len(*s.RoleArn) < 1 {
  3809. invalidParams.Add(request.NewErrParamMinLen("RoleArn", 1))
  3810. }
  3811. if invalidParams.Len() > 0 {
  3812. return invalidParams
  3813. }
  3814. return nil
  3815. }
  3816. type PutSubscriptionFilterOutput struct {
  3817. _ struct{} `type:"structure"`
  3818. }
  3819. // String returns the string representation
  3820. func (s PutSubscriptionFilterOutput) String() string {
  3821. return awsutil.Prettify(s)
  3822. }
  3823. // GoString returns the string representation
  3824. func (s PutSubscriptionFilterOutput) GoString() string {
  3825. return s.String()
  3826. }
  3827. type RejectedLogEventsInfo struct {
  3828. _ struct{} `type:"structure"`
  3829. ExpiredLogEventEndIndex *int64 `locationName:"expiredLogEventEndIndex" type:"integer"`
  3830. TooNewLogEventStartIndex *int64 `locationName:"tooNewLogEventStartIndex" type:"integer"`
  3831. TooOldLogEventEndIndex *int64 `locationName:"tooOldLogEventEndIndex" type:"integer"`
  3832. }
  3833. // String returns the string representation
  3834. func (s RejectedLogEventsInfo) String() string {
  3835. return awsutil.Prettify(s)
  3836. }
  3837. // GoString returns the string representation
  3838. func (s RejectedLogEventsInfo) GoString() string {
  3839. return s.String()
  3840. }
  3841. // An object indicating the search status of a log stream in a FilterLogEvents
  3842. // request.
  3843. type SearchedLogStream struct {
  3844. _ struct{} `type:"structure"`
  3845. // The name of the log stream.
  3846. LogStreamName *string `locationName:"logStreamName" min:"1" type:"string"`
  3847. // Indicates whether all the events in this log stream were searched or more
  3848. // data exists to search by paginating further.
  3849. SearchedCompletely *bool `locationName:"searchedCompletely" type:"boolean"`
  3850. }
  3851. // String returns the string representation
  3852. func (s SearchedLogStream) String() string {
  3853. return awsutil.Prettify(s)
  3854. }
  3855. // GoString returns the string representation
  3856. func (s SearchedLogStream) GoString() string {
  3857. return s.String()
  3858. }
  3859. type SubscriptionFilter struct {
  3860. _ struct{} `type:"structure"`
  3861. // A point in time expressed as the number of milliseconds since Jan 1, 1970
  3862. // 00:00:00 UTC.
  3863. CreationTime *int64 `locationName:"creationTime" type:"long"`
  3864. DestinationArn *string `locationName:"destinationArn" min:"1" type:"string"`
  3865. // A name for a metric or subscription filter.
  3866. FilterName *string `locationName:"filterName" min:"1" type:"string"`
  3867. // A symbolic description of how CloudWatch Logs should interpret the data in
  3868. // each log event. For example, a log event may contain timestamps, IP addresses,
  3869. // strings, and so on. You use the filter pattern to specify what to look for
  3870. // in the log event message.
  3871. FilterPattern *string `locationName:"filterPattern" type:"string"`
  3872. LogGroupName *string `locationName:"logGroupName" min:"1" type:"string"`
  3873. RoleArn *string `locationName:"roleArn" min:"1" type:"string"`
  3874. }
  3875. // String returns the string representation
  3876. func (s SubscriptionFilter) String() string {
  3877. return awsutil.Prettify(s)
  3878. }
  3879. // GoString returns the string representation
  3880. func (s SubscriptionFilter) GoString() string {
  3881. return s.String()
  3882. }
  3883. type TestMetricFilterInput struct {
  3884. _ struct{} `type:"structure"`
  3885. // A symbolic description of how CloudWatch Logs should interpret the data in
  3886. // each log event. For example, a log event may contain timestamps, IP addresses,
  3887. // strings, and so on. You use the filter pattern to specify what to look for
  3888. // in the log event message.
  3889. //
  3890. // FilterPattern is a required field
  3891. FilterPattern *string `locationName:"filterPattern" type:"string" required:"true"`
  3892. // A list of log event messages to test.
  3893. //
  3894. // LogEventMessages is a required field
  3895. LogEventMessages []*string `locationName:"logEventMessages" min:"1" type:"list" required:"true"`
  3896. }
  3897. // String returns the string representation
  3898. func (s TestMetricFilterInput) String() string {
  3899. return awsutil.Prettify(s)
  3900. }
  3901. // GoString returns the string representation
  3902. func (s TestMetricFilterInput) GoString() string {
  3903. return s.String()
  3904. }
  3905. // Validate inspects the fields of the type to determine if they are valid.
  3906. func (s *TestMetricFilterInput) Validate() error {
  3907. invalidParams := request.ErrInvalidParams{Context: "TestMetricFilterInput"}
  3908. if s.FilterPattern == nil {
  3909. invalidParams.Add(request.NewErrParamRequired("FilterPattern"))
  3910. }
  3911. if s.LogEventMessages == nil {
  3912. invalidParams.Add(request.NewErrParamRequired("LogEventMessages"))
  3913. }
  3914. if s.LogEventMessages != nil && len(s.LogEventMessages) < 1 {
  3915. invalidParams.Add(request.NewErrParamMinLen("LogEventMessages", 1))
  3916. }
  3917. if invalidParams.Len() > 0 {
  3918. return invalidParams
  3919. }
  3920. return nil
  3921. }
  3922. type TestMetricFilterOutput struct {
  3923. _ struct{} `type:"structure"`
  3924. Matches []*MetricFilterMatchRecord `locationName:"matches" type:"list"`
  3925. }
  3926. // String returns the string representation
  3927. func (s TestMetricFilterOutput) String() string {
  3928. return awsutil.Prettify(s)
  3929. }
  3930. // GoString returns the string representation
  3931. func (s TestMetricFilterOutput) GoString() string {
  3932. return s.String()
  3933. }
  3934. const (
  3935. // ExportTaskStatusCodeCancelled is a ExportTaskStatusCode enum value
  3936. ExportTaskStatusCodeCancelled = "CANCELLED"
  3937. // ExportTaskStatusCodeCompleted is a ExportTaskStatusCode enum value
  3938. ExportTaskStatusCodeCompleted = "COMPLETED"
  3939. // ExportTaskStatusCodeFailed is a ExportTaskStatusCode enum value
  3940. ExportTaskStatusCodeFailed = "FAILED"
  3941. // ExportTaskStatusCodePending is a ExportTaskStatusCode enum value
  3942. ExportTaskStatusCodePending = "PENDING"
  3943. // ExportTaskStatusCodePendingCancel is a ExportTaskStatusCode enum value
  3944. ExportTaskStatusCodePendingCancel = "PENDING_CANCEL"
  3945. // ExportTaskStatusCodeRunning is a ExportTaskStatusCode enum value
  3946. ExportTaskStatusCodeRunning = "RUNNING"
  3947. )
  3948. const (
  3949. // OrderByLogStreamName is a OrderBy enum value
  3950. OrderByLogStreamName = "LogStreamName"
  3951. // OrderByLastEventTime is a OrderBy enum value
  3952. OrderByLastEventTime = "LastEventTime"
  3953. )