PageSourceSearch

https://console2.instaclustr.com/chunk-UVV3OPBY.js

js instaclustr.com collected 2026-10-01 10:38:35 UTC 6,528 bytes, 3 lines download raw bytes

1import{b as p}from"./chunk-6C4ITI77.js";import{y as z,z as J}from"./chunk-P6MTM5JK.js";import"./chunk-HFPFZ46Q.js";import"./chunk-ERIDXJVM.js";import{a as Y}from"./chunk-IJNNQGWW.js";import{$ as K,Ma as te,ca as Z,da as d,g as Q,i as L,u as q,ua as ee}from"./chunk-FIW55SPL.js";import{$ as c,Sa as H,Xc as W,Ya as V,_d as X,c as T,ca as R,cc as U,ec as v,fa as j,fc as B,ia as G,ya as _}from"./chunk-MFVRKY3Y.js";import{Cb as I,Gb as D,H as y,Hb as A,I as C,Ib as F,K as h,Kc as O,Na as S,Qb as u,Ua as o,Wc as P,Ya as w,Za as N,ab as E,ca as M,ea as f,ld as $,mb as m,nb as a,ob as n,pb as k,q as g,va as b}from"./chunk-E6QGSO2A.js";import"./chunk-QBUHZOWM.js";var re=(()=>{class r{constructor(e,t){this.api=e,this.clusterService=t,this.externalS3Buckets=this.patchableExternalS3Buckets=new _(()=>this.loadBuckets$()),this.clusterService.currentCluster.observable$.pipe(M((i,s)=>i===s)).subscribe(i=>{this.currentCluster=i,i&&i.status==="RUNNING"&&i.dataCentres[0]?.provider===q.AWS_VPC?this.externalS3Buckets.clearAndLoad():this.externalS3Buckets.clearAndCancel()})}createBucket$(e,t){return this.api.post("/cluster-management/v2/resources/applications/opensearch/external-s3-buckets/v2/",{clusterId:this.currentCluster?.id,s3BucketName:e,s3Prefixes:t}).pipe(b(i=>{this.patchableExternalS3Buckets.observable$.pipe(c,f(1)).subscribe(s=>{this.patchableExternalS3Buckets.pushNew([...s,this.mapResultToBucket(i)])})}))}deleteBucket$(e){return this.api.delete(`/cluster-management/v2/resources/applications/opensearch/external-s3-buckets/v2/${e}`,void 0,[]).pipe(b(()=>{this.patchableExternalS3Buckets.observable$.pipe(c,f(1)).subscribe(t=>{this.patchableExternalS3Buckets.pushNew(t.filter(i=>i.id!==e))})}))}loadBuckets$(){return this.api.get(`/cluster-management/v2/data-sources/opensearch_cluster/${this.currentCluster?.id}/external-s3-buckets/v2/`).pipe(g(e=>this.mapResultToBuckets(e)))}mapResultToBucket(e){return{id:e.id,s3BucketName:e.s3BucketName,s3Prefixes:e.s3Prefixes??[]}}mapResultToBuckets(e){return((Array.isArray(e)?e[0]:e)?.externalS3Buckets??[]).map(s=>this.mapResultToBucket(s))}static{this.\u0275fac=function(t){return new(t||r)(h(V),h(p))}}static{this.\u0275prov=y({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();function ce(r,le){if(r&1&&k(0,"insta-form-generator",4),r&2){let e=I();m("model",e.formGeneratorModel)("formMessage",e.formMessage)("blockForm",e.blockForm)}}var se=(()=>{class r{constructor(e,t,i,s,l){this.accountService=e,this.clustersService=t,this.dialogService=i,this.snackBar=s,this.externalS3BucketsService=l,this.blockForm=!1,this.permitted=!1,this.columns=[{header:"S3 Bucket Name",propertyName:"bucketName"},{header:"Prefixes",propertyName:"prefixes"}],this.actions=[{buttonName:"Delete",action:(x,me,oe)=>this.deleteBucket(x,oe),showIfRowCondition:x=>this.permitted,disabledIfRowCondition:()=>this.mutateDisabled?this.mutateDisabledHint:null,color:"warn"}],this.data=[],this.mutateDisabled=!1,this.mutateDisabledHint="",this.s3BucketNameModel=new v("s3BucketName","S3 Bucket Name").withPlaceholder("my-snapshot-bucket").withValidators([T.required,B.s3bucketName]).withHint("The S3 bucket that already exists in the same region as your cluster."),this.s3PrefixesModel=new v("s3Prefixes","Prefixes (comma-separated)").withValidators([B.s3PrefixList()]).withHint("Optional. Comma-separated list of path prefixes within the bucket to grant access to."),this.subscriptions=new H}ngOnInit(){this.formGeneratorModel=new Z([this.s3BucketNameModel,this.s3PrefixesModel]).withSubmitListener(()=>this.onSubmit()).withSubmitButtonLabel("Attach Bucket"),this.subscriptions.add(this.accountService.currentAccount$.subscribe(e=>{this.permitted=Y.EDIT_SETTINGS.appliesTo(e)}),this.clustersService.currentCluster.observable$.pipe(c).subscribe(e=>{this.applySuspendedEditGating(e.status)}),this.externalS3BucketsService.externalS3Buckets.observable$.subscribe(e=>{this.data=(e??[]).map(t=>({id:t.id??"",bucketName:t.s3BucketName,prefixes:t.s3Prefixes.join(", ")||"\u2014"}))}))}applySuspendedEditGating(e){this.mutateDisabled=!!e&&z(e),this.mutateDisabledHint=this.mutateDisabled?J(e):"",this.formGeneratorModel?.setSubmitButtonEnabled(!this.mutateDisabled,this.mutateDisabledHint)}ngOnDestroy(){this.subscriptions.destroyAll()}onSubmit(){let e=this.form?.value;if(!e)return;let t=(e.s3Prefixes??"").split(",").map(i=>i.trim()).filter(i=>i.length>0);this.subscriptions.add(R(this,this.externalS3BucketsService.createBucket$(e.s3BucketName,t),"Bucket attached successfully.","Failed to attach bucket."))}deleteBucket(e,t){let i=K.spawn(this.dialogService,{title:"Confirm delete",content:`Are you sure you want to detach bucket '${t.bucketName}'?`});this.subscriptions.add(i.afterClosed().subscribe(s=>{if(!s)return e();this.subscriptions.add(j(e,this.snackBar,this.externalS3BucketsService.deleteBucket$(t.id),l=>`Bucket '${t.bucketName}' has been detached.`,l=>G(l)))}))}static{this.\u0275fac=function(t){return new(t||r)(o(W),o(p),o(Q),o(L),o(re))}}static{this.\u0275cmp=w({type:r,selectors:[["insta-opensearch-external-s3-buckets"]],viewQuery:function(t,i){if(t&1&&D(d,5),t&2){let s;
1A(s=F())&&(i.form=s.first)}},standalone:!1,decls:10,vars:4,consts:[["type","info"],[1,"mt-2"],[3,"model","formMessage","blockForm",4,"ngIf"],["noDataMessage","No external S3 buckets attached.",3,"columns","data","actions"],[3,"model","formMessage","blockForm"]],template:function(t,i){t&1&&(a(0,"h2"),u(1,"External S3 Buckets"),n(),a(2,"p"),u(3,` Attach additional S3 buckets to your OpenSearch cluster to grant read-only access for snapshot restore. Once attached, the cluster's IAM role and VPC endpoint policy will be updated to allow access to the bucket. You are responsible for configuring the snapshot repository within OpenSearch itself.
2`),n(),a(4,"insta-notification-box",0),u(5,` Ensure the S3 bucket is in the same AWS region as your cluster before attaching it. To register the snapshot repository in OpenSearch after attaching, use the OpenSearch Snapshot APIs.
3`),n(),a(6,"div",1),E(7,ce,1,3,"insta-form-generator",2),n(),a(8,"div",1),k(9,"insta-table",3),n()),t&2&&(S(7),m("ngIf",i.formGeneratorModel&&i.permitted),S(2),m("columns",i.columns)("data",i.data)("actions",i.actions))},dependencies:[O,X,d,U],encapsulation:2})}}return r})();var qe=(()=>{class r{static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275mod=N({type:r})}static{this.\u0275inj=C({imports:[P,te,ee,$.forChild([{path:"",component:se}])]})}}return r})();export{qe as OpenSearchExternalS3BucketsModule};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.